dealposbooks 5.32.2 → 5.32.3

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.
Files changed (47) hide show
  1. package/assets/scss/style.scss +13 -0
  2. package/{chunk-ZM5TVQUU.js → chunk-6ATDYFCA.js} +1 -1
  3. package/{chunk-W4GXLPRM.js → chunk-6DDOOKHU.js} +1 -1
  4. package/{chunk-NCY25JG4.js → chunk-6XPH2B7A.js} +4 -4
  5. package/{chunk-CR2R5F5T.js → chunk-76K2CYGK.js} +1 -1
  6. package/{chunk-SZ3LQIKH.js → chunk-7SH5XZDT.js} +1 -1
  7. package/{chunk-ICOTZOJJ.js → chunk-B753J6ZB.js} +5 -5
  8. package/{chunk-VVGZUJP6.js → chunk-BU5IXVPY.js} +1 -1
  9. package/{chunk-ZA5U4RYI.js → chunk-CAXE6CPZ.js} +1 -1
  10. package/{chunk-QTALSVSB.js → chunk-DLZ2BFC3.js} +1 -1
  11. package/{chunk-Y5FQDBGQ.js → chunk-DV5W2JUL.js} +1 -1
  12. package/{chunk-2QWFLAG5.js → chunk-ECHLZ4UT.js} +1 -1
  13. package/chunk-EZOJ4EV5.js +1 -0
  14. package/{chunk-V5OZ47U6.js → chunk-F46KQWAO.js} +1 -1
  15. package/{chunk-5OYK64TO.js → chunk-GGBBHB6Z.js} +1 -1
  16. package/chunk-H74NQYSU.js +1 -0
  17. package/{chunk-ALYAGR32.js → chunk-HPURXOG3.js} +1 -1
  18. package/{chunk-GK2S4TYF.js → chunk-IQVB5TK3.js} +1 -1
  19. package/{chunk-MEXKKLEE.js → chunk-IWCBGXO2.js} +1 -1
  20. package/{chunk-FP5LIX5S.js → chunk-J2F5XODV.js} +1 -1
  21. package/{chunk-HKQCPLSX.js → chunk-LTU2XN7O.js} +1 -1
  22. package/{chunk-ERFXO32T.js → chunk-MPFBVM6S.js} +1 -1
  23. package/{chunk-BJ7FEOET.js → chunk-NJZZBILL.js} +1 -1
  24. package/{chunk-OQ52MPGS.js → chunk-NOQ3MCWQ.js} +1 -1
  25. package/{chunk-FSEW3LUP.js → chunk-OFLZMVEN.js} +1 -1
  26. package/{chunk-JZU6YAPX.js → chunk-QYJLXUNX.js} +1 -1
  27. package/{chunk-YBZSBC7H.js → chunk-QZSD3P6F.js} +1 -1
  28. package/{chunk-7I5R2CUM.js → chunk-RE3DECQB.js} +1 -1
  29. package/{chunk-VJBDOS6M.js → chunk-RK722ALH.js} +1 -1
  30. package/{chunk-RQ4G322O.js → chunk-RUI3DTOX.js} +1 -1
  31. package/{chunk-4EUKDALJ.js → chunk-RZ5RLIRX.js} +1 -1
  32. package/{chunk-B4HCPA6E.js → chunk-TFIGD3CO.js} +1 -1
  33. package/{chunk-ZSVULSVG.js → chunk-UQS5OJFU.js} +1 -1
  34. package/{chunk-6UIJBWT6.js → chunk-UXABR4FY.js} +1 -1
  35. package/{chunk-CACGTOSZ.js → chunk-V35EUCGI.js} +1 -1
  36. package/{chunk-CMRVHYI7.js → chunk-X6CER3EN.js} +1 -1
  37. package/{chunk-UVXRATHG.js → chunk-XVE6KMPV.js} +1 -1
  38. package/{chunk-SASCD5HU.js → chunk-YLWKQB7B.js} +1 -1
  39. package/{chunk-CJ6UGNBN.js → chunk-ZCUVD7AW.js} +1 -1
  40. package/chunk-ZI23MZE6.js +180 -0
  41. package/index.html +2 -2
  42. package/{main-RAHFUIZB.js → main-OSZVX4SI.js} +1 -1
  43. package/package.json +1 -1
  44. package/{styles-TTHIY3OR.css → styles-TR7DEZTJ.css} +1 -1
  45. package/chunk-B7A5CWPE.js +0 -1
  46. package/chunk-UYC454VQ.js +0 -180
  47. package/chunk-YGEMHXDD.js +0 -1
@@ -1 +1 @@
1
- import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-EDCDR4RJ.js";import{a as Te,b as Fe}from"./chunk-O4QM64EH.js";import{d as ne,e as qe,i as we,j as Me,k as oe}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Ae}from"./chunk-XKCLERWG.js";import{a as ee,b as pe}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{a as K,b as J}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{a as Ee,b as Y}from"./chunk-5R3XKSDM.js";import{h as M}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as z,b as U}from"./chunk-J4XRJAME.js";import{a as te,b as ye,c as Pe,d as be,e as Oe,f as Ie,g as Je}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{o as Ke,w as B,x as V}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as H,f as _e,j as re,k as ge,l as xe,m as he,n as Ye,o as Ce,v as Se,x as Z,y as ve}from"./chunk-FMVCTBCQ.js";import{a as fe}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as ae,F as ze,G,N as k,f as L,j as He,m as w}from"./chunk-B63BKC6F.js";import{Ac as ie,Cb as _,Ga as R,Jc as Ue,Kb as s,Kc as je,Mc as u,Nb as F,Pb as $e,Qb as P,Sb as b,Tb as O,Ub as a,Vb as i,Wb as $,X as j,Yc as X,Z as D,_b as v,ba as ue,bb as Ve,c as se,dc as y,ec as c,gb as p,ha as h,pa as C,qa as S,qc as m,rc as d,s as Q,sc as I,uc as We,wb as T,yc as de,zc as E}from"./chunk-JP6RBSB3.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var A=(()=>{class t{constructor(){this.httpService=h(fe)}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=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N=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}(N||{});var it={[N.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"}],[N.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"}],[N.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[N.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[N.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"}],[N.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[N.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[N.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[N.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function xt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function St(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,ht,7,2,"ng-template",null,2,u)(10,Ct,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Pt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,vt,7,2,"ng-template",null,2,u)(10,yt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,St,12,4,"div",14,P),i()(),a(6,"div",12)(7,"div",13),b(8,Pt,12,4,"div",14,P),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Ot(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),b(3,xt,2,2,"p-tab",10,P),i(),a(5,"p-tabpanels"),b(6,bt,10,2,"p-tabpanel",10,P),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,r){if(t&1&&_(0,Ot,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(A),this.fb=h(Se),this.tab=R(N.POSGLOBAL_SELL),this.tabs=R(Object.values(N).map(e=>({label:e,value:e}))),this.posIntegration=R(null),this.form=R([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=N}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(D(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:g,accountID:W}of l){let Be=`${g}_${W}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:W||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(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.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&&(a(0,"app-main-panel",4),_(1,gt,2,0,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),i())},dependencies:[M,ot,nt,tt,et,Xe,Ze,Ke,J,K,Z,ge,H,_e,w,L,k,V,B,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Et=t=>[t];function Tt(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Ft(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),b(4,Tt,2,1,"th",7,P),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function wt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function Mt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),b(4,wt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Et,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Dt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Ft,6,0,"ng-template",null,1,u)(3,Mt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("scrollable",!0)("scrollHeight","calc(100vh - 70px)")("value",e.paymentConfiguration().payment)}}function Rt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Dt,5,3,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.paymentConfiguration=R(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(D(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(D(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","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput"],[3,"scrollable","scrollHeight","value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&_(0,Rt,3,1,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[M,oe,ne,qe,w,L,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Le=ye(Ie(kt),Pe(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(A);return{updateFilter:n=>{te(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(j(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{te(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),be(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var At=()=>({height:"calc(100vh - 70px)"}),Nt=t=>[t];function Lt(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Gt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),b(3,Lt,2,1,"th",null,P),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Vt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),b(4,Bt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Nt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function Ut(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();F(E(11,At)),p(),s("scrollable",!0)("scrollHeight","calc(100vh - 100px)")("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(Le)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(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:[de([Le])],decls:3,vars:1,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","scrollable","scrollHeight","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();a(0,"app-main-panel",5),y("search",function(W){return C(l),S(o.onSearch(W))}),_(1,Ut,10,12,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)},dependencies:[M,w,Y,oe,ne,k,G,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var jt=()=>({height:"calc(100vh - 100px)"}),Ht=()=>({height:"calc(100vh - 150px)"});function zt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Yt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Kt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Jt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Yt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function qt(t,r){t&1&&$(0,"hr")}function Qt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),b(5,Jt,8,3,"div",12,P),i()(),_(7,qt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,W=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(W.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function Xt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Qt,8,5,null,null,P),i()()()()),t&2){let e=c();F(E(5,jt)),p(),F(E(6,Ht)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.outletForm=R(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2],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(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),D(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&&(a(0,"app-main-panel",4),_(1,zt,3,0,"ng-template",null,0,u)(3,Xt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,L,He,Y,ve,ge,H,_e,xe,Ce,he,Ye,J,K,U,z,ee,V,B,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var en=()=>({height:"calc(100vh - 100px)"}),tn=()=>({width:"100%",height:"calc(100vh - 150px)"}),nn=()=>({width:"100%"});function on(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function pn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),$(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,an,7,2,"ng-template",null,2,u)(10,rn,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),F(E(7,nn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function ln(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,pn,12,8,"div",9,P),i()()()),t&2){let e=c(3);F(E(4,en)),p(),F(E(5,tn)),p(2),O(e.paymentForm().form.accounts)}}function mn(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,on,3,0,"ng-template",null,0,u)(3,ln,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function cn(t,r){if(t&1&&_(0,mn,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.paymentForm=R(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),j(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),D(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),D(()=>{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&&_(0,cn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[Y,Ee,M,w,L,pe,ee,J,K,Z,H,re,k,G,V,B,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var sn=()=>({height:"calc(100vh - 70px)"}),un=()=>({width:"100%",height:"calc(100vh - 100px)"});function dn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function fn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function _n(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function gn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,fn,7,2,"ng-template",null,2,u)(7,_n,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function xn(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"div",8)(3,"div",9)(4,"div",10),b(5,gn,9,3,"div",11,P),i()()()()()),t&2){let e=c();F(E(4,sn)),p(),F(E(5,un)),p(4),O(e.taxForm().form)}}var st=(()=>{class t{constructor(){this.POSSetupService=h(A),this.taxForm=R(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(D(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(D(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:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup"],[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&&(a(0,"app-main-panel",4),_(1,dn,4,0,"ng-template",null,0,u)(3,xn,7,6,"ng-template",null,1,u),i())},dependencies:[M,Y,w,J,K,pe,ee,Z,H,re,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var hn=()=>({height:"calc(100vh - 70px)"}),Cn=()=>({"min-width":"50rem"}),Sn=t=>[t];function vn(t,r){t&1&&$(0,"p-button",6)}function yn(t,r){if(t&1&&_(0,vn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Pn(t,r){t&1&&(a(0,"tr")(1,"th",9),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",10),i(),a(3,"td")(4,"a",11),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",ie(4,Sn,e.id)),p(),d(e.name),p(2),d(e.description)}}function On(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",8),y("onRowSelect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c(2);return S(l.onSelectAll(o))}),_(2,Pn,7,0,"ng-template",null,2,u)(4,bn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c(2);F(E(4,hn)),p(),s("value",e.writeoffList().data)("tableStyle",E(5,Cn))}}function In(t,r){if(t&1&&_(0,On,6,6,"p-panel",7),t&2){let e=c();s("ngIf",e.writeoffList())}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(A),this.writeoffList=R(null),this.hasCheckedItems=X(()=>{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(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),D(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]=x(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(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:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],[3,"style",4,"ngIf"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","4rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,yn,1,1,"ng-template",null,0,u)(3,In,1,1,"ng-template",null,1,u),i())},dependencies:[M,w,L,oe,ne,we,Me,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var En=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Tn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Fn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function wn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function Mn(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Fn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),i()()()()()),t&2){let e=c(2);p(),F(E(2,En)),p(4),O(e.writeOffForm().form)}}function Rn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,Tn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.route=h(ae),this.writeOffForm=R(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),D(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});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&&_(0,Rn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[M,w,L,Y,Ee,pe,ee,J,K,Z,H,re,k,G,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ft=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var kn={data:{expenseOptions:[]}},Ge=ye(Ie(kn),Je("POSExpenseOptionStore"),Pe(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(ft);return{onRowSelect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(j(()=>r.getExpenseOptions().pipe(Fe({next:n=>{te(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),be({onInit:t=>{t.getExpenseOptions()}}));var An=()=>({height:"calc(100vh - 70px)"});function Nn(t,r){t&1&&$(0,"p-button",6)}function Ln(t,r){if(t&1&&_(0,Nn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Gn(t,r){t&1&&(a(0,"tr")(1,"th",8),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),$(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function Vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Gn,9,0,"ng-template",null,2,u)(4,Bn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();F(E(3,An)),p(),s("value",e.store.data().expenseOptions)}}var _t=(()=>{class t{constructor(){this.store=h(Ge)}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)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[de([Ge])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","4rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Ln,1,1,"ng-template",null,0,u)(3,Vn,6,4,"ng-template",null,1,u),i())},dependencies:[M,oe,ne,we,Me,U,z,V,B,w,L],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ua=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:ct},{path:"taxs",component:st},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:_t}]}];export{Ua as POS_SETUP_ROUTES};
1
+ import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-EDCDR4RJ.js";import{a as Te,b as Fe}from"./chunk-O4QM64EH.js";import{d as ne,e as qe,i as we,j as Me,k as oe}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Ae}from"./chunk-XKCLERWG.js";import{a as ee,b as pe}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{a as K,b as J}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{a as Ee,b as Y}from"./chunk-5R3XKSDM.js";import{h as M}from"./chunk-ZI23MZE6.js";import"./chunk-C7LM5UCK.js";import{a as z,b as U}from"./chunk-J4XRJAME.js";import{a as te,b as ye,c as Pe,d as be,e as Oe,f as Ie,g as Je}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{o as Ke,w as B,x as V}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as H,f as _e,j as re,k as ge,l as xe,m as he,n as Ye,o as Ce,v as Se,x as Z,y as ve}from"./chunk-FMVCTBCQ.js";import{a as fe}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as ae,F as ze,G,N as k,f as L,j as He,m as w}from"./chunk-B63BKC6F.js";import{Ac as ie,Cb as _,Ga as R,Jc as Ue,Kb as s,Kc as je,Mc as u,Nb as F,Pb as $e,Qb as P,Sb as b,Tb as O,Ub as a,Vb as i,Wb as $,X as j,Yc as X,Z as D,_b as v,ba as ue,bb as Ve,c as se,dc as y,ec as c,gb as p,ha as h,pa as C,qa as S,qc as m,rc as d,s as Q,sc as I,uc as We,wb as T,yc as de,zc as E}from"./chunk-JP6RBSB3.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var A=(()=>{class t{constructor(){this.httpService=h(fe)}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=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N=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}(N||{});var it={[N.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"}],[N.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"}],[N.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[N.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[N.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"}],[N.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[N.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[N.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[N.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function xt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function St(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,ht,7,2,"ng-template",null,2,u)(10,Ct,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Pt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,vt,7,2,"ng-template",null,2,u)(10,yt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,St,12,4,"div",14,P),i()(),a(6,"div",12)(7,"div",13),b(8,Pt,12,4,"div",14,P),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Ot(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),b(3,xt,2,2,"p-tab",10,P),i(),a(5,"p-tabpanels"),b(6,bt,10,2,"p-tabpanel",10,P),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,r){if(t&1&&_(0,Ot,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(A),this.fb=h(Se),this.tab=R(N.POSGLOBAL_SELL),this.tabs=R(Object.values(N).map(e=>({label:e,value:e}))),this.posIntegration=R(null),this.form=R([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=N}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(D(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:g,accountID:W}of l){let Be=`${g}_${W}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:W||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(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.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&&(a(0,"app-main-panel",4),_(1,gt,2,0,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),i())},dependencies:[M,ot,nt,tt,et,Xe,Ze,Ke,J,K,Z,ge,H,_e,w,L,k,V,B,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Et=t=>[t];function Tt(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Ft(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),b(4,Tt,2,1,"th",7,P),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function wt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function Mt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),b(4,wt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Et,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Dt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Ft,6,0,"ng-template",null,1,u)(3,Mt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("scrollable",!0)("scrollHeight","calc(100vh - 70px)")("value",e.paymentConfiguration().payment)}}function Rt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Dt,5,3,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.paymentConfiguration=R(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(D(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(D(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","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput"],[3,"scrollable","scrollHeight","value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&_(0,Rt,3,1,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[M,oe,ne,qe,w,L,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Le=ye(Ie(kt),Pe(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(A);return{updateFilter:n=>{te(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(j(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{te(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),be(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var At=()=>({height:"calc(100vh - 70px)"}),Nt=t=>[t];function Lt(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Gt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),b(3,Lt,2,1,"th",null,P),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Vt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),b(4,Bt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Nt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function Ut(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();F(E(11,At)),p(),s("scrollable",!0)("scrollHeight","calc(100vh - 100px)")("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(Le)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(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:[de([Le])],decls:3,vars:1,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","scrollable","scrollHeight","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();a(0,"app-main-panel",5),y("search",function(W){return C(l),S(o.onSearch(W))}),_(1,Ut,10,12,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)},dependencies:[M,w,Y,oe,ne,k,G,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var jt=()=>({height:"calc(100vh - 100px)"}),Ht=()=>({height:"calc(100vh - 150px)"});function zt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Yt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Kt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Jt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Yt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function qt(t,r){t&1&&$(0,"hr")}function Qt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),b(5,Jt,8,3,"div",12,P),i()(),_(7,qt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,W=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(W.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function Xt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Qt,8,5,null,null,P),i()()()()),t&2){let e=c();F(E(5,jt)),p(),F(E(6,Ht)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.outletForm=R(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2],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(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),D(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&&(a(0,"app-main-panel",4),_(1,zt,3,0,"ng-template",null,0,u)(3,Xt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,L,He,Y,ve,ge,H,_e,xe,Ce,he,Ye,J,K,U,z,ee,V,B,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var en=()=>({height:"calc(100vh - 100px)"}),tn=()=>({width:"100%",height:"calc(100vh - 150px)"}),nn=()=>({width:"100%"});function on(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function pn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),$(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,an,7,2,"ng-template",null,2,u)(10,rn,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),F(E(7,nn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function ln(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,pn,12,8,"div",9,P),i()()()),t&2){let e=c(3);F(E(4,en)),p(),F(E(5,tn)),p(2),O(e.paymentForm().form.accounts)}}function mn(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,on,3,0,"ng-template",null,0,u)(3,ln,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function cn(t,r){if(t&1&&_(0,mn,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.paymentForm=R(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),j(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),D(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),D(()=>{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&&_(0,cn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[Y,Ee,M,w,L,pe,ee,J,K,Z,H,re,k,G,V,B,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var sn=()=>({height:"calc(100vh - 70px)"}),un=()=>({width:"100%",height:"calc(100vh - 100px)"});function dn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function fn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function _n(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function gn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,fn,7,2,"ng-template",null,2,u)(7,_n,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function xn(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"div",8)(3,"div",9)(4,"div",10),b(5,gn,9,3,"div",11,P),i()()()()()),t&2){let e=c();F(E(4,sn)),p(),F(E(5,un)),p(4),O(e.taxForm().form)}}var st=(()=>{class t{constructor(){this.POSSetupService=h(A),this.taxForm=R(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(D(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(D(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:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup"],[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&&(a(0,"app-main-panel",4),_(1,dn,4,0,"ng-template",null,0,u)(3,xn,7,6,"ng-template",null,1,u),i())},dependencies:[M,Y,w,J,K,pe,ee,Z,H,re,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var hn=()=>({height:"calc(100vh - 70px)"}),Cn=()=>({"min-width":"50rem"}),Sn=t=>[t];function vn(t,r){t&1&&$(0,"p-button",6)}function yn(t,r){if(t&1&&_(0,vn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Pn(t,r){t&1&&(a(0,"tr")(1,"th",9),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",10),i(),a(3,"td")(4,"a",11),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",ie(4,Sn,e.id)),p(),d(e.name),p(2),d(e.description)}}function On(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",8),y("onRowSelect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c(2);return S(l.onSelectAll(o))}),_(2,Pn,7,0,"ng-template",null,2,u)(4,bn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c(2);F(E(4,hn)),p(),s("value",e.writeoffList().data)("tableStyle",E(5,Cn))}}function In(t,r){if(t&1&&_(0,On,6,6,"p-panel",7),t&2){let e=c();s("ngIf",e.writeoffList())}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(A),this.writeoffList=R(null),this.hasCheckedItems=X(()=>{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(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),D(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]=x(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(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:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],[3,"style",4,"ngIf"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,yn,1,1,"ng-template",null,0,u)(3,In,1,1,"ng-template",null,1,u),i())},dependencies:[M,w,L,oe,ne,we,Me,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var En=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Tn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Fn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function wn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function Mn(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Fn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),i()()()()()),t&2){let e=c(2);p(),F(E(2,En)),p(4),O(e.writeOffForm().form)}}function Rn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,Tn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.route=h(ae),this.writeOffForm=R(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),D(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});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&&_(0,Rn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[M,w,L,Y,Ee,pe,ee,J,K,Z,H,re,k,G,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ft=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var kn={data:{expenseOptions:[]}},Ge=ye(Ie(kn),Je("POSExpenseOptionStore"),Pe(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(ft);return{onRowSelect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(j(()=>r.getExpenseOptions().pipe(Fe({next:n=>{te(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),be({onInit:t=>{t.getExpenseOptions()}}));var An=()=>({height:"calc(100vh - 70px)"});function Nn(t,r){t&1&&$(0,"p-button",6)}function Ln(t,r){if(t&1&&_(0,Nn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Gn(t,r){t&1&&(a(0,"tr")(1,"th",8),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),$(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function Vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Gn,9,0,"ng-template",null,2,u)(4,Bn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();F(E(3,An)),p(),s("value",e.store.data().expenseOptions)}}var _t=(()=>{class t{constructor(){this.store=h(Ge)}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)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[de([Ge])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","1rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Ln,1,1,"ng-template",null,0,u)(3,Vn,6,4,"ng-template",null,1,u),i())},dependencies:[M,oe,ne,we,Me,U,z,V,B,w,L],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ua=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:ct},{path:"taxs",component:st},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:_t}]}];export{Ua as POS_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{a as v,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as E,b as O}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as F}from"./chunk-B63BKC6F.js";import{Cb as B,Jc as m,Kb as p,Kc as l,Mc as x,Nb as d,Ub as o,V as y,Vb as n,Wb as c,X as M,Z as b,_b as P,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as C,ra as S,s as u,sa as k,wb as w,yc as $,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.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),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([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(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
1
+ import{a as v,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as E,b as O}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-ZI23MZE6.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as F}from"./chunk-B63BKC6F.js";import{Cb as B,Jc as m,Kb as p,Kc as l,Mc as x,Nb as d,Ub as o,V as y,Vb as n,Wb as c,X as M,Z as b,_b as P,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as C,ra as S,s as u,sa as k,wb as w,yc as $,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.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),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([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(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-AGLKA7OG.js";import"./chunk-C2GO6SPF.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{F as e}from"./chunk-B63BKC6F.js";import{ha as o}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var r=()=>{let t=o(n),i=o(e);return t.isAuthenticated()&&!t.isTokenExpired()&&t.checkAuthKeysExists()?(i.navigate(["/pages/dashboard"]),!1):!0};var h=[{path:"",canActivate:[r],loadComponent:()=>import("./chunk-CR2R5F5T.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-VAXEGESW.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-BMBVCXB4.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-M4Z3FI3C.js").then(t=>t.TimeoutComponent)}];export{h as AuthenticationRoutes};
1
+ import{a as n}from"./chunk-AGLKA7OG.js";import"./chunk-C2GO6SPF.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{F as e}from"./chunk-B63BKC6F.js";import{ha as o}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var r=()=>{let t=o(n),i=o(e);return t.isAuthenticated()&&!t.isTokenExpired()&&t.checkAuthKeysExists()?(i.navigate(["/pages/dashboard"]),!1):!0};var h=[{path:"",canActivate:[r],loadComponent:()=>import("./chunk-76K2CYGK.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-VAXEGESW.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-BMBVCXB4.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-M4Z3FI3C.js").then(t=>t.TimeoutComponent)}];export{h as AuthenticationRoutes};
@@ -1 +1 @@
1
- import{a as x,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],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(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
1
+ import{a as x,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-ZI23MZE6.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],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(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
@@ -1,4 +1,4 @@
1
- import{a as Le,b as Ve}from"./chunk-HHJMN4BS.js";import{a as vt,b as be}from"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as Re}from"./chunk-AGLKA7OG.js";import{b as St,c as Ct,d as yt}from"./chunk-KJ6CKUEI.js";import{a as ye,b as ve}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{b as xt}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as me}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as q,b as H}from"./chunk-O4QM64EH.js";import{a as ft,b as gt,d as Se,k as Ce}from"./chunk-EW3R2HAB.js";import{a as he,b as xe}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as ht}from"./chunk-RPPLUBX5.js";import{a as Ie}from"./chunk-XKCLERWG.js";import{a as oe,b as we}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{b as Te}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import{d as dt}from"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as ge}from"./chunk-5R3XKSDM.js";import{f as _t,h as fe}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as le,b as pe}from"./chunk-J4XRJAME.js";import{a as V,b as ce,c as se,d as de,e as ue,f as _e,g as ut}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as re,x as ae}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as Q,f as Z,g as ct,i as G,k as ee,l as te,o as ie,t as st,v as De,y as ne}from"./chunk-FMVCTBCQ.js";import{a as mt}from"./chunk-ZGXJEG37.js";import{a as pt}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as lt,G as X,N as J,f as z,k as ot,l as U,m as $,r as rt,s as at}from"./chunk-B63BKC6F.js";import{Ac as I,Cb as x,D as Fe,Ga as T,Jc as S,Kb as c,Kc as C,L as Xe,Lc as it,Mc as s,Nb as j,Pb as O,Qb as ke,Sb as Be,Tb as Oe,Ub as n,V as Je,Vb as i,W as Qe,Wb as L,X as P,Yc as w,Z as M,Zc as nt,_b as R,ba as Ze,c as A,cb as et,dc as F,ec as d,gb as l,ha as g,hc as tt,pa as v,qa as b,qc as a,rc as _,s as $e,sc as D,vc as Y,wb as k,wc as N,xc as W,yc as K,zc as E}from"./chunk-JP6RBSB3.js";import{a as h,b as y,c as Me,e as Ue}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=g(mt),this.authService=g(Re)}fetchGeneralLedgerLoader(){return this.httpService.get(void 0,"api/GeneralLedgerLoader/GetFilter")}fetchGeneralLedgerReport(e){return this.httpService.post(void 0,"api/GeneralLedger/Get",e)}exportGeneralLedger(e){let o={responseType:"blob"};return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,o)}getCustomerSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:o})}getSupplierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:o})}getCashierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:o})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,o={}){let r=new at({fromObject:Object.fromEntries(Object.entries(e).map(([u,At])=>[u,String(At)]))}),m=new rt({"X-Timeout":"30000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true"}),f=h({params:r,headers:m},o);return this.httpService.get(void 0,"/api/BalanceSheet",f)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,o={}){return this.httpService.post(void 0,"api/IncomeStatement/List",h({},e),o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Pt={metadata:{filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:0,contactID:""},options:{accounts:[],outlets:[],contactTypeOptions:[]},roles:{isInEmptyOutletRole:!1}},items:{data:[],pageTitle:""},filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:1,contactID:null}},Ge=ce(_e(Pt),ut("General Ledger Store"),se(t=>({debitTotal:w(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.debitAmount||0),0),0)),creditTotal:w(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.creditAmount||0),0),0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},loadList:q(A(Fe(o=>o.listAccountID.length>0),P(o=>p.fetchGeneralLedgerReport(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:q(A(P(()=>p.fetchGeneralLedgerLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:y(h({},r.filter),{listCategoryID:o.filter.listCategoryID})})),e.loadList(t.filter)},error:o=>{console.error(o)}})))))};return e}),de({onInit:t=>{t.loadLoader()}}));var qt=()=>({height:"calc(100vh - 70px)"}),Ht=()=>({height:"calc(100vh - 100px)"}),Yt=t=>["/pages/journal/journal-entry/",t],Wt=()=>({scrollHeight:"250px"});function Kt(t,p){if(t&1){let e=R();n(0,"p-button",14),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function zt(t,p){if(t&1&&(n(0,"div",11)(1,"a",12),a(2,"Return to Accounts"),i(),x(3,Kt,1,0,"p-button",13),i()),t&2){let e=d();l(3),c("ngIf",e.roleService.global.export)}}function Ut(t,p){if(t&1&&(n(0,"div",11)(1,"span",17)(2,"h2",18),a(3),i()(),n(4,"span",17)(5,"h2",18),a(6),i()()()),t&2){let e=d().$implicit;l(3),_(e.name),l(3),D(" (",e.chartOfAccountCode,") ")}}function $t(t,p){t&1&&(n(0,"tr")(1,"th",19),a(2,"Outlet"),i(),n(3,"th",19),a(4,"No."),i(),n(5,"th",19),a(6,"Date"),i(),n(7,"th",19),a(8,"Name"),i(),n(9,"th",19),a(10,"Description"),i(),n(11,"th",20),a(12,"Debit"),i(),n(13,"th",21),a(14,"Credit"),i(),n(15,"th",21),a(16,"Balance"),i()())}function Xt(t,p){if(t&1&&(n(0,"td",26),a(1,"Starting Balance"),i(),n(2,"td",27),a(3),S(4,"number"),i()),t&2){let e=d(2).$implicit;l(3),D(" ",C(4,1,e.startBalance)," ")}}function Jt(t,p){if(t&1&&(n(0,"tr"),x(1,Xt,5,3),i(),n(2,"tr")(3,"td",22),a(4),i(),n(5,"td",22)(6,"a",23),a(7),i()(),n(8,"td",22),a(9),S(10,"date"),i(),n(11,"td",22)(12,"a",24),a(13),i()(),L(14,"td"),n(15,"td",25),a(16),S(17,"number"),i(),n(18,"td",25),a(19),S(20,"number"),i(),n(21,"td",25),a(22),S(23,"number"),i()()),t&2){let e=p.$implicit,o=p.rowIndex,r=d(4);l(),O(o===0&&r.store.items().data.length>0?1:-1),l(3),_(e.outletName),l(2),c("routerLink",I(19,Yt,e.id)),l(),_(e.number),l(2),_(it(10,10,e.date,"dd MMM yyyy")),l(3),c("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,et),l(),_(e.contactName),l(3),D(" ",C(17,13,e.debitAmount)," "),l(3),D(" ",C(20,15,e.creditAmount)," "),l(3),_(C(23,17,e.balance))}}function Qt(t,p){if(t&1&&(n(0,"tr"),L(1,"td",28),n(2,"td",29),a(3,"Total"),i(),n(4,"td",29),a(5),S(6,"number"),i(),n(7,"td",29),a(8),S(9,"number"),i(),L(10,"td"),i()),t&2){let e=d().$index,o=d(3);l(5),D(" ",C(6,2,o.store.items().data[e].debitTotal)," "),l(3),D(" ",C(9,4,o.store.items().data[e].creditTotal)," ")}}function Zt(t,p){t&1&&(n(0,"tr")(1,"td",30)(2,"span"),a(3,"No records found."),i()()())}function ei(t,p){if(t&1&&(n(0,"p-table",16),x(1,Ut,7,2,"ng-template",null,3,s)(3,$t,17,0,"ng-template",null,4,s)(5,Jt,24,21,"ng-template",null,5,s)(7,Qt,11,6,"ng-template",null,6,s)(9,Zt,4,0,"ng-template",null,7,s),i()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function ti(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel"),Be(2,ei,11,2,"p-table",16,ke),i()()),t&2){let e=d(2);j(E(4,qt)),l(),j(E(5,Ht)),l(),Oe(e.store.items().data)}}function ii(t,p){if(t&1&&x(0,ti,4,6,"p-panel",15),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function ni(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),D("(",e.code,")"),l(6),_(e.name)}}function oi(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),D("(",e.code,")"),l(6),_(e.name)}}function ri(t,p){if(t&1&&(n(0,"div",44)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function ai(t,p){if(t&1&&(n(0,"div",41),L(1,"p-radiobutton",45),n(2,"label",46),a(3),i()()),t&2){let e=p.$implicit;l(),c("value",e.key)("inputId",e.key),l(),tt("for",e.key),l(),_(e.value)}}function li(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function pi(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Supplier"),i(),n(3,"p-autocomplete",48),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchSupplier(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.supplierSuggestions())}}function mi(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function ci(t,p){if(t&1){let e=R();n(0,"form",31)(1,"div",32)(2,"label",33),a(3,"Accounts"),i(),n(4,"p-multiselect",34),F("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),x(5,ni,10,2,"ng-template",null,8,s)(7,oi,10,2,"ng-template",null,9,s),i()(),n(9,"div",32)(10,"label",33),a(11,"From"),i(),L(12,"p-datepicker",35),i(),n(13,"div",32)(14,"label",33),a(15,"To"),i(),L(16,"p-datepicker",36),i(),n(17,"div",32)(18,"label",33),a(19,"Outlets"),i(),n(20,"p-multiselect",37),x(21,ri,3,1,"ng-template",null,9,s),i()(),n(23,"div",32)(24,"label",33),a(25,"Category"),i(),n(26,"p-treeselect",38),F("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),i()(),n(27,"div",32)(28,"label",39),a(29,"Contact Type"),i(),n(30,"div",40),Be(31,ai,4,4,"div",41,ke),i()(),x(33,li,4,1,"div",32)(34,pi,4,1,"div",32)(35,mi,4,1,"div",32),i()}if(t&2){let e,o=d();c("formGroup",o.generalLedgerFilterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("maxlength",5)("options",o.store.metadata().options.accounts),l(8),c("iconDisplay","input")("showIcon",!0),l(4),c("iconDisplay","input")("showIcon",!0),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.store.metadata().options.outlets),l(6),c("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",E(18,Wt))("options",o.categoriesOptions()),l(5),Oe(o.store.metadata().options.contactTypeOptions),l(2),O((e=o.generalLedgerFilterForm.controls.contactType.value)===1?33:e===2?34:35)}}var Lt=(()=>{class t{constructor(){this.dialogFilterVisible=T(!1),this.reportService=g(B),this.coaService=g(ht),this.authService=g(Re),this.store=g(Ge),this.roleService=g(me),this.categoriesOptions=T([]),this.customerSuggestions=T([]),this.supplierSuggestions=T([]),this.route=g(lt),this.dayjsService=g(be),this.initDialogVisible=T(!0),this.fb=g(De),this.toastr=g(pt)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe($e(e=>e.get("id")),M(e=>{e&&(this.initDialogVisible.update(o=>!o),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(h({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange(),this.generalLedgerFilterForm.valueChanges.pipe(Xe(500),M(e=>{Array.isArray(e.listAccountID)&&e.listAccountID.length>0?this.generalLedgerFilterForm.controls.listCategoryID.disable():this.generalLedgerFilterForm.controls.listCategoryID.enable(),e.listCategoryID&&e.listCategoryID.filter(o=>o.key).length>0?this.generalLedgerFilterForm.controls.listAccountID.disable():this.generalLedgerFilterForm.controls.listAccountID.enable()})).subscribe()}clearContactValueOnContactTypeChange(){this.generalLedgerFilterForm.get("contactType")?.valueChanges.subscribe(()=>this.generalLedgerFilterForm.get("contactID")?.setValue(""))}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at least 5 accounts for the general ledger report.","Warning")}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}generateFilterForm(){this.generalLedgerFilterForm=this.fb.group({listAccountID:new G([]),listCategoryID:new G([]),listOutletID:new G([]),contactID:new G(""),from:new G(""),to:new G(""),contactType:new G(1)})}onFilterOKEvent(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]);if(this.generalLedgerFilterForm.invalid){this.generalLedgerFilterForm.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.dialogFilterVisible.update(u=>!u),this.store.updateFilter(m),this.dialogFilterVisible.set(!1)}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(o=>this.customerSuggestions.set(o))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(o=>this.supplierSuggestions.set(o))).subscribe()}onExport(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]),m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.reportService.exportGeneralLedger(m).pipe(M(u=>{yt(u,`general-ledger-${this.dayjsService.now.format("D-MM-YYYY")}.${u.type.split("/")[1]}`,u.type)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-general-ledger"]],features:[K([Ge])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["caption",""],["header",""],["body",""],["footer",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"style",4,"ngIf"],["scrollHeight","calc(100vh - 150px)",3,"value","scrollable"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],["colspan","7",1,"text-end"],[1,"text-end"],["colspan","4"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","maxlength","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","id","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],["for",""],[1,"d-flex","gap-3"],[1,"d-flex","align-items-center","gap-2"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",10),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.initDialogVisible,u)||(r.initDialogVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,zt,4,1,"ng-template",null,0,s)(3,ii,1,1,"ng-template",null,1,s)(5,ci,36,19,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.items().pageTitle.length?r.store.items().pageTitle:"General Ledger"),Y("isDialogFilterVisible",r.dialogFilterVisible),c("isFilterable",!0),Y("isInitDialogFilterVisible",r.initDialogVisible))},dependencies:[fe,$,z,U,ot,ge,Ce,Se,_t,ae,re,Te,xe,he,Ve,Le,ne,ee,Q,Z,st,te,ie,ve,ye,we,oe,dt,Ct,St,xt,pe,le,J,X,gt,ft],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var si={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Ae=ce(_e(si),se(t=>{let p={totalCOGS:w(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalRevenue:w(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalExpense:w(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),grossProfit:w(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:w(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:w(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),ue(t=>{let p=g(B),e=g(be),o={updateFilter(r){V(t,m=>y(h({},m),{filter:h(h({},m.filter),r)}))},getLoader:q(A(P(()=>p.getIncomeStatementLoader().pipe(H({next:r=>{V(t,m=>y(h({},m),{loader:r,filter:y(h({},m.filter),{from:e.from(r.filter.from).format(),to:e.from(r.filter.to).format()})})),o.getIncomeStatement(t.filter)},error:r=>{console.error(r)}}))))),getIncomeStatement:q(A(P(r=>p.getIncomeStatement(r).pipe(Qe(()=>V(t,m=>y(h({},m),{isLoading:!0}))),H({next:m=>{V(t,f=>y(h({},f),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return o}),de({onInit:t=>{t.getLoader()}}));var di=()=>({height:"calc(100vh - 70px)"}),ui=()=>({height:"calc(100vh - 150px)"}),Pe=()=>({}),je=t=>["/pages/chart-of-account/account/",t],Ne=()=>["/pages/report/general-ledger"],qe=t=>({id:t});function _i(t,p){if(t&1){let e=R();n(0,"p-button",10),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function fi(t,p){if(t&1&&(n(0,"div",8),x(1,_i,1,0,"p-button",9),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function gi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function hi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.accountID)),l(),_(C(9,6,e.amount))}}function xi(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total Revenue :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,1,e.store.totalRevenue()))}}function Si(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No revenue records available"),i()()())}function Ci(t,p){if(t&1&&(n(0,"h6",13),a(1,"Revenue"),i(),n(2,"p-table",14),x(3,gi,7,0,"ng-template",null,3,s)(5,hi,10,13,"ng-template",null,4,s)(7,xi,8,3,"ng-template",null,5,s)(9,Si,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.revenue)}}function yi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",25),a(6,"Total"),i()())}function vi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function bi(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total COGS :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()(),n(8,"tr")(9,"td",20)(10,"div",21)(11,"span",22),a(12,"Gross Profit :"),i(),n(13,"span",23),a(14),S(15,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,2,e.store.totalCOGS())),l(8),_(C(15,4,e.store.grossProfit()))}}function Ei(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No COGS records available"),i()()())}function Ii(t,p){if(t&1&&(n(0,"h4",13),a(1,"COGS"),i(),n(2,"p-table",14),x(3,yi,7,0,"ng-template",null,3,s)(5,vi,10,13,"ng-template",null,4,s)(7,bi,16,6,"ng-template",null,5,s)(9,Ei,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.cogs)}}function Fi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ri(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function Di(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total Expense :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()(),n(8,"tr")(9,"td",20)(10,"div",21)(11,"span",22),a(12,"Profit / Loss :"),i(),n(13,"span",23),a(14),S(15,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,2,e.store.totalExpense())),l(8),_(C(15,4,e.store.profitOrLoss()))}}function wi(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No expense records available"),i()()())}function Ti(t,p){if(t&1&&(n(0,"h4",13),a(1,"Expense"),i(),n(2,"p-table",14),x(3,Fi,7,0,"ng-template",null,3,s)(5,Ri,10,13,"ng-template",null,4,s)(7,Di,16,6,"ng-template",null,5,s)(9,wi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.expense)}}function Li(t,p){if(t&1&&(n(0,"p-scroll-panel")(1,"div",12),x(2,Ci,11,1)(3,Ii,11,1)(4,Ti,11,1),i()()),t&2){let e,o,r,m=d(2);j(E(5,ui)),l(2),O(m.Object.keys((e=m.store.data().data)!==null&&e!==void 0?e:E(6,Pe)).length>0?2:-1),l(),O(m.Object.keys((o=(o=m.store.data().data)==null?null:o.cogs)!==null&&o!==void 0?o:E(7,Pe)).length>0?3:-1),l(),O(m.Object.keys((r=(r=m.store.data().data)==null?null:r.expense)!==null&&r!==void 0?r:E(8,Pe)).length>0?4:-1)}}function Vi(t,p){if(t&1&&(n(0,"p-panel"),x(1,Li,5,9,"p-scroll-panel",11),i()),t&2){let e=d();j(E(3,di)),l(),c("ngIf",e.store.data())}}function Mi(t,p){if(t&1){let e=R();n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),L(4,"p-multiselect",29),i(),n(5,"div",27)(6,"label",28),a(7,"Cashier"),i(),n(8,"p-autocomplete",30),F("completeMethod",function(r){v(e);let m=d();return b(m.onCashierSearch(r))})("onSelect",function(r){v(e);let m=d();return b(m.onCashierSelect(r))}),i()(),n(9,"div",27)(10,"label",28),a(11,"From"),i(),L(12,"p-datepicker",31),i(),n(13,"div",27)(14,"label",28),a(15,"To"),i(),L(16,"p-datepicker",32),i()()}if(t&2){let e=d();c("formGroup",e.formFilter),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),c("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0)}}var Vt=(()=>{class t{constructor(){this.dayjsService=g(be),this.store=g(Ae),this.fb=g(De),this.reportService=g(B),this.roleService=g(me),this.isInitDialogFilterVisible=T(!1),this.dialogFilterVisible=T(!1),this.cashierSuggestions=T([]),this.cashierHashMap=new Map,this.Object=Object,nt(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(h({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ie("Cashier Suggestions"),M(o=>this.cashierSuggestions.set(o))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),o=Object.entries(e).reduce((r,[m,f])=>(m==="from"||m==="to"?f instanceof Date&&(r[m]=this.dayjsService.from(f).format()):r[m]=f||null,r),{});this.store.updateFilter(h(h({},this.store.filter()),o)),this.dialogFilterVisible.update(r=>!r),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ie("Export Profit & Loss"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`profit-and-loss.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-income-statement"]],features:[K([Ae])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["formControlName","from","styleClass","w-100","appendTo","body"],["formControlName","to","styleClass","w-100","appendTo","body"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",7),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),x(1,fi,2,1,"ng-template",null,0,s)(3,Vi,2,4,"ng-template",null,1,s)(5,Mi,17,8,"ng-template",null,2,s),i()}o&2&&(c("isFilterable",!0)("pageTitle",r.store.data().pageTitle),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Te,xe,he,ne,ee,Q,Z,te,ie,ve,ye,ge,Ce,Se,pe,le,oe,J,X,Ve,Le,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var He=Ue(vt());var ki={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,He.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Ye=ce(_e(ki),se(t=>({totalAsset:w(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:w(()=>t.data().liability.reduce((p,e)=>p+ +e.counterAmount,0)),totalEquity:w(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},fetchBalanceSheet:q(A(Fe(()=>{let o=t.filter();return Object.entries(o).every(([r,m])=>m!=null&&m!=="")}),P(o=>p.getBalanceSheet(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{data:r}))},error:r=>{console.error(r)}}))),Je(1))),fetchLoader:q(A(P(()=>p.getBalanceSheetLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:{date:(0,He.default)(o.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:o=>{console.error(o)}})))))};return e}),de(t=>({onInit:()=>{t.fetchLoader()}})));var Mt=Ue(vt());var Bi=()=>({height:"calc(100vh - 70px)"}),Oi=()=>({height:"calc(100vh - 100px)"}),We=t=>["/pages/chart-of-account/account/",t],Ke=()=>["/pages/report/general-ledger"],ze=t=>({id:t});function Gi(t,p){if(t&1){let e=R();n(0,"p-button",11),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Ai(t,p){if(t&1&&(n(0,"div",9),x(1,Gi,1,0,"p-button",10),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function Pi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Asset"),i(),n(5,"th",17),a(6,"Total"),i()())}function ji(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.amount))}}function Ni(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Asset"),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,1,e.store.totalAsset())," ")}}function qi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),i()()())}function Hi(t,p){if(t&1&&(n(0,"h4",14),a(1,"Asset"),i(),n(2,"p-table",15),x(3,Pi,7,0,"ng-template",null,3,s)(5,ji,10,13,"ng-template",null,4,s)(7,Ni,6,3,"ng-template",null,5,s)(9,qi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function Yi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Liability"),i(),n(5,"th",17),a(6,"Total"),i()())}function Wi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",25),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Ki(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2," Total Liability "),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,1,e.store.totalLiability())," ")}}function zi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),i()()())}function Ui(t,p){if(t&1&&(n(0,"h4",24),a(1,"Liability"),i(),n(2,"p-table",15),x(3,Yi,7,0,"ng-template",null,3,s)(5,Wi,10,13,"ng-template",null,4,s)(7,Ki,6,3,"ng-template",null,5,s)(9,zi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function $i(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Equity"),i(),n(5,"th",17),a(6,"Total"),i()())}function Xi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Ji(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Equity"),i(),n(3,"td",22),a(4),S(5,"number"),i()(),n(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),i(),n(9,"td",22),a(10),S(11,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,2,e.store.totalEquity())," "),l(6),D(" ",C(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Qi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),i()()())}function Zi(t,p){if(t&1&&(n(0,"h4",24),a(1,"Equity"),i(),n(2,"p-table",15),x(3,$i,7,0,"ng-template",null,3,s)(5,Xi,10,13,"ng-template",null,4,s),a(7," <"),x(8,Ji,12,6,"ng-template",null,5,s)(10,Qi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function en(t,p){if(t&1&&(n(0,"p-panel",12)(1,"p-scroll-panel")(2,"div",13),x(3,Hi,11,1)(4,Ui,11,1)(5,Zi,12,1),i()()()),t&2){let e=d();j(E(8,Bi)),c("showHeader",!1),l(),j(E(9,Oi)),l(2),O(e.Object.keys(e.store.data().asset).length>0?3:-1),l(),O(e.Object.keys(e.store.data().liability).length>0?4:-1),l(),O(e.Object.keys(e.store.data().equity).length>0?5:-1)}}function tn(t,p){if(t&1&&(n(0,"div",31)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function nn(t,p){if(t&1&&(n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),n(4,"p-multiselect",29),x(5,tn,3,1,"ng-template",null,7,s),i()(),n(7,"div",27)(8,"label",28),a(9,"From"),i(),L(10,"p-datepicker",30),i()()),t&2){let e=d();c("formGroup",e.filterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),c("iconDisplay","input")("showIcon",!0)}}var kt=(()=>{class t{constructor(){this.store=g(Ye),this.ReportServiceStore=g(B),this.dialogFilterVisible=T(!1),this.isInitDialogFilterVisible=T(!1),this.roleService=g(me),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new ct({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:o}=this.filterForm.value;this.store.updateFilter({date:(0,Mt.default)(e).format("YYYY-MM-DD"),listOutletParam:o}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ie("Export Balance Sheet"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`balance-sheet.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-balance-sheet"]],features:[K([Ye])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",8),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Ai,2,1,"ng-template",null,0,s)(3,en,6,10,"ng-template",null,1,s)(5,nn,11,7,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.data().pageTitle)("isFilterable",!0),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Ce,Se,ge,ae,re,ne,ee,Q,Z,te,ie,ve,ye,xe,he,we,oe,pe,le,J,X],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Bt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-comparative-balance works!"),i(),a(2,`
1
+ import{a as Le,b as Ve}from"./chunk-HHJMN4BS.js";import{a as vt,b as be}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as Re}from"./chunk-AGLKA7OG.js";import{b as St,c as Ct,d as yt}from"./chunk-KJ6CKUEI.js";import{a as ye,b as ve}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{b as xt}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as me}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as q,b as H}from"./chunk-O4QM64EH.js";import{a as ft,b as gt,d as Se,k as Ce}from"./chunk-EW3R2HAB.js";import{a as he,b as xe}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as ht}from"./chunk-RPPLUBX5.js";import{a as Ie}from"./chunk-XKCLERWG.js";import{a as oe,b as we}from"./chunk-4LGDNQMZ.js";import"./chunk-PKN47FQE.js";import{b as Te}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import{d as dt}from"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as ge}from"./chunk-5R3XKSDM.js";import{f as _t,h as fe}from"./chunk-ZI23MZE6.js";import"./chunk-C7LM5UCK.js";import{a as le,b as pe}from"./chunk-J4XRJAME.js";import{a as V,b as ce,c as se,d as de,e as ue,f as _e,g as ut}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as re,x as ae}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as Q,f as Z,g as ct,i as G,k as ee,l as te,o as ie,t as st,v as De,y as ne}from"./chunk-FMVCTBCQ.js";import{a as mt}from"./chunk-ZGXJEG37.js";import{a as pt}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{D as lt,G as X,N as J,f as z,k as ot,l as U,m as $,r as rt,s as at}from"./chunk-B63BKC6F.js";import{Ac as I,Cb as x,D as Fe,Ga as T,Jc as S,Kb as c,Kc as C,L as Xe,Lc as it,Mc as s,Nb as j,Pb as O,Qb as ke,Sb as Be,Tb as Oe,Ub as n,V as Je,Vb as i,W as Qe,Wb as L,X as P,Yc as w,Z as M,Zc as nt,_b as R,ba as Ze,c as A,cb as et,dc as F,ec as d,gb as l,ha as g,hc as tt,pa as v,qa as b,qc as a,rc as _,s as $e,sc as D,vc as Y,wb as k,wc as N,xc as W,yc as K,zc as E}from"./chunk-JP6RBSB3.js";import{a as h,b as y,c as Me,e as Ue}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=g(mt),this.authService=g(Re)}fetchGeneralLedgerLoader(){return this.httpService.get(void 0,"api/GeneralLedgerLoader/GetFilter")}fetchGeneralLedgerReport(e){return this.httpService.post(void 0,"api/GeneralLedger/Get",e)}exportGeneralLedger(e){let o={responseType:"blob"};return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,o)}getCustomerSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:o})}getSupplierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:o})}getCashierSuggestions(e){let o={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:o})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,o={}){let r=new at({fromObject:Object.fromEntries(Object.entries(e).map(([u,At])=>[u,String(At)]))}),m=new rt({"X-Timeout":"30000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true"}),f=h({params:r,headers:m},o);return this.httpService.get(void 0,"/api/BalanceSheet",f)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,o={}){return this.httpService.post(void 0,"api/IncomeStatement/List",h({},e),o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Pt={metadata:{filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:0,contactID:""},options:{accounts:[],outlets:[],contactTypeOptions:[]},roles:{isInEmptyOutletRole:!1}},items:{data:[],pageTitle:""},filter:{listAccountID:[],from:null,to:null,listOutletID:[],listCategoryID:[],contactType:1,contactID:null}},Ge=ce(_e(Pt),ut("General Ledger Store"),se(t=>({debitTotal:w(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.debitAmount||0),0),0)),creditTotal:w(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.creditAmount||0),0),0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},loadList:q(A(Fe(o=>o.listAccountID.length>0),P(o=>p.fetchGeneralLedgerReport(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:q(A(P(()=>p.fetchGeneralLedgerLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:y(h({},r.filter),{listCategoryID:o.filter.listCategoryID})})),e.loadList(t.filter)},error:o=>{console.error(o)}})))))};return e}),de({onInit:t=>{t.loadLoader()}}));var qt=()=>({height:"calc(100vh - 70px)"}),Ht=()=>({height:"calc(100vh - 100px)"}),Yt=t=>["/pages/journal/journal-entry/",t],Wt=()=>({scrollHeight:"250px"});function Kt(t,p){if(t&1){let e=R();n(0,"p-button",14),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function zt(t,p){if(t&1&&(n(0,"div",11)(1,"a",12),a(2,"Return to Accounts"),i(),x(3,Kt,1,0,"p-button",13),i()),t&2){let e=d();l(3),c("ngIf",e.roleService.global.export)}}function Ut(t,p){if(t&1&&(n(0,"div",11)(1,"span",17)(2,"h2",18),a(3),i()(),n(4,"span",17)(5,"h2",18),a(6),i()()()),t&2){let e=d().$implicit;l(3),_(e.name),l(3),D(" (",e.chartOfAccountCode,") ")}}function $t(t,p){t&1&&(n(0,"tr")(1,"th",19),a(2,"Outlet"),i(),n(3,"th",19),a(4,"No."),i(),n(5,"th",19),a(6,"Date"),i(),n(7,"th",19),a(8,"Name"),i(),n(9,"th",19),a(10,"Description"),i(),n(11,"th",20),a(12,"Debit"),i(),n(13,"th",21),a(14,"Credit"),i(),n(15,"th",21),a(16,"Balance"),i()())}function Xt(t,p){if(t&1&&(n(0,"td",26),a(1,"Starting Balance"),i(),n(2,"td",27),a(3),S(4,"number"),i()),t&2){let e=d(2).$implicit;l(3),D(" ",C(4,1,e.startBalance)," ")}}function Jt(t,p){if(t&1&&(n(0,"tr"),x(1,Xt,5,3),i(),n(2,"tr")(3,"td",22),a(4),i(),n(5,"td",22)(6,"a",23),a(7),i()(),n(8,"td",22),a(9),S(10,"date"),i(),n(11,"td",22)(12,"a",24),a(13),i()(),L(14,"td"),n(15,"td",25),a(16),S(17,"number"),i(),n(18,"td",25),a(19),S(20,"number"),i(),n(21,"td",25),a(22),S(23,"number"),i()()),t&2){let e=p.$implicit,o=p.rowIndex,r=d(4);l(),O(o===0&&r.store.items().data.length>0?1:-1),l(3),_(e.outletName),l(2),c("routerLink",I(19,Yt,e.id)),l(),_(e.number),l(2),_(it(10,10,e.date,"dd MMM yyyy")),l(3),c("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,et),l(),_(e.contactName),l(3),D(" ",C(17,13,e.debitAmount)," "),l(3),D(" ",C(20,15,e.creditAmount)," "),l(3),_(C(23,17,e.balance))}}function Qt(t,p){if(t&1&&(n(0,"tr"),L(1,"td",28),n(2,"td",29),a(3,"Total"),i(),n(4,"td",29),a(5),S(6,"number"),i(),n(7,"td",29),a(8),S(9,"number"),i(),L(10,"td"),i()),t&2){let e=d().$index,o=d(3);l(5),D(" ",C(6,2,o.store.items().data[e].debitTotal)," "),l(3),D(" ",C(9,4,o.store.items().data[e].creditTotal)," ")}}function Zt(t,p){t&1&&(n(0,"tr")(1,"td",30)(2,"span"),a(3,"No records found."),i()()())}function ei(t,p){if(t&1&&(n(0,"p-table",16),x(1,Ut,7,2,"ng-template",null,3,s)(3,$t,17,0,"ng-template",null,4,s)(5,Jt,24,21,"ng-template",null,5,s)(7,Qt,11,6,"ng-template",null,6,s)(9,Zt,4,0,"ng-template",null,7,s),i()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function ti(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel"),Be(2,ei,11,2,"p-table",16,ke),i()()),t&2){let e=d(2);j(E(4,qt)),l(),j(E(5,Ht)),l(),Oe(e.store.items().data)}}function ii(t,p){if(t&1&&x(0,ti,4,6,"p-panel",15),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function ni(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),D("(",e.code,")"),l(6),_(e.name)}}function oi(t,p){if(t&1&&(n(0,"div",11)(1,"div",17)(2,"span",42),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",17)(8,"span",43),a(9),i()()()),t&2){let e=p.$implicit;l(3),D("(",e.code,")"),l(6),_(e.name)}}function ri(t,p){if(t&1&&(n(0,"div",44)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function ai(t,p){if(t&1&&(n(0,"div",41),L(1,"p-radiobutton",45),n(2,"label",46),a(3),i()()),t&2){let e=p.$implicit;l(),c("value",e.key)("inputId",e.key),l(),tt("for",e.key),l(),_(e.value)}}function li(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function pi(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Supplier"),i(),n(3,"p-autocomplete",48),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchSupplier(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.supplierSuggestions())}}function mi(t,p){if(t&1){let e=R();n(0,"div",32)(1,"label",33),a(2,"Customer"),i(),n(3,"p-autocomplete",47),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),i()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function ci(t,p){if(t&1){let e=R();n(0,"form",31)(1,"div",32)(2,"label",33),a(3,"Accounts"),i(),n(4,"p-multiselect",34),F("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),x(5,ni,10,2,"ng-template",null,8,s)(7,oi,10,2,"ng-template",null,9,s),i()(),n(9,"div",32)(10,"label",33),a(11,"From"),i(),L(12,"p-datepicker",35),i(),n(13,"div",32)(14,"label",33),a(15,"To"),i(),L(16,"p-datepicker",36),i(),n(17,"div",32)(18,"label",33),a(19,"Outlets"),i(),n(20,"p-multiselect",37),x(21,ri,3,1,"ng-template",null,9,s),i()(),n(23,"div",32)(24,"label",33),a(25,"Category"),i(),n(26,"p-treeselect",38),F("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),i()(),n(27,"div",32)(28,"label",39),a(29,"Contact Type"),i(),n(30,"div",40),Be(31,ai,4,4,"div",41,ke),i()(),x(33,li,4,1,"div",32)(34,pi,4,1,"div",32)(35,mi,4,1,"div",32),i()}if(t&2){let e,o=d();c("formGroup",o.generalLedgerFilterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("maxlength",5)("options",o.store.metadata().options.accounts),l(8),c("iconDisplay","input")("showIcon",!0),l(4),c("iconDisplay","input")("showIcon",!0),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.store.metadata().options.outlets),l(6),c("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",E(18,Wt))("options",o.categoriesOptions()),l(5),Oe(o.store.metadata().options.contactTypeOptions),l(2),O((e=o.generalLedgerFilterForm.controls.contactType.value)===1?33:e===2?34:35)}}var Lt=(()=>{class t{constructor(){this.dialogFilterVisible=T(!1),this.reportService=g(B),this.coaService=g(ht),this.authService=g(Re),this.store=g(Ge),this.roleService=g(me),this.categoriesOptions=T([]),this.customerSuggestions=T([]),this.supplierSuggestions=T([]),this.route=g(lt),this.dayjsService=g(be),this.initDialogVisible=T(!0),this.fb=g(De),this.toastr=g(pt)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe($e(e=>e.get("id")),M(e=>{e&&(this.initDialogVisible.update(o=>!o),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(h({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange(),this.generalLedgerFilterForm.valueChanges.pipe(Xe(500),M(e=>{Array.isArray(e.listAccountID)&&e.listAccountID.length>0?this.generalLedgerFilterForm.controls.listCategoryID.disable():this.generalLedgerFilterForm.controls.listCategoryID.enable(),e.listCategoryID&&e.listCategoryID.filter(o=>o.key).length>0?this.generalLedgerFilterForm.controls.listAccountID.disable():this.generalLedgerFilterForm.controls.listAccountID.enable()})).subscribe()}clearContactValueOnContactTypeChange(){this.generalLedgerFilterForm.get("contactType")?.valueChanges.subscribe(()=>this.generalLedgerFilterForm.get("contactID")?.setValue(""))}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at least 5 accounts for the general ledger report.","Warning")}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}generateFilterForm(){this.generalLedgerFilterForm=this.fb.group({listAccountID:new G([]),listCategoryID:new G([]),listOutletID:new G([]),contactID:new G(""),from:new G(""),to:new G(""),contactType:new G(1)})}onFilterOKEvent(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]);if(this.generalLedgerFilterForm.invalid){this.generalLedgerFilterForm.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.dialogFilterVisible.update(u=>!u),this.store.updateFilter(m),this.dialogFilterVisible.set(!1)}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(o=>this.customerSuggestions.set(o))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(o=>this.supplierSuggestions.set(o))).subscribe()}onExport(){let f=this.generalLedgerFilterForm.value,{from:e,to:o}=f,r=Me(f,["from","to"]),m={listCategoryID:r.listCategoryID?r.listCategoryID.map(u=>u.key):[],contactID:r.contactID.length===0?null:r.contactID,listOutletID:r.listOutletID?r.listOutletID:[],listAccountID:r.listAccountID?r.listAccountID:[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(o)?this.dayjsService.format(o):null,contactType:r.contactType};this.reportService.exportGeneralLedger(m).pipe(M(u=>{yt(u,`general-ledger-${this.dayjsService.now.format("D-MM-YYYY")}.${u.type.split("/")[1]}`,u.type)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-general-ledger"]],features:[K([Ge])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["caption",""],["header",""],["body",""],["footer",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"style",4,"ngIf"],["scrollHeight","calc(100vh - 150px)",3,"value","scrollable"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],["colspan","7",1,"text-end"],[1,"text-end"],["colspan","4"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","maxlength","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","id","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],["for",""],[1,"d-flex","gap-3"],[1,"d-flex","align-items-center","gap-2"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",10),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.initDialogVisible,u)||(r.initDialogVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,zt,4,1,"ng-template",null,0,s)(3,ii,1,1,"ng-template",null,1,s)(5,ci,36,19,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.items().pageTitle.length?r.store.items().pageTitle:"General Ledger"),Y("isDialogFilterVisible",r.dialogFilterVisible),c("isFilterable",!0),Y("isInitDialogFilterVisible",r.initDialogVisible))},dependencies:[fe,$,z,U,ot,ge,Ce,Se,_t,ae,re,Te,xe,he,Ve,Le,ne,ee,Q,Z,st,te,ie,ve,ye,we,oe,dt,Ct,St,xt,pe,le,J,X,gt,ft],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var si={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Ae=ce(_e(si),se(t=>{let p={totalCOGS:w(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalRevenue:w(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalExpense:w(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),grossProfit:w(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:w(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:w(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),ue(t=>{let p=g(B),e=g(be),o={updateFilter(r){V(t,m=>y(h({},m),{filter:h(h({},m.filter),r)}))},getLoader:q(A(P(()=>p.getIncomeStatementLoader().pipe(H({next:r=>{V(t,m=>y(h({},m),{loader:r,filter:y(h({},m.filter),{from:e.from(r.filter.from).format(),to:e.from(r.filter.to).format()})})),o.getIncomeStatement(t.filter)},error:r=>{console.error(r)}}))))),getIncomeStatement:q(A(P(r=>p.getIncomeStatement(r).pipe(Qe(()=>V(t,m=>y(h({},m),{isLoading:!0}))),H({next:m=>{V(t,f=>y(h({},f),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return o}),de({onInit:t=>{t.getLoader()}}));var di=()=>({height:"calc(100vh - 70px)"}),ui=()=>({height:"calc(100vh - 150px)"}),Pe=()=>({}),je=t=>["/pages/chart-of-account/account/",t],Ne=()=>["/pages/report/general-ledger"],qe=t=>({id:t});function _i(t,p){if(t&1){let e=R();n(0,"p-button",10),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function fi(t,p){if(t&1&&(n(0,"div",8),x(1,_i,1,0,"p-button",9),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function gi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function hi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.accountID)),l(),_(C(9,6,e.amount))}}function xi(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total Revenue :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,1,e.store.totalRevenue()))}}function Si(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No revenue records available"),i()()())}function Ci(t,p){if(t&1&&(n(0,"h6",13),a(1,"Revenue"),i(),n(2,"p-table",14),x(3,gi,7,0,"ng-template",null,3,s)(5,hi,10,13,"ng-template",null,4,s)(7,xi,8,3,"ng-template",null,5,s)(9,Si,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.revenue)}}function yi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",25),a(6,"Total"),i()())}function vi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function bi(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total COGS :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()(),n(8,"tr")(9,"td",20)(10,"div",21)(11,"span",22),a(12,"Gross Profit :"),i(),n(13,"span",23),a(14),S(15,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,2,e.store.totalCOGS())),l(8),_(C(15,4,e.store.grossProfit()))}}function Ei(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No COGS records available"),i()()())}function Ii(t,p){if(t&1&&(n(0,"h4",13),a(1,"COGS"),i(),n(2,"p-table",14),x(3,yi,7,0,"ng-template",null,3,s)(5,vi,10,13,"ng-template",null,4,s)(7,bi,16,6,"ng-template",null,5,s)(9,Ei,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.cogs)}}function Fi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th",16),a(4,"Name"),i(),n(5,"th",17),a(6,"Total"),i()())}function Ri(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",17)(7,"a",19),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ne))("queryParams",I(11,qe,e.AccountID)),l(),_(C(9,6,e.amount))}}function Di(t,p){if(t&1&&(n(0,"tr")(1,"td",20)(2,"div",21)(3,"span",22),a(4,"Total Expense :"),i(),n(5,"span",23),a(6),S(7,"number"),i()()()(),n(8,"tr")(9,"td",20)(10,"div",21)(11,"span",22),a(12,"Profit / Loss :"),i(),n(13,"span",23),a(14),S(15,"number"),i()()()()),t&2){let e=d(4);l(6),_(C(7,2,e.store.totalExpense())),l(8),_(C(15,4,e.store.profitOrLoss()))}}function wi(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No expense records available"),i()()())}function Ti(t,p){if(t&1&&(n(0,"h4",13),a(1,"Expense"),i(),n(2,"p-table",14),x(3,Fi,7,0,"ng-template",null,3,s)(5,Ri,10,13,"ng-template",null,4,s)(7,Di,16,6,"ng-template",null,5,s)(9,wi,4,0,"ng-template",null,6,s),i()),t&2){let e,o=d(3);l(2),c("value",(e=o.store.data())==null||e.data==null?null:e.data.expense)}}function Li(t,p){if(t&1&&(n(0,"p-scroll-panel")(1,"div",12),x(2,Ci,11,1)(3,Ii,11,1)(4,Ti,11,1),i()()),t&2){let e,o,r,m=d(2);j(E(5,ui)),l(2),O(m.Object.keys((e=m.store.data().data)!==null&&e!==void 0?e:E(6,Pe)).length>0?2:-1),l(),O(m.Object.keys((o=(o=m.store.data().data)==null?null:o.cogs)!==null&&o!==void 0?o:E(7,Pe)).length>0?3:-1),l(),O(m.Object.keys((r=(r=m.store.data().data)==null?null:r.expense)!==null&&r!==void 0?r:E(8,Pe)).length>0?4:-1)}}function Vi(t,p){if(t&1&&(n(0,"p-panel"),x(1,Li,5,9,"p-scroll-panel",11),i()),t&2){let e=d();j(E(3,di)),l(),c("ngIf",e.store.data())}}function Mi(t,p){if(t&1){let e=R();n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),L(4,"p-multiselect",29),i(),n(5,"div",27)(6,"label",28),a(7,"Cashier"),i(),n(8,"p-autocomplete",30),F("completeMethod",function(r){v(e);let m=d();return b(m.onCashierSearch(r))})("onSelect",function(r){v(e);let m=d();return b(m.onCashierSelect(r))}),i()(),n(9,"div",27)(10,"label",28),a(11,"From"),i(),L(12,"p-datepicker",31),i(),n(13,"div",27)(14,"label",28),a(15,"To"),i(),L(16,"p-datepicker",32),i()()}if(t&2){let e=d();c("formGroup",e.formFilter),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),c("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0)}}var Vt=(()=>{class t{constructor(){this.dayjsService=g(be),this.store=g(Ae),this.fb=g(De),this.reportService=g(B),this.roleService=g(me),this.isInitDialogFilterVisible=T(!1),this.dialogFilterVisible=T(!1),this.cashierSuggestions=T([]),this.cashierHashMap=new Map,this.Object=Object,nt(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(h({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ie("Cashier Suggestions"),M(o=>this.cashierSuggestions.set(o))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),o=Object.entries(e).reduce((r,[m,f])=>(m==="from"||m==="to"?f instanceof Date&&(r[m]=this.dayjsService.from(f).format()):r[m]=f||null,r),{});this.store.updateFilter(h(h({},this.store.filter()),o)),this.dialogFilterVisible.update(r=>!r),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ie("Export Profit & Loss"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`profit-and-loss.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-income-statement"]],features:[K([Ae])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["formControlName","from","styleClass","w-100","appendTo","body"],["formControlName","to","styleClass","w-100","appendTo","body"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",7),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),x(1,fi,2,1,"ng-template",null,0,s)(3,Vi,2,4,"ng-template",null,1,s)(5,Mi,17,8,"ng-template",null,2,s),i()}o&2&&(c("isFilterable",!0)("pageTitle",r.store.data().pageTitle),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Te,xe,he,ne,ee,Q,Z,te,ie,ve,ye,ge,Ce,Se,pe,le,oe,J,X,Ve,Le,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var He=Ue(vt());var ki={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,He.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Ye=ce(_e(ki),se(t=>({totalAsset:w(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:w(()=>t.data().liability.reduce((p,e)=>p+ +e.counterAmount,0)),totalEquity:w(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),ue(t=>{let p=g(B),e={updateFilter:o=>{V(t,r=>y(h({},r),{filter:o}))},fetchBalanceSheet:q(A(Fe(()=>{let o=t.filter();return Object.entries(o).every(([r,m])=>m!=null&&m!=="")}),P(o=>p.getBalanceSheet(o).pipe(H({next:r=>{V(t,m=>y(h({},m),{data:r}))},error:r=>{console.error(r)}}))),Je(1))),fetchLoader:q(A(P(()=>p.getBalanceSheetLoader().pipe(H({next:o=>{V(t,r=>y(h({},r),{metadata:o,filter:{date:(0,He.default)(o.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:o=>{console.error(o)}})))))};return e}),de(t=>({onInit:()=>{t.fetchLoader()}})));var Mt=Ue(vt());var Bi=()=>({height:"calc(100vh - 70px)"}),Oi=()=>({height:"calc(100vh - 100px)"}),We=t=>["/pages/chart-of-account/account/",t],Ke=()=>["/pages/report/general-ledger"],ze=t=>({id:t});function Gi(t,p){if(t&1){let e=R();n(0,"p-button",11),F("onClick",function(){v(e);let r=d(2);return b(r.onExport())}),i()}}function Ai(t,p){if(t&1&&(n(0,"div",9),x(1,Gi,1,0,"p-button",10),i()),t&2){let e=d();l(),c("ngIf",e.roleService.global.export)}}function Pi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Asset"),i(),n(5,"th",17),a(6,"Total"),i()())}function ji(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.amount))}}function Ni(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Asset"),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,1,e.store.totalAsset())," ")}}function qi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),i()()())}function Hi(t,p){if(t&1&&(n(0,"h4",14),a(1,"Asset"),i(),n(2,"p-table",15),x(3,Pi,7,0,"ng-template",null,3,s)(5,ji,10,13,"ng-template",null,4,s)(7,Ni,6,3,"ng-template",null,5,s)(9,qi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function Yi(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Liability"),i(),n(5,"th",17),a(6,"Total"),i()())}function Wi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",25),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Ki(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2," Total Liability "),i(),n(3,"td",22),a(4),S(5,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,1,e.store.totalLiability())," ")}}function zi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),i()()())}function Ui(t,p){if(t&1&&(n(0,"h4",24),a(1,"Liability"),i(),n(2,"p-table",15),x(3,Yi,7,0,"ng-template",null,3,s)(5,Wi,10,13,"ng-template",null,4,s)(7,Ki,6,3,"ng-template",null,5,s)(9,zi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function $i(t,p){t&1&&(n(0,"tr")(1,"th",16),a(2,"Code"),i(),n(3,"th"),a(4,"Equity"),i(),n(5,"th",17),a(6,"Total"),i()())}function Xi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",18),a(5),i()(),n(6,"td",19)(7,"a",20),a(8),S(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",I(8,We,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,Ke))("queryParams",I(11,ze,e.accountID)),l(),_(C(9,6,e.counterAmount))}}function Ji(t,p){if(t&1&&(n(0,"tr")(1,"td",21),a(2,"Total Equity"),i(),n(3,"td",22),a(4),S(5,"number"),i()(),n(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),i(),n(9,"td",22),a(10),S(11,"number"),i()()),t&2){let e=d(3);l(4),D(" ",C(5,2,e.store.totalEquity())," "),l(6),D(" ",C(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Qi(t,p){t&1&&(n(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),i()()())}function Zi(t,p){if(t&1&&(n(0,"h4",24),a(1,"Equity"),i(),n(2,"p-table",15),x(3,$i,7,0,"ng-template",null,3,s)(5,Xi,10,13,"ng-template",null,4,s),a(7," <"),x(8,Ji,12,6,"ng-template",null,5,s)(10,Qi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function en(t,p){if(t&1&&(n(0,"p-panel",12)(1,"p-scroll-panel")(2,"div",13),x(3,Hi,11,1)(4,Ui,11,1)(5,Zi,12,1),i()()()),t&2){let e=d();j(E(8,Bi)),c("showHeader",!1),l(),j(E(9,Oi)),l(2),O(e.Object.keys(e.store.data().asset).length>0?3:-1),l(),O(e.Object.keys(e.store.data().liability).length>0?4:-1),l(),O(e.Object.keys(e.store.data().equity).length>0?5:-1)}}function tn(t,p){if(t&1&&(n(0,"div",31)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function nn(t,p){if(t&1&&(n(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),i(),n(4,"p-multiselect",29),x(5,tn,3,1,"ng-template",null,7,s),i()(),n(7,"div",27)(8,"label",28),a(9,"From"),i(),L(10,"p-datepicker",30),i()()),t&2){let e=d();c("formGroup",e.filterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),c("iconDisplay","input")("showIcon",!0)}}var kt=(()=>{class t{constructor(){this.store=g(Ye),this.ReportServiceStore=g(B),this.dialogFilterVisible=T(!1),this.isInitDialogFilterVisible=T(!1),this.roleService=g(me),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new ct({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:o}=this.filterForm.value;this.store.updateFilter({date:(0,Mt.default)(e).format("YYYY-MM-DD"),listOutletParam:o}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(h({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ie("Export Balance Sheet"),M(o=>{let r=o.type,m=[o],f=document.createElement("a");f.href=window.URL.createObjectURL(new Blob(m,{type:r}));let u=`balance-sheet.${r.split("/")[1]}`;f.setAttribute("download",u),document.body.appendChild(f),f.click(),document.body.removeChild(f)})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-balance-sheet"]],features:[K([Ye])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(o,r){if(o&1){let m=R();n(0,"app-main-panel",8),W("isDialogFilterVisibleChange",function(u){return v(m),N(r.dialogFilterVisible,u)||(r.dialogFilterVisible=u),b(u)})("isInitDialogFilterVisibleChange",function(u){return v(m),N(r.isInitDialogFilterVisible,u)||(r.isInitDialogFilterVisible=u),b(u)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),x(1,Ai,2,1,"ng-template",null,0,s)(3,en,6,10,"ng-template",null,1,s)(5,nn,11,7,"ng-template",null,2,s),i()}o&2&&(c("pageTitle",r.store.data().pageTitle)("isFilterable",!0),Y("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[fe,$,z,U,Ce,Se,ge,ae,re,ne,ee,Q,Z,te,ie,ve,ye,xe,he,we,oe,pe,le,J,X],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Bt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-comparative-balance works!"),i(),a(2,`
2
2
  ,
3
3
  `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ot=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-cash-flow works!"),i(),a(2,`
4
4
  ,
@@ -1 +1 @@
1
- import{a as v,b as H}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as F,b as I}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as G}from"./chunk-UYC454VQ.js";import{b as D,c as N}from"./chunk-C7LM5UCK.js";import{a as O,b as R}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as $}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as P}from"./chunk-B63BKC6F.js";import{Cb as E,Jc as c,Kb as p,Kc as m,Mc as C,Nb as x,Ub as n,V as y,Vb as o,Wb as l,X as b,_b as w,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as d,ra as M,s as u,sa as S,wb as k,yc as B,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function J(i,q){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),M(),n(5,"svg",8),l(6,"path",9),o(),S(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,L)),a(),x(_(13,L)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var le=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f($),this.refresh$=new T(void 0),this.pageTitle="Expense Account"}ngOnInit(){let e=this.refresh$.pipe(b(()=>this.migrateService.getExpenseAccountCount()),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-expense-account"]],features:[B([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(t,r){t&1&&(n(0,"app-main-panel",2),E(1,z,5,6,"ng-template",null,0,C)(3,J,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,P,A,I,F,R,O,N,D,H,j,V],encapsulation:2})}}return i})();export{le as ExpenseAccountComponent};
1
+ import{a as v,b as H}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as F,b as I}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as G}from"./chunk-ZI23MZE6.js";import{b as D,c as N}from"./chunk-C7LM5UCK.js";import{a as O,b as R}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as $}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as P}from"./chunk-B63BKC6F.js";import{Cb as E,Jc as c,Kb as p,Kc as m,Mc as C,Nb as x,Ub as n,V as y,Vb as o,Wb as l,X as b,_b as w,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as d,ra as M,s as u,sa as S,wb as k,yc as B,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function J(i,q){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),M(),n(5,"svg",8),l(6,"path",9),o(),S(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,L)),a(),x(_(13,L)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var le=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f($),this.refresh$=new T(void 0),this.pageTitle="Expense Account"}ngOnInit(){let e=this.refresh$.pipe(b(()=>this.migrateService.getExpenseAccountCount()),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-expense-account"]],features:[B([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(t,r){t&1&&(n(0,"app-main-panel",2),E(1,z,5,6,"ng-template",null,0,C)(3,J,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,P,A,I,F,R,O,N,D,H,j,V],encapsulation:2})}}return i})();export{le as ExpenseAccountComponent};
@@ -1 +1 @@
1
- import{a as C,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as l,Mc as T,Nb as x,Ub as n,V as y,Vb as o,Wb as m,X as M,Z as S,_b as P,dc as h,ec as s,gb as a,h as v,ha as f,pa as g,qa as d,ra as b,s as u,sa as k,wb as B,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),m(3,"app-migration-cards",7),c(4,"async"),b(),n(5,"svg",8),m(6,"path",9),o(),k(),m(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,q)),a(),x(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(C),this.toastr=f(I),this.refresh$=new v(void 0),this.pageTitle="Tax Account"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getTaxAccountCount()),S(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-tax-account"]],features:[w([C])],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(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,T)(3,K,9,14,"ng-template",null,1,T),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as TaxAccountComponent};
1
+ import{a as C,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-ZI23MZE6.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as l,Mc as T,Nb as x,Ub as n,V as y,Vb as o,Wb as m,X as M,Z as S,_b as P,dc as h,ec as s,gb as a,h as v,ha as f,pa as g,qa as d,ra as b,s as u,sa as k,wb as B,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),m(3,"app-migration-cards",7),c(4,"async"),b(),n(5,"svg",8),m(6,"path",9),o(),k(),m(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,q)),a(),x(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(C),this.toastr=f(I),this.refresh$=new v(void 0),this.pageTitle="Tax Account"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getTaxAccountCount()),S(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-tax-account"]],features:[w([C])],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(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,T)(3,K,9,14,"ng-template",null,1,T),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as TaxAccountComponent};