dealposbooks 5.46.2 → 5.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-2RNKYO2Q.js +1 -0
- package/{chunk-RZHWMBFY.js → chunk-35UWKNGE.js} +1 -1
- package/{chunk-EL5BUFMO.js → chunk-3IEOINKV.js} +1 -1
- package/chunk-4X3G6MGP.js +1 -0
- package/{chunk-KGQGMXW6.js → chunk-53HJBLFX.js} +1 -1
- package/{chunk-EQ4PLHI4.js → chunk-53I5JFOQ.js} +1 -1
- package/{chunk-HG5MKVNR.js → chunk-5BXMDXZD.js} +1 -1
- package/chunk-5HZBSMCT.js +7 -0
- package/{chunk-YZH7Y43Y.js → chunk-5JZTWUDG.js} +1 -1
- package/chunk-5K3KAKU5.js +1 -0
- package/{chunk-IV5AW2OY.js → chunk-5SYYPB6N.js} +1 -1
- package/{chunk-IWF5R5FH.js → chunk-5YO43YBO.js} +1 -1
- package/{chunk-4ODQPLDW.js → chunk-6XE7LGUS.js} +1 -1
- package/chunk-6ZZZTNIH.js +130 -0
- package/{chunk-4IHVNLEA.js → chunk-AHX56FH2.js} +1 -1
- package/chunk-AXU3K2IY.js +1 -0
- package/{chunk-2XUSZCQL.js → chunk-BUDZ3ONE.js} +1 -1
- package/{chunk-EXBBFIDN.js → chunk-C3IOIS5V.js} +1 -1
- package/chunk-CL4EKWSU.js +1 -0
- package/{chunk-BKLUYVDG.js → chunk-CWDU4F7J.js} +1 -1
- package/{chunk-LFZCMZAP.js → chunk-CWFLUFKM.js} +1 -1
- package/{chunk-MJSJBCDR.js → chunk-DEOAL7PG.js} +1 -1
- package/{chunk-6GN3MGBY.js → chunk-DHLFL3KH.js} +1 -1
- package/{chunk-ZWR2YCUC.js → chunk-DRTMMJ4Q.js} +1 -1
- package/{chunk-GXJ3G456.js → chunk-DTFLX2XQ.js} +1 -1
- package/{chunk-DFGIXWZK.js → chunk-DU72RNAU.js} +1 -1
- package/{chunk-Q5CVMJZC.js → chunk-E4MHRZVH.js} +1 -1
- package/{chunk-5RW6MEBV.js → chunk-EEJGJ7WF.js} +1 -1
- package/chunk-EIV4TELQ.js +1 -0
- package/{chunk-BJBAWNDR.js → chunk-EPLZY6T4.js} +1 -1
- package/chunk-EQU7DDK6.js +1 -0
- package/chunk-ETFYQ4GV.js +1 -0
- package/{chunk-PNWKCLWA.js → chunk-F5CCLXIY.js} +1 -1
- package/{chunk-CVL3S2HY.js → chunk-GDQUB54I.js} +1 -1
- package/chunk-GJYEM7DL.js +1 -0
- package/{chunk-H7Q35Y7G.js → chunk-HQMTUZZQ.js} +1 -1
- package/{chunk-BLR3HBYP.js → chunk-HZ7BZ72K.js} +1 -1
- package/chunk-IMVMIXVJ.js +1028 -0
- package/{chunk-YTZ3JIC5.js → chunk-IYFNOI7S.js} +1 -1
- package/{chunk-UP67MADL.js → chunk-JOHRJHEX.js} +1 -1
- package/{chunk-HAQ36ZI6.js → chunk-JZVNZ3I3.js} +1 -1
- package/{chunk-C6TI7B2G.js → chunk-L2524E6T.js} +1 -1
- package/{chunk-NZN6QJR3.js → chunk-LABWETHZ.js} +1 -1
- package/{chunk-6A2KUPOG.js → chunk-LWYAFMN3.js} +1 -1
- package/{chunk-OR5FLZPY.js → chunk-M3TKVRYP.js} +1 -1
- package/{chunk-UCDJJGO5.js → chunk-MBJKUKHJ.js} +1 -1
- package/chunk-ML5KV2U2.js +1 -0
- package/{chunk-VKKAJODP.js → chunk-MT3DTYJO.js} +1 -1
- package/{chunk-36OX4S7M.js → chunk-NDLX3ORI.js} +1 -1
- package/{chunk-Y3URGAXL.js → chunk-NHHXXJY6.js} +1 -1
- package/{chunk-N4JIPI53.js → chunk-NM5M567G.js} +1 -1
- package/{chunk-XFVMOYX7.js → chunk-OJ2VC4ER.js} +1 -1
- package/chunk-OLLF6BKH.js +1 -0
- package/{chunk-45JI5H5L.js → chunk-OVEQKHUV.js} +2 -2
- package/{chunk-NHIAQTUJ.js → chunk-OW25MQS7.js} +1 -1
- package/{chunk-XD7VHCRC.js → chunk-PKOERZXQ.js} +1 -1
- package/{chunk-NCDT6JPP.js → chunk-PTQPB44D.js} +1 -1
- package/{chunk-NPAM3NOH.js → chunk-PXN4RATH.js} +1 -1
- package/chunk-Q47KHO2M.js +1 -0
- package/{chunk-EB6NEJHF.js → chunk-Q4LKKVQU.js} +1 -1
- package/{chunk-VJ3IBUVO.js → chunk-Q7SK53ST.js} +1 -1
- package/{chunk-Q24GCSGD.js → chunk-QWTGY7FA.js} +1 -1
- package/chunk-RF27SIL3.js +1 -0
- package/{chunk-R7N6BWL5.js → chunk-RXOOTYEO.js} +1 -1
- package/{chunk-XFOCD2H7.js → chunk-S3FQPUAS.js} +2 -2
- package/{chunk-2AAVNIG7.js → chunk-SEXB43QC.js} +1 -1
- package/chunk-SN7DLFX2.js +1 -0
- package/chunk-SS4J7T3N.js +1 -0
- package/{chunk-B54PFCWI.js → chunk-SZAGTA5I.js} +1 -1
- package/{chunk-7DYACF4D.js → chunk-T3EH4DR2.js} +1 -1
- package/chunk-TUFQ5JVG.js +180 -0
- package/{chunk-KS2JAY2L.js → chunk-V4B5LQYD.js} +1 -1
- package/{chunk-ARH3WEEF.js → chunk-V4SH72WU.js} +1 -1
- package/{chunk-IHZ55QSI.js → chunk-VK3G2VIU.js} +1 -1
- package/chunk-VL2HEHI5.js +1 -0
- package/{chunk-FMHGC2MA.js → chunk-VSHPIUZM.js} +1 -1
- package/{chunk-PEOJDDJN.js → chunk-VTCV67A4.js} +1 -1
- package/{chunk-G7QPRYOR.js → chunk-WFIXL354.js} +1 -1
- package/{chunk-7DJNG6VE.js → chunk-WGJFR6CK.js} +1 -1
- package/{chunk-5GAJOO6O.js → chunk-WPMC3LJJ.js} +3 -3
- package/{chunk-T6OMUVQY.js → chunk-XDJSQLQN.js} +1 -1
- package/{chunk-3GGXPPQT.js → chunk-XPRP6AB4.js} +1 -1
- package/{chunk-ETHACYOI.js → chunk-XT4YHL2M.js} +1 -1
- package/{chunk-OVAQBQEJ.js → chunk-YFNWEI3R.js} +1 -1
- package/{chunk-MFK5RQPJ.js → chunk-YZTBV6HG.js} +1 -1
- package/{chunk-B2BDKUAE.js → chunk-ZBO62XAM.js} +2 -2
- package/{chunk-KJ2WX3FC.js → chunk-ZMIVD3SF.js} +1 -1
- package/chunk-ZUDQOT7C.js +1 -0
- package/index.html +2 -2
- package/{main-ON5LJQLR.js → main-Q2T6QX2N.js} +1 -1
- package/package.json +1 -1
- package/chunk-6LW7PY2Z.js +0 -1
- package/chunk-6VBTHQT3.js +0 -7
- package/chunk-BVXYCUBY.js +0 -1
- package/chunk-CO2UYCZ2.js +0 -1
- package/chunk-EAEMBSUD.js +0 -130
- package/chunk-G6IPI7YM.js +0 -1
- package/chunk-H6HNANYB.js +0 -959
- package/chunk-N4RQTE4T.js +0 -1
- package/chunk-NQXDAWEZ.js +0 -1
- package/chunk-PFWNBHNC.js +0 -1
- package/chunk-Q34IDOYA.js +0 -1
- package/chunk-QUUGFWG3.js +0 -1
- package/chunk-S7AFTSCW.js +0 -1
- package/chunk-UH5YUPBR.js +0 -1
- package/chunk-VGNJD35F.js +0 -70
- package/chunk-WFQQUFSS.js +0 -1
- package/chunk-WKE2HPSD.js +0 -180
- package/chunk-WY2JNDES.js +0 -1
- package/chunk-X46QKMJY.js +0 -1
- package/chunk-XXNDXSPP.js +0 -1
- package/chunk-YV2QJ63P.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-XD7VHCRC.js";import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as de,b as fe}from"./chunk-3A4BFUGD.js";import{d as le,e as Je,i as Ke,j as qe,k as ne}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Le}from"./chunk-QF4D5YPK.js";import{a as re,b as pe}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as W,b as j}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as Ae,b as J}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as M}from"./chunk-WKE2HPSD.js";import"./chunk-VGNJD35F.js";import{a as Y,b as $}from"./chunk-2XUSZCQL.js";import{a as Q,b as Fe,c as Te,d as we,e as Me,f as De,g as Ye}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as He,w as N,x as G}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as V,f as ye,j as te,k as Pe,l as be,m as Oe,n as ze,o as Ie,u as Ee,w as H,x as ae}from"./chunk-OIBDX2CA.js";import{b as ie,d as Ue,e as D,l as A}from"./chunk-AOOG6YOT.js";import{a as ve}from"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{k as B,o as je,s as w}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as v,Cc as Se,Db as x,Dc as z,Ec as oe,Ha as I,Lb as c,Nc as Ve,Ob as q,Oc as $e,Qb as Ce,Rb as P,Rc as u,Tb as b,Ub as O,Vb as r,Wb as a,Xb as Z,Y as U,_ as F,bd as ee,c as ue,ca as he,cd as We,ec as y,fc as s,hb as p,ia as h,qa as C,ra as S,rc as m,s as X,sc as _,tc as E,vc as Be,xb as T}from"./chunk-NMCKMUY4.js";import{a as f,b as g}from"./chunk-YQFG5XE2.js";var k=(()=>{class t{constructor(){this.httpService=h(ve)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(R||{});var it={[R.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[R.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[R.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[R.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[R.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[R.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[R.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[R.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[R.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function _t(t,i){if(t&1){let e=v();r(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.onSubmit())}),a()()}}function gt(t,i){if(t&1&&(r(0,"p-tab",10),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),_(e.label)}}function xt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function ht(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ct(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",17),m(6),a()(),r(7,"p-select",18),x(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function St(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function yt(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",20),m(6),a()(),r(7,"p-select",18),x(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Pt(t,i){if(t&1&&(r(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,Ct,12,4,"div",14,P),a()(),r(6,"div",12)(7,"div",13),b(8,yt,12,4,"div",14,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function bt(t,i){if(t&1){let e=v();r(0,"form",8),y("ngSubmit",function(){C(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",9)(2,"p-tablist"),b(3,gt,2,2,"p-tab",10,P),a(),r(5,"p-tabpanels"),b(6,Pt,10,2,"p-tabpanel",10,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,i){if(t&1&&x(0,bt,8,3,"form",7),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(k),this.fb=h(Ee),this.tab=I(R.POSGLOBAL_SELL),this.tabs=I(Object.values(R).map(e=>({label:e,value:e}))),this.posIntegration=I(null),this.form=I([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=R}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let ce=`${d}_${L}`;o.has(ce)||(o.add(ce),n.push({typeID:d,accountID:L||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),a())},dependencies:[M,ot,nt,tt,et,Xe,Ze,He,j,W,H,Pe,V,ye,w,B,A,G,N,ae,be,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),_(e.name.slice(0,10))}}function Ft(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Et,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Tt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.accountName)}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Tt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,It,e.id)),p(),_(e.name),p(),O(e.accounts)}}function Mt(t,i){if(t&1&&(r(0,"p-table",5),x(1,Ft,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Dt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){C(e);let l=s();return S(l.onSearch(o))}),x(1,Mt,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var pt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.paymentConfiguration=I(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&x(0,Dt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ne,le,Je,w,B,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var At={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ne=Fe(De(At),Te(t=>({first:ee(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ee(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Me(t=>{let i=h(k);return{updateFilter:n=>{Q(t,o=>g(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:de(ue(U(n=>i.fetchPOSOutletConfiguration(n).pipe(fe({next:o=>{Q(t,l=>g(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),we(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function Rt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.value)}}function Lt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Rt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Nt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Nt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,kt,e.OutletID)),p(),E(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,i){if(t&1&&m(0),t&2){let e=s(2);Be(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function $t(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=s();return S(l.onPage(o))}),x(2,Lt,5,0,"ng-template",null,1,u)(4,Gt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var lt=(()=>{class t{constructor(){this.store=h(Ne)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(g(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[Se([Ne])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return C(l),S(o.onSearch(L))}),x(1,$t,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,J,ne,le,A,D,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),jt=()=>({height:"calc(100vh - 150px)"});function Ut(t,i){if(t&1){let e=v();r(0,"a",5),m(1,"Cancel"),a(),r(2,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.updatePOsOutletConfiguration())}),a()}}function zt(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ht(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Yt(t,i){if(t&1&&(r(0,"div",12)(1,"span",14),m(2),a(),r(3,"p-select",15),x(4,zt,7,2,"ng-template",null,2,u)(6,Ht,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),_((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Jt(t,i){t&1&&Z(0,"hr")}function Kt(t,i){if(t&1&&(r(0,"div",9)(1,"h3",10),m(2),Ve(3,"titlecase"),a(),r(4,"div",11),b(5,Yt,8,3,"div",12,P),a()(),x(7,Jt,1,0,"hr",13)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),E(" ",$e(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function qt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Kt,8,5,null,null,P),a()()()()),t&2){let e=s();q(z(5,Wt)),p(),q(z(6,jt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.outletForm=I(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Ee)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,Ut,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),a()),n&2&&c("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,B,je,J,ae,Pe,V,ye,be,Ie,Oe,ze,j,W,$,Y,re,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,i){if(t&1){let e=v();r(0,"a",6),m(1,"Cancel"),a(),r(2,"p-button",7),y("onClick",function(){C(e);let o=s(3);return S(o.updatePOSOutletConfiguration())}),a()}}function on(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function an(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function rn(t,i){if(t&1){let e=v();r(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),a()(),Z(5,"div",13),r(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),x(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),_(e.outletName.slice(0,15)),p(3),q(z(7,tn)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,rn,12,8,"div",9,P),a()()()),t&2){let e=s(3);q(z(4,Zt)),p(),q(z(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,i){if(t&1&&(r(0,"app-main-panel",4),x(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,i){if(t&1&&x(0,ln,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var st=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.paymentForm=I(null),this.router=h(Ue)}ngOnInit(){this.route.paramMap.pipe(X(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Le("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=g(f({},this.paymentForm()),{form:g(f({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Le("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&x(0,mn,1,1,"app-main-panel",4),n&2&&Ce(o.paymentForm()?0:-1)},dependencies:[J,Ae,M,w,B,pe,re,j,W,H,V,te,A,D,G,N,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function sn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSTaxConfiguration())}),a()()}}function cn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",15)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function un(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function dn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),x(5,cn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),_(e.name),p(),c("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),b(4,dn,9,3,"div",11,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(k),this.taxForm=I(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=g(f({},this.taxForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,sn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,J,w,j,W,pe,H,V,te,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,i){t&1&&Z(0,"p-button",6)}function hn(t,i){if(t&1&&x(0,xn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function Cn(t,i){t&1&&(r(0,"tr")(1,"th",8),Z(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function Sn(t,i){if(t&1&&(r(0,"tr")(1,"td"),Z(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",oe(4,gn,e.id)),p(),_(e.name),p(2),_(e.description)}}function vn(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=s();return S(l.onSelectAll(o))}),x(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",z(2,_n))}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(k),this.writeoffList=I(null),this.hasCheckedItems=ee(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(X(e=>g(f({},e),{data:e.data.map(n=>g(f({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=g(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(g(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>g(f({},l),{checked:e.checked}));this.writeoffList.set(g(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,B,ne,le,Ke,qe,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Pn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){C(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function bn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function On(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function In(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),x(5,bn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),_(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,In,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),q(z(2,yn)),p(4),O(e.writeOffForm().form)}}function Fn(t,i){if(t&1&&(r(0,"app-main-panel",5),x(1,Pn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.route=h(ie),this.writeOffForm=I(null)}ngOnInit(){this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=g(f({},this.writeOffForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&x(0,Fn,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,B,J,Ae,pe,re,j,W,H,V,te,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=h(ve)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Ge=Fe(De(Tn),Ye("POSExpenseOptionStore"),Te(t=>({hasCheckedRows:ee(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ee(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),Me(t=>{let i=h(Re);return{onRowSelect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!0}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!1}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>g(f({},d),{checked:n}));return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:de(ue(U(()=>i.getExpenseOptions().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>g(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:de(ue(U(()=>i.getExpenseOptionsLoader().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),we({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function wn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSExpenseOptionConfiguration())}),a()()}}function Mn(t,i){if(t&1&&(r(0,"div",5)(1,"div",14)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function Dn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function An(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"label",12),m(3),a(),r(4,"p-select",13),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateData(o,l))}),x(5,Mn,4,1,"ng-template",null,2,u)(7,Dn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),_(n.name),p(),c("options",l.store.data().options.chartOfAccountOptions)("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")}}function kn(t,i){if(t&1&&b(0,An,9,3,"div",10,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function Rn(t,i){t&1&&(r(0,"div",9)(1,"p"),m(2,"No expense options available."),a()())}function Ln(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",8),x(4,kn,2,0)(5,Rn,3,0,"div",9),a()()()()),t&2){let e=s();p(4),Ce(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=h(Ge),this.expenseOptService=h(Re),this.expenseOptForm=I({ListData:[]}),this.originalData=I([]),We(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let ce=n[L];return ce&&d.AccountID!==ce.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=g(f({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[Se([Ge])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,wn,4,0,"ng-template",null,0,u)(3,Ln,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ne,$,Y,G,N,w,D,j,W,ae,V,H,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var za=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:lt},{path:"outlets/:id",component:mt},{path:"payments",component:pt},{path:"payments/:id",component:st},{path:"taxs",component:ct},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:ft}]}];export{za as POS_SETUP_ROUTES};
|
|
1
|
+
import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-PKOERZXQ.js";import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as de,b as fe}from"./chunk-3A4BFUGD.js";import{d as le,e as Je,i as Ke,j as qe,k as ne}from"./chunk-3IEOINKV.js";import"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import{a as Le}from"./chunk-QF4D5YPK.js";import{a as re,b as pe}from"./chunk-Q7SK53ST.js";import"./chunk-SEXB43QC.js";import{a as W,b as j}from"./chunk-CWFLUFKM.js";import"./chunk-LWYAFMN3.js";import"./chunk-NDLX3ORI.js";import"./chunk-E4MHRZVH.js";import"./chunk-XPRP6AB4.js";import"./chunk-YZTBV6HG.js";import{a as Ae,b as J}from"./chunk-ZMIVD3SF.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{g as M}from"./chunk-TUFQ5JVG.js";import"./chunk-ZUDQOT7C.js";import{a as Y,b as $}from"./chunk-BUDZ3ONE.js";import{b as Q,c as Fe,d as Te,e as we,f as Me,g as De,h as Ye}from"./chunk-SN7DLFX2.js";import"./chunk-V4SH72WU.js";import{o as He,w as N,x as G}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import{e as V,f as ye,j as te,k as Pe,l as be,m as Oe,n as ze,o as Ie,u as Ee,w as H,x as ae}from"./chunk-OIBDX2CA.js";import{b as ie,d as Ue,e as D,l as A}from"./chunk-AOOG6YOT.js";import{a as ve}from"./chunk-M3TKVRYP.js";import"./chunk-2MKKFLNJ.js";import{k as B,o as je,s as w}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as v,Cc as Se,Db as x,Dc as z,Ec as oe,Ha as I,Lb as c,Nc as Ve,Ob as q,Oc as $e,Qb as Ce,Rb as P,Rc as u,Tb as b,Ub as O,Vb as r,Wb as a,Xb as Z,Y as U,_ as F,bd as ee,c as ue,ca as he,cd as We,ec as y,fc as s,hb as p,ia as h,qa as C,ra as S,rc as m,s as X,sc as _,tc as E,vc as Be,xb as T}from"./chunk-NMCKMUY4.js";import{a as f,b as g}from"./chunk-YQFG5XE2.js";var k=(()=>{class t{constructor(){this.httpService=h(ve)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(R||{});var it={[R.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[R.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[R.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[R.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[R.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[R.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[R.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[R.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[R.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function _t(t,i){if(t&1){let e=v();r(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.onSubmit())}),a()()}}function gt(t,i){if(t&1&&(r(0,"p-tab",10),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),_(e.label)}}function xt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function ht(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ct(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",17),m(6),a()(),r(7,"p-select",18),x(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function St(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function yt(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",20),m(6),a()(),r(7,"p-select",18),x(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Pt(t,i){if(t&1&&(r(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,Ct,12,4,"div",14,P),a()(),r(6,"div",12)(7,"div",13),b(8,yt,12,4,"div",14,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function bt(t,i){if(t&1){let e=v();r(0,"form",8),y("ngSubmit",function(){C(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",9)(2,"p-tablist"),b(3,gt,2,2,"p-tab",10,P),a(),r(5,"p-tabpanels"),b(6,Pt,10,2,"p-tabpanel",10,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,i){if(t&1&&x(0,bt,8,3,"form",7),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(k),this.fb=h(Ee),this.tab=I(R.POSGLOBAL_SELL),this.tabs=I(Object.values(R).map(e=>({label:e,value:e}))),this.posIntegration=I(null),this.form=I([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=R}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let ce=`${d}_${L}`;o.has(ce)||(o.add(ce),n.push({typeID:d,accountID:L||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),a())},dependencies:[M,ot,nt,tt,et,Xe,Ze,He,j,W,H,Pe,V,ye,w,B,A,G,N,ae,be,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),_(e.name.slice(0,10))}}function Ft(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Et,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Tt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.accountName)}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Tt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,It,e.id)),p(),_(e.name),p(),O(e.accounts)}}function Mt(t,i){if(t&1&&(r(0,"p-table",5),x(1,Ft,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Dt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){C(e);let l=s();return S(l.onSearch(o))}),x(1,Mt,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var pt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.paymentConfiguration=I(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&x(0,Dt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ne,le,Je,w,B,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var At={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ne=Fe(De(At),Te(t=>({first:ee(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ee(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Me(t=>{let i=h(k);return{updateFilter:n=>{Q(t,o=>g(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:de(ue(U(n=>i.fetchPOSOutletConfiguration(n).pipe(fe({next:o=>{Q(t,l=>g(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),we(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function Rt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.value)}}function Lt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Rt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Nt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Nt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,kt,e.OutletID)),p(),E(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,i){if(t&1&&m(0),t&2){let e=s(2);Be(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function $t(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=s();return S(l.onPage(o))}),x(2,Lt,5,0,"ng-template",null,1,u)(4,Gt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var lt=(()=>{class t{constructor(){this.store=h(Ne)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(g(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[Se([Ne])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return C(l),S(o.onSearch(L))}),x(1,$t,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,J,ne,le,A,D,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),jt=()=>({height:"calc(100vh - 150px)"});function Ut(t,i){if(t&1){let e=v();r(0,"a",5),m(1,"Cancel"),a(),r(2,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.updatePOsOutletConfiguration())}),a()}}function zt(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ht(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Yt(t,i){if(t&1&&(r(0,"div",12)(1,"span",14),m(2),a(),r(3,"p-select",15),x(4,zt,7,2,"ng-template",null,2,u)(6,Ht,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),_((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Jt(t,i){t&1&&Z(0,"hr")}function Kt(t,i){if(t&1&&(r(0,"div",9)(1,"h3",10),m(2),Ve(3,"titlecase"),a(),r(4,"div",11),b(5,Yt,8,3,"div",12,P),a()(),x(7,Jt,1,0,"hr",13)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),E(" ",$e(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function qt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Kt,8,5,null,null,P),a()()()()),t&2){let e=s();q(z(5,Wt)),p(),q(z(6,jt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.outletForm=I(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Ee)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,Ut,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),a()),n&2&&c("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,B,je,J,ae,Pe,V,ye,be,Ie,Oe,ze,j,W,$,Y,re,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,i){if(t&1){let e=v();r(0,"a",6),m(1,"Cancel"),a(),r(2,"p-button",7),y("onClick",function(){C(e);let o=s(3);return S(o.updatePOSOutletConfiguration())}),a()}}function on(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function an(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function rn(t,i){if(t&1){let e=v();r(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),a()(),Z(5,"div",13),r(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),x(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),_(e.outletName.slice(0,15)),p(3),q(z(7,tn)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,rn,12,8,"div",9,P),a()()()),t&2){let e=s(3);q(z(4,Zt)),p(),q(z(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,i){if(t&1&&(r(0,"app-main-panel",4),x(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,i){if(t&1&&x(0,ln,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var st=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.paymentForm=I(null),this.router=h(Ue)}ngOnInit(){this.route.paramMap.pipe(X(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Le("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=g(f({},this.paymentForm()),{form:g(f({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Le("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&x(0,mn,1,1,"app-main-panel",4),n&2&&Ce(o.paymentForm()?0:-1)},dependencies:[J,Ae,M,w,B,pe,re,j,W,H,V,te,A,D,G,N,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function sn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSTaxConfiguration())}),a()()}}function cn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",15)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function un(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function dn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),x(5,cn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),_(e.name),p(),c("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),b(4,dn,9,3,"div",11,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(k),this.taxForm=I(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=g(f({},this.taxForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,sn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,J,w,j,W,pe,H,V,te,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,i){t&1&&Z(0,"p-button",6)}function hn(t,i){if(t&1&&x(0,xn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function Cn(t,i){t&1&&(r(0,"tr")(1,"th",8),Z(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function Sn(t,i){if(t&1&&(r(0,"tr")(1,"td"),Z(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",oe(4,gn,e.id)),p(),_(e.name),p(2),_(e.description)}}function vn(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=s();return S(l.onSelectAll(o))}),x(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",z(2,_n))}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(k),this.writeoffList=I(null),this.hasCheckedItems=ee(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(X(e=>g(f({},e),{data:e.data.map(n=>g(f({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=g(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(g(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>g(f({},l),{checked:e.checked}));this.writeoffList.set(g(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,B,ne,le,Ke,qe,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Pn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){C(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function bn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function On(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function In(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),x(5,bn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),_(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,In,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),q(z(2,yn)),p(4),O(e.writeOffForm().form)}}function Fn(t,i){if(t&1&&(r(0,"app-main-panel",5),x(1,Pn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.route=h(ie),this.writeOffForm=I(null)}ngOnInit(){this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=g(f({},this.writeOffForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&x(0,Fn,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,B,J,Ae,pe,re,j,W,H,V,te,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=h(ve)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Ge=Fe(De(Tn),Ye("POSExpenseOptionStore"),Te(t=>({hasCheckedRows:ee(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ee(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),Me(t=>{let i=h(Re);return{onRowSelect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!0}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!1}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>g(f({},d),{checked:n}));return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:de(ue(U(()=>i.getExpenseOptions().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>g(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:de(ue(U(()=>i.getExpenseOptionsLoader().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),we({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function wn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSExpenseOptionConfiguration())}),a()()}}function Mn(t,i){if(t&1&&(r(0,"div",5)(1,"div",14)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function Dn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function An(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"label",12),m(3),a(),r(4,"p-select",13),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateData(o,l))}),x(5,Mn,4,1,"ng-template",null,2,u)(7,Dn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),_(n.name),p(),c("options",l.store.data().options.chartOfAccountOptions)("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")}}function kn(t,i){if(t&1&&b(0,An,9,3,"div",10,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function Rn(t,i){t&1&&(r(0,"div",9)(1,"p"),m(2,"No expense options available."),a()())}function Ln(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",8),x(4,kn,2,0)(5,Rn,3,0,"div",9),a()()()()),t&2){let e=s();p(4),Ce(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=h(Ge),this.expenseOptService=h(Re),this.expenseOptForm=I({ListData:[]}),this.originalData=I([]),We(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let ce=n[L];return ce&&d.AccountID!==ce.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=g(f({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[Se([Ge])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,wn,4,0,"ng-template",null,0,u)(3,Ln,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ne,$,Y,G,N,w,D,j,W,ae,V,H,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var za=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:lt},{path:"outlets/:id",component:mt},{path:"payments",component:pt},{path:"payments/:id",component:st},{path:"taxs",component:ct},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:ft}]}];export{za as POS_SETUP_ROUTES};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ie}from"./chunk-
|
|
1
|
+
import{a as Ie}from"./chunk-LABWETHZ.js";import{a as Te}from"./chunk-YZTBV6HG.js";import{a as xe}from"./chunk-ZUDQOT7C.js";import{a as S,f as j,h as N}from"./chunk-IMVMIXVJ.js";import{Da as I,Ha as ve,La as we,Ma as b,Ua as Q,ma as Ce,na as ye}from"./chunk-OIBDX2CA.js";import{h as U,j as ue,k as de,l as fe,m as he,s as M}from"./chunk-VZ5CMS5O.js";import{c as J,d as K,f as L,g as ge,h as P,j as be,l as _e}from"./chunk-F2X3VGZZ.js";import{$b as A,$c as O,Aa as H,Ba as ee,Bb as h,Cc as k,Db as g,Ec as X,Fc as pe,Hc as me,Kb as l,Lb as s,Nb as oe,Ob as ae,Pb as v,Qb as $,Vb as p,Wb as m,Xb as u,Yb as ie,Zb as ne,_b as q,_c as B,ca as D,da as E,ec as Z,fc as c,gc as se,hb as r,hc as re,ia as w,kc as z,lc as R,mc as T,nb as te,nc as x,qa as C,ra as y,rc as G,sa as F,sc as le,tc as ce,ua as d,xb as f,yb as V}from"./chunk-NMCKMUY4.js";var Se=["*"],De=({dt:e})=>`
|
|
2
2
|
.p-floatlabel {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Aa}from"./chunk-VGNJD35F.js";import{j as _p}from"./chunk-ARH3WEEF.js";import{a as jr,h as wp,p as xp,w as Cp}from"./chunk-H6HNANYB.js";import{B as Hn,Da as vp,La as Lr,Ma as Vi,Na as Wi,Ua as $r,z as bp}from"./chunk-OIBDX2CA.js";import{d as mp}from"./chunk-AOOG6YOT.js";import{a as yp}from"./chunk-2MKKFLNJ.js";import{A as Ba,D as Ea,H as fp,h as Ur,j as hp,k as ji,l as Da,m as Nr,s as Hi,t as Nn,y as gi}from"./chunk-VZ5CMS5O.js";import{c as gp,d as Ln,f as $n,h as jn}from"./chunk-F2X3VGZZ.js";import{$b as mi,$c as Rr,Aa as rt,Ba as ip,Bb as fi,Cc as zr,Db as se,Ea as Pa,Ec as or,Fa as rp,Fc as Ta,Ha as Or,I as Jl,Ic as dp,Kb as ze,Lb as N,Lc as cp,Mb as Mr,Nb as ap,Ob as np,Pb as ii,Qb as dt,Rc as ho,Sb as Mn,Tb as zn,Ub as Rn,Vb as ve,Wb as Ce,Xb as Ae,Yb as Si,Zb as Pi,_b as Kt,_c as Ut,ca as hi,cb as op,cd as Un,d as di,da as Ca,db as Fa,ec as Rt,fc as X,g as Ql,gc as sp,ha as Sa,hb as V,hc as lp,ia as Dt,kc as pt,lc as Ia,mc as Ke,n as Zl,nc as Qe,pa as ep,qa as Je,qc as pp,r as ci,ra as et,rc as Bt,sa as tp,sc as rr,tc as co,ua as ti,uc as up,xb as Yt,yb as ka}from"./chunk-NMCKMUY4.js";import{a as x,b as J,c as va,d as Ve,e as $e,f as j,g as Ar,h as wa,i as _a,j as xa}from"./chunk-YQFG5XE2.js";var Bp=Ve((Wn,qn)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qn=="object"&&typeof Wn<"u"?qn.exports=e():i.Papa=e()})(Wn,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,r=!e.document&&!!e.postMessage,o=e.IS_PAPA_WORKER||!1,a={},n=0,s={};function l(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(v){var P=oe(v);P.chunkSize=parseInt(P.chunkSize),v.step||v.chunk||(P.chunkSize=null),this._handle=new C(P),(this._handle.streamer=this)._config=P}.call(this,b),this.parseChunk=function(v,P){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let K=this._config.newline;K||(H=this._config.quoteChar||'"',K=this._handle.guessLineEndings(v,H)),v=[...v.split(K).slice(M)].join(K)}this.isFirstChunk&&le(this._config.beforeFirstChunk)&&(H=this._config.beforeFirstChunk(v))!==void 0&&(v=H),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+v,H=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(v=H.meta.cursor,M=(this._finished||(this._partialLine=M.substring(v-this._baseIndex),this._baseIndex=v),H&&H.data&&(this._rowCount+=H.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)e.postMessage({results:H,workerId:s.WORKER_ID,finished:M});else if(le(this._config.chunk)&&!P){if(this._config.chunk(H,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=H=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(H.data),this._completeResults.errors=this._completeResults.errors.concat(H.errors),this._completeResults.meta=H.meta),this._completed||!M||!le(this._config.complete)||H&&H.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||H&&H.meta.paused||this._nextChunk(),H}this._halted=!0},this._sendError=function(v){le(this._config.error)?this._config.error(v):o&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:v,finished:!1})}}function d(b){var v;(b=b||{}).chunkSize||(b.chunkSize=s.RemoteChunkSize),l.call(this,b),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(v=new XMLHttpRequest,this._config.withCredentials&&(v.withCredentials=this._config.withCredentials),r||(v.onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)),v.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var P,M=this._config.downloadRequestHeaders;for(P in M)v.setRequestHeader(P,M[P])}var H;this._config.chunkSize&&(H=this._start+this._config.chunkSize-1,v.setRequestHeader("Range","bytes="+this._start+"-"+H));try{v.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}r&&v.status===0&&this._chunkError()}},this._chunkLoaded=function(){v.readyState===4&&(v.status<200||400<=v.status?this._chunkError():(this._start+=this._config.chunkSize||v.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(v),this.parseChunk(v.responseText)))},this._chunkError=function(P){P=v.statusText||P,this._sendError(new Error(P))}}function m(b){(b=b||{}).chunkSize||(b.chunkSize=s.LocalChunkSize),l.call(this,b);var v,P,M=typeof FileReader<"u";this.stream=function(H){this._input=H,P=H.slice||H.webkitSlice||H.mozSlice,M?((v=new FileReader).onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)):v=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var H=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),H=P.call(H,this._start,K)),v.readAsText(H,this._config.encoding));M||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(H){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(H.target.result)},this._chunkError=function(){this._sendError(v.error)}}function f(b){var v;l.call(this,b=b||{}),this.stream=function(P){return v=P,this._nextChunk()},this._nextChunk=function(){var P,M;if(!this._finished)return P=this._config.chunkSize,v=P?(M=v.substring(0,P),v.substring(P)):(M=v,""),this._finished=!v,this.parseChunk(M)}}function S(b){l.call(this,b=b||{});var v=[],P=!0,M=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(H){this._input=H,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&v.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),v.length?this.parseChunk(v.shift()):P=!0},this._streamData=ue(function(H){try{v.push(typeof H=="string"?H:H.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(v.shift()))}catch(K){this._streamError(K)}},this),this._streamError=ue(function(H){this._streamCleanUp(),this._sendError(H)},this),this._streamEnd=ue(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=ue(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function C(b){var v,P,M,H,K=Math.pow(2,53),ge=-K,Oe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,je=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,me=this,Te=0,ae=0,ye=!1,fe=!1,be=[],ee={data:[],errors:[],meta:{}};function O(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function F(){if(ee&&M&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),M=!1),b.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!O(Q)})),D()){let Q=function(ie,ce){le(b.transformHeader)&&(ie=b.transformHeader(ie,ce)),be.push(ie)};var G=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;D()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function L(Q,ie){for(var ce=b.header?{}:[],pe=0;pe<Q.length;pe++){var ne=pe,Pe=Q[pe],Pe=((q,we)=>(xe=>(b.dynamicTypingFunction&&b.dynamicTyping[xe]===void 0&&(b.dynamicTyping[xe]=b.dynamicTypingFunction(xe)),(b.dynamicTyping[xe]||b.dynamicTyping)===!0))(q)?we==="true"||we==="TRUE"||we!=="false"&&we!=="FALSE"&&((xe=>{if(Oe.test(xe)&&(xe=parseFloat(xe),ge<xe&&xe<K))return 1})(we)?parseFloat(we):je.test(we)?new Date(we):we===""?null:we):we)(ne=b.header?pe>=be.length?"__parsed_extra":be[pe]:ne,Pe=b.transform?b.transform(Pe,ne):Pe);ne==="__parsed_extra"?(ce[ne]=ce[ne]||[],ce[ne].push(Pe)):ce[ne]=Pe}return b.header&&(pe>be.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+be.length+" fields but parsed "+pe,ae+ie):pe<be.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+be.length+" fields but parsed "+pe,ae+ie)),ce}var de;ee&&(b.header||b.dynamicTyping||b.transform)&&(de=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(L),de=ee.data.length):ee.data=L(ee.data,0),b.header&&ee.meta&&(ee.meta.fields=be),ae+=de)}function D(){return b.header&&be.length===0}function E(R,L,de,G){R={type:R,code:L,message:de},G!==void 0&&(R.row=G),ee.errors.push(R)}le(b.step)&&(H=b.step,b.step=function(R){ee=R,D()?F():(F(),ee.data.length!==0&&(Te+=R.data.length,b.preview&&Te>b.preview?P.abort():(ee.data=ee.data[0],H(ee,me))))}),this.parse=function(R,L,de){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),M=!1,b.delimiter?le(b.delimiter)&&(b.delimiter=b.delimiter(R),ee.meta.delimiter=b.delimiter):((G=((Q,ie,ce,pe,ne)=>{var Pe,q,we,xe;ne=ne||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var bt=0;bt<ne.length;bt++){for(var ht,It=ne[bt],Ne=0,nt=0,Le=0,We=(we=void 0,new Y({comments:pe,delimiter:It,newline:ie,preview:10}).parse(Q)),Me=0;Me<We.data.length;Me++)ce&&O(We.data[Me])?Le++:(ht=We.data[Me].length,nt+=ht,we===void 0?we=ht:0<ht&&(Ne+=Math.abs(ht-we),we=ht));0<We.data.length&&(nt/=We.data.length-Le),(q===void 0||Ne<=q)&&(xe===void 0||xe<nt)&&1.99<nt&&(q=Ne,Pe=It,xe=nt)}return{successful:!!(b.delimiter=Pe),bestDelimiter:Pe}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(M=!0,b.delimiter=s.DefaultDelimiter),ee.meta.delimiter=b.delimiter),oe(b));return b.preview&&b.header&&G.preview++,v=R,P=new Y(G),ee=P.parse(v,L,de),F(),ye?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return ye},this.pause=function(){ye=!0,P.abort(),v=le(b.chunk)?"":v.substring(P.getCharIndex())},this.resume=function(){me.streamer._halted?(ye=!1,me.streamer.parseChunk(v,!0)):setTimeout(me.resume,3)},this.aborted=function(){return fe},this.abort=function(){fe=!0,P.abort(),ee.meta.aborted=!0,le(b.complete)&&b.complete(ee),v=""},this.guessLineEndings=function(Q,G){Q=Q.substring(0,1048576);var G=new RegExp(B(G)+"([^]*?)"+B(G),"gm"),de=(Q=Q.replace(G,"")).split("\r"),G=Q.split(`
|
|
1
|
+
import{a as Aa}from"./chunk-ZUDQOT7C.js";import{j as _p}from"./chunk-V4SH72WU.js";import{a as jr,h as wp,p as xp,w as Cp}from"./chunk-IMVMIXVJ.js";import{B as Hn,Da as vp,La as Lr,Ma as Vi,Na as Wi,Ua as $r,z as bp}from"./chunk-OIBDX2CA.js";import{d as mp}from"./chunk-AOOG6YOT.js";import{a as yp}from"./chunk-2MKKFLNJ.js";import{A as Ba,D as Ea,H as fp,h as Ur,j as hp,k as ji,l as Da,m as Nr,s as Hi,t as Nn,y as gi}from"./chunk-VZ5CMS5O.js";import{c as gp,d as Ln,f as $n,h as jn}from"./chunk-F2X3VGZZ.js";import{$b as mi,$c as Rr,Aa as rt,Ba as ip,Bb as fi,Cc as zr,Db as se,Ea as Pa,Ec as or,Fa as rp,Fc as Ta,Ha as Or,I as Jl,Ic as dp,Kb as ze,Lb as N,Lc as cp,Mb as Mr,Nb as ap,Ob as np,Pb as ii,Qb as dt,Rc as ho,Sb as Mn,Tb as zn,Ub as Rn,Vb as ve,Wb as Ce,Xb as Ae,Yb as Si,Zb as Pi,_b as Kt,_c as Ut,ca as hi,cb as op,cd as Un,d as di,da as Ca,db as Fa,ec as Rt,fc as X,g as Ql,gc as sp,ha as Sa,hb as V,hc as lp,ia as Dt,kc as pt,lc as Ia,mc as Ke,n as Zl,nc as Qe,pa as ep,qa as Je,qc as pp,r as ci,ra as et,rc as Bt,sa as tp,sc as rr,tc as co,ua as ti,uc as up,xb as Yt,yb as ka}from"./chunk-NMCKMUY4.js";import{a as x,b as J,c as va,d as Ve,e as $e,f as j,g as Ar,h as wa,i as _a,j as xa}from"./chunk-YQFG5XE2.js";var Bp=Ve((Wn,qn)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qn=="object"&&typeof Wn<"u"?qn.exports=e():i.Papa=e()})(Wn,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,r=!e.document&&!!e.postMessage,o=e.IS_PAPA_WORKER||!1,a={},n=0,s={};function l(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(v){var P=oe(v);P.chunkSize=parseInt(P.chunkSize),v.step||v.chunk||(P.chunkSize=null),this._handle=new C(P),(this._handle.streamer=this)._config=P}.call(this,b),this.parseChunk=function(v,P){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let K=this._config.newline;K||(H=this._config.quoteChar||'"',K=this._handle.guessLineEndings(v,H)),v=[...v.split(K).slice(M)].join(K)}this.isFirstChunk&&le(this._config.beforeFirstChunk)&&(H=this._config.beforeFirstChunk(v))!==void 0&&(v=H),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+v,H=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(v=H.meta.cursor,M=(this._finished||(this._partialLine=M.substring(v-this._baseIndex),this._baseIndex=v),H&&H.data&&(this._rowCount+=H.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)e.postMessage({results:H,workerId:s.WORKER_ID,finished:M});else if(le(this._config.chunk)&&!P){if(this._config.chunk(H,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=H=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(H.data),this._completeResults.errors=this._completeResults.errors.concat(H.errors),this._completeResults.meta=H.meta),this._completed||!M||!le(this._config.complete)||H&&H.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||H&&H.meta.paused||this._nextChunk(),H}this._halted=!0},this._sendError=function(v){le(this._config.error)?this._config.error(v):o&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:v,finished:!1})}}function d(b){var v;(b=b||{}).chunkSize||(b.chunkSize=s.RemoteChunkSize),l.call(this,b),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(v=new XMLHttpRequest,this._config.withCredentials&&(v.withCredentials=this._config.withCredentials),r||(v.onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)),v.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var P,M=this._config.downloadRequestHeaders;for(P in M)v.setRequestHeader(P,M[P])}var H;this._config.chunkSize&&(H=this._start+this._config.chunkSize-1,v.setRequestHeader("Range","bytes="+this._start+"-"+H));try{v.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}r&&v.status===0&&this._chunkError()}},this._chunkLoaded=function(){v.readyState===4&&(v.status<200||400<=v.status?this._chunkError():(this._start+=this._config.chunkSize||v.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(v),this.parseChunk(v.responseText)))},this._chunkError=function(P){P=v.statusText||P,this._sendError(new Error(P))}}function m(b){(b=b||{}).chunkSize||(b.chunkSize=s.LocalChunkSize),l.call(this,b);var v,P,M=typeof FileReader<"u";this.stream=function(H){this._input=H,P=H.slice||H.webkitSlice||H.mozSlice,M?((v=new FileReader).onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)):v=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var H=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),H=P.call(H,this._start,K)),v.readAsText(H,this._config.encoding));M||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(H){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(H.target.result)},this._chunkError=function(){this._sendError(v.error)}}function f(b){var v;l.call(this,b=b||{}),this.stream=function(P){return v=P,this._nextChunk()},this._nextChunk=function(){var P,M;if(!this._finished)return P=this._config.chunkSize,v=P?(M=v.substring(0,P),v.substring(P)):(M=v,""),this._finished=!v,this.parseChunk(M)}}function S(b){l.call(this,b=b||{});var v=[],P=!0,M=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(H){this._input=H,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&v.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),v.length?this.parseChunk(v.shift()):P=!0},this._streamData=ue(function(H){try{v.push(typeof H=="string"?H:H.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(v.shift()))}catch(K){this._streamError(K)}},this),this._streamError=ue(function(H){this._streamCleanUp(),this._sendError(H)},this),this._streamEnd=ue(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=ue(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function C(b){var v,P,M,H,K=Math.pow(2,53),ge=-K,Oe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,je=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,me=this,Te=0,ae=0,ye=!1,fe=!1,be=[],ee={data:[],errors:[],meta:{}};function O(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function F(){if(ee&&M&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),M=!1),b.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!O(Q)})),D()){let Q=function(ie,ce){le(b.transformHeader)&&(ie=b.transformHeader(ie,ce)),be.push(ie)};var G=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;D()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function L(Q,ie){for(var ce=b.header?{}:[],pe=0;pe<Q.length;pe++){var ne=pe,Pe=Q[pe],Pe=((q,we)=>(xe=>(b.dynamicTypingFunction&&b.dynamicTyping[xe]===void 0&&(b.dynamicTyping[xe]=b.dynamicTypingFunction(xe)),(b.dynamicTyping[xe]||b.dynamicTyping)===!0))(q)?we==="true"||we==="TRUE"||we!=="false"&&we!=="FALSE"&&((xe=>{if(Oe.test(xe)&&(xe=parseFloat(xe),ge<xe&&xe<K))return 1})(we)?parseFloat(we):je.test(we)?new Date(we):we===""?null:we):we)(ne=b.header?pe>=be.length?"__parsed_extra":be[pe]:ne,Pe=b.transform?b.transform(Pe,ne):Pe);ne==="__parsed_extra"?(ce[ne]=ce[ne]||[],ce[ne].push(Pe)):ce[ne]=Pe}return b.header&&(pe>be.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+be.length+" fields but parsed "+pe,ae+ie):pe<be.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+be.length+" fields but parsed "+pe,ae+ie)),ce}var de;ee&&(b.header||b.dynamicTyping||b.transform)&&(de=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(L),de=ee.data.length):ee.data=L(ee.data,0),b.header&&ee.meta&&(ee.meta.fields=be),ae+=de)}function D(){return b.header&&be.length===0}function E(R,L,de,G){R={type:R,code:L,message:de},G!==void 0&&(R.row=G),ee.errors.push(R)}le(b.step)&&(H=b.step,b.step=function(R){ee=R,D()?F():(F(),ee.data.length!==0&&(Te+=R.data.length,b.preview&&Te>b.preview?P.abort():(ee.data=ee.data[0],H(ee,me))))}),this.parse=function(R,L,de){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),M=!1,b.delimiter?le(b.delimiter)&&(b.delimiter=b.delimiter(R),ee.meta.delimiter=b.delimiter):((G=((Q,ie,ce,pe,ne)=>{var Pe,q,we,xe;ne=ne||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var bt=0;bt<ne.length;bt++){for(var ht,It=ne[bt],Ne=0,nt=0,Le=0,We=(we=void 0,new Y({comments:pe,delimiter:It,newline:ie,preview:10}).parse(Q)),Me=0;Me<We.data.length;Me++)ce&&O(We.data[Me])?Le++:(ht=We.data[Me].length,nt+=ht,we===void 0?we=ht:0<ht&&(Ne+=Math.abs(ht-we),we=ht));0<We.data.length&&(nt/=We.data.length-Le),(q===void 0||Ne<=q)&&(xe===void 0||xe<nt)&&1.99<nt&&(q=Ne,Pe=It,xe=nt)}return{successful:!!(b.delimiter=Pe),bestDelimiter:Pe}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(M=!0,b.delimiter=s.DefaultDelimiter),ee.meta.delimiter=b.delimiter),oe(b));return b.preview&&b.header&&G.preview++,v=R,P=new Y(G),ee=P.parse(v,L,de),F(),ye?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return ye},this.pause=function(){ye=!0,P.abort(),v=le(b.chunk)?"":v.substring(P.getCharIndex())},this.resume=function(){me.streamer._halted?(ye=!1,me.streamer.parseChunk(v,!0)):setTimeout(me.resume,3)},this.aborted=function(){return fe},this.abort=function(){fe=!0,P.abort(),ee.meta.aborted=!0,le(b.complete)&&b.complete(ee),v=""},this.guessLineEndings=function(Q,G){Q=Q.substring(0,1048576);var G=new RegExp(B(G)+"([^]*?)"+B(G),"gm"),de=(Q=Q.replace(G,"")).split("\r"),G=Q.split(`
|
|
2
2
|
`),Q=1<G.length&&G[0].length<de[0].length;if(de.length===1||Q)return`
|
|
3
3
|
`;for(var ie=0,ce=0;ce<de.length;ce++)de[ce][0]===`
|
|
4
4
|
`&&ie++;return ie>=de.length/2?`\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as oe}from"./chunk-
|
|
1
|
+
import{a as V,b as oe}from"./chunk-5JZTWUDG.js";import"./chunk-DU72RNAU.js";import{a as te,b as ie}from"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import{a as K,b as Q}from"./chunk-Q7SK53ST.js";import{a as ne,b as re}from"./chunk-NDLX3ORI.js";import{b as ee}from"./chunk-ZMIVD3SF.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{g as $}from"./chunk-TUFQ5JVG.js";import"./chunk-ZUDQOT7C.js";import{a as Y,b as Z}from"./chunk-BUDZ3ONE.js";import"./chunk-SN7DLFX2.js";import"./chunk-V4SH72WU.js";import{w as U,x as X}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import{e as G,j as H,w as q}from"./chunk-OIBDX2CA.js";import"./chunk-M3TKVRYP.js";import{a as A}from"./chunk-2MKKFLNJ.js";import{n as z,s as R}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as h,Cc as j,Db as L,Dc as F,Ha as b,Lb as u,Nc as T,Ob as S,Oc as P,Rc as M,Vb as r,W as E,Wb as o,Xb as C,Y as B,_ as W,ec as f,fc as m,h as J,hb as s,ia as x,qa as l,ra as p,rc as _,s as y,sa as I,ta as N,wc as c,xb as O,xc as g,yc as d}from"./chunk-NMCKMUY4.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as u}from"./chunk-
|
|
1
|
+
import{h as u}from"./chunk-IMVMIXVJ.js";import{Da as f}from"./chunk-OIBDX2CA.js";import{Bb as c,Kb as C,Lb as m,Pb as h,Vb as r,Wb as l,Xb as o,hb as a,sa as d,ua as s,xb as p}from"./chunk-NMCKMUY4.js";var L=(()=>{class i extends u{pathId;ngOnInit(){this.pathId="url(#"+f()+")"}static \u0275fac=(()=>{let t;return function(e){return(t||(t=s(i)))(e||i)}})();static \u0275cmp=p({type:i,selectors:[["TimesCircleIcon"]],features:[c],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,e){n&1&&(d(),r(0,"svg",0)(1,"g"),o(2,"path",1),l(),r(3,"defs")(4,"clipPath",2),o(5,"rect",3),l()()()),n&2&&(h(e.getClassNames()),C("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role),a(),C("clip-path",e.pathId),a(3),m("id",e.pathId))},encapsulation:2})}return i})();export{L as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ce,b as u,c as he,d as f,f as b}from"./chunk-
|
|
1
|
+
import{a as ce,b as u,c as he,d as f,f as b}from"./chunk-IMVMIXVJ.js";import{B as se,Ia as le,La as ae,Ma as C,R as Z,Ua as de,ba as re,ia as m,z as j}from"./chunk-OIBDX2CA.js";import{h as W,k as X,l as ee,m as te,s as ie,t as ne}from"./chunk-VZ5CMS5O.js";import{c as oe,d as R,f as I,h as V,i as M,k as A}from"./chunk-F2X3VGZZ.js";import{$b as E,Aa as s,Ba as Q,Bb as P,Cc as Y,Db as g,Ec as _,Gc as G,Lb as d,Mc as J,Pb as w,Vb as T,Wb as S,_b as q,ca as z,da as H,ec as k,fc as r,gc as U,hb as O,hc as $,ia as F,kc as D,lc as L,mc as v,nb as x,nc as y,qa as h,ra as p,ua as B,xb as K,yb as N}from"./chunk-NMCKMUY4.js";import{a as c}from"./chunk-YQFG5XE2.js";var pe=["content"],be=["overlay"],Oe=["*"],xe=(i,l,e,t,n,o,a,ye,me,ue,fe,ge,_e,Ce)=>({"p-overlay p-component":!0,"p-overlay-modal p-overlay-mask p-overlay-mask-enter":i,"p-overlay-center":l,"p-overlay-top":e,"p-overlay-top-start":t,"p-overlay-top-end":n,"p-overlay-bottom":o,"p-overlay-bottom-start":a,"p-overlay-bottom-end":ye,"p-overlay-left":me,"p-overlay-left-start":ue,"p-overlay-left-end":fe,"p-overlay-right":ge,"p-overlay-right-start":_e,"p-overlay-right-end":Ce}),we=(i,l,e)=>({showTransitionParams:i,hideTransitionParams:l,transform:e}),Te=i=>({value:"visible",params:i}),Se=i=>({mode:i}),Ee=i=>({$implicit:i});function ke(i,l){i&1&&q(0)}function De(i,l){if(i&1){let e=E();T(0,"div",3,1),k("click",function(n){h(e);let o=r(2);return p(o.onOverlayContentClick(n))})("@overlayContentAnimation.start",function(n){h(e);let o=r(2);return p(o.onOverlayContentAnimationStart(n))})("@overlayContentAnimation.done",function(n){h(e);let o=r(2);return p(o.onOverlayContentAnimationDone(n))}),$(2),g(3,ke,1,0,"ng-container",4),S()}if(i&2){let e=r(2);w(e.contentStyleClass),d("ngStyle",e.contentStyle)("ngClass","p-overlay-content")("@overlayContentAnimation",_(11,Te,G(7,we,e.showTransitionOptions,e.hideTransitionOptions,e.transformOptions[e.modal?e.overlayResponsiveDirection:"default"]))),O(3),d("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",_(15,Ee,_(13,Se,e.overlayMode)))}}function Le(i,l){if(i&1){let e=E();T(0,"div",3,0),k("click",function(){h(e);let n=r();return p(n.onOverlayClick())}),g(2,De,4,17,"div",2),S()}if(i&2){let e=r();w(e.styleClass),d("ngStyle",e.style)("ngClass",J(5,xe,[e.modal,e.modal&&e.overlayResponsiveDirection==="center",e.modal&&e.overlayResponsiveDirection==="top",e.modal&&e.overlayResponsiveDirection==="top-start",e.modal&&e.overlayResponsiveDirection==="top-end",e.modal&&e.overlayResponsiveDirection==="bottom",e.modal&&e.overlayResponsiveDirection==="bottom-start",e.modal&&e.overlayResponsiveDirection==="bottom-end",e.modal&&e.overlayResponsiveDirection==="left",e.modal&&e.overlayResponsiveDirection==="left-start",e.modal&&e.overlayResponsiveDirection==="left-end",e.modal&&e.overlayResponsiveDirection==="right",e.modal&&e.overlayResponsiveDirection==="right-start",e.modal&&e.overlayResponsiveDirection==="right-end"])),O(2),d("ngIf",e.visible)}}var Re=({dt:i})=>`
|
|
2
2
|
.p-overlay {
|
|
3
3
|
position: absolute;
|
|
4
4
|
top: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-2MKKFLNJ.js";import{B as I,C as g,D}from"./chunk-VZ5CMS5O.js";import{I as u,_ as d,ca as m,ia as f,n as y,s as h}from"./chunk-NMCKMUY4.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(d(this.handleResponse.bind(this)),h(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var p={production:!0,version:"5.
|
|
1
|
+
import{a as b}from"./chunk-2MKKFLNJ.js";import{B as I,C as g,D}from"./chunk-VZ5CMS5O.js";import{I as u,_ as d,ca as m,ia as f,n as y,s as h}from"./chunk-NMCKMUY4.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(d(this.handleResponse.bind(this)),h(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var p={production:!0,version:"5.47.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var l=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();l.IsNotEmpty(t)&&window.Intercom("boot",{app_id:p.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return l.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,l as b,p as c,N as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-OW25MQS7.js";import{a as q}from"./chunk-53HJBLFX.js";import{a as R}from"./chunk-QF4D5YPK.js";import{g as w}from"./chunk-TUFQ5JVG.js";import"./chunk-ZUDQOT7C.js";import{a as k}from"./chunk-BUDZ3ONE.js";import"./chunk-SN7DLFX2.js";import"./chunk-V4SH72WU.js";import{w as P}from"./chunk-IMVMIXVJ.js";import{b as M}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{b as I,d as E,e as D}from"./chunk-AOOG6YOT.js";import"./chunk-M3TKVRYP.js";import"./chunk-2MKKFLNJ.js";import"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as y,D as f,Db as u,Dc as J,Ec as b,Lb as m,Qb as h,Rc as s,Vb as n,Wb as o,Xb as j,Y as _,_ as x,ec as S,fc as a,hb as p,ia as l,qa as T,ra as v,rc as r,sc as c,xb as C}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var V=()=>["/pages/accounting-setup/journal-tag/form"],B=t=>({id:t});function L(t,d){if(t&1){let e=y();n(0,"div",3)(1,"p-button-group"),j(2,"p-button",4),n(3,"p-button",5),S("onClick",function(){T(e);let g=a();return v(g.onJournalTagDelete())}),o()()()}if(t&2){let e=a();p(2),m("routerLink",J(2,V))("queryParams",b(3,B,e.journalTag().id))}}function W(t,d){if(t&1&&(n(0,"div",6)(1,"div",7)(2,"p-panel",8)(3,"div",9)(4,"div",6)(5,"div",10),r(6,"Name"),o(),n(7,"div",10),r(8),o()(),n(9,"div",6)(10,"div",10),r(11,"Description"),o(),n(12,"div",10),r(13),o()()()()()()),t&2){let e=a(2);p(8),c(e.journalTag().name),p(5),c(e.journalTag().description)}}function A(t,d){if(t&1&&u(0,W,14,2,"div",6),t&2){let e=a();h(e.journalTag()?0:-1)}}var tt=(()=>{class t{constructor(){this.journalTagService=l(F),this.route=l(I),this.router=l(E),this.journalTag=M(this.route.queryParamMap.pipe(f(e=>e.has("id")),_(e=>this.journalTagService.journalTagInfo(e.get("id"))),R("Journal Tag Info ")),{initialValue:null})}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTag().id).pipe(x(()=>this.router.navigate(["/pages/accounting-setup/journal-tag"]))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-journal-tag-info"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",3,"routerLink","queryParams"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"row"],[1,"col-6"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2"],[1,"col"]],template:function(i,g){i&1&&(n(0,"app-main-panel",2),u(1,L,4,5,"ng-template",null,0,s)(3,A,1,1,"ng-template",null,1,s),o()),i&2&&m("hasMainWrapperPadding",!0)},dependencies:[w,k,q,P,D],encapsulation:2})}}return t})();export{tt as JournalTagInfoComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,b as L}from"./chunk-5JZTWUDG.js";import"./chunk-DU72RNAU.js";import{a as I,b as E}from"./chunk-Q7SK53ST.js";import"./chunk-ZMIVD3SF.js";import{g as H}from"./chunk-TUFQ5JVG.js";import"./chunk-ZUDQOT7C.js";import{a as R,b as D}from"./chunk-BUDZ3ONE.js";import"./chunk-SN7DLFX2.js";import"./chunk-V4SH72WU.js";import{w as V,x as j,y as N,z as G}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-M3TKVRYP.js";import{a as F}from"./chunk-2MKKFLNJ.js";import{n as O,s as $}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as B,Cc as P,Db as w,Dc as _,Lb as p,Nc as s,Ob as h,Oc as m,Rc as x,Vb as o,W as y,Wb as n,Xb as l,Y as M,_ as b,ec as C,fc as c,h as T,hb as a,ia as f,qa as g,ra as d,s as u,sa as S,ta as A,xb as k}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
|