dealposbooks 5.33.1 → 5.33.2

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 (30) hide show
  1. package/{chunk-IQ6VG3YL.js → chunk-2PDTOOPI.js} +1 -1
  2. package/{chunk-O2ZSYZMM.js → chunk-2WBUZJAU.js} +1 -1
  3. package/{chunk-CI2PQN6B.js → chunk-452RR3Q5.js} +1 -1
  4. package/{chunk-TYIRHEAK.js → chunk-4BWEZFB4.js} +1 -1
  5. package/{chunk-VDDGE5HW.js → chunk-5R5OXGVI.js} +1 -1
  6. package/{chunk-S5LYGYPM.js → chunk-62S343UQ.js} +1 -1
  7. package/{chunk-GJTECHST.js → chunk-7MHKOL2S.js} +1 -1
  8. package/{chunk-XHUJABH3.js → chunk-GY4LV6HX.js} +1 -1
  9. package/{chunk-FDTB3ERA.js → chunk-GYKMLBSE.js} +1 -1
  10. package/{chunk-IBUJP2RH.js → chunk-HD2SASNC.js} +1 -1
  11. package/{chunk-NKV2CQXX.js → chunk-HNPBGZU4.js} +1 -1
  12. package/{chunk-SCNZ5AYG.js → chunk-JMFWGTOZ.js} +1 -1
  13. package/{chunk-B3PT57AE.js → chunk-JT7FHN7T.js} +1 -1
  14. package/{chunk-KPAVEB7H.js → chunk-LRQ6Z4ZX.js} +1 -1
  15. package/{chunk-3CO4TF6P.js → chunk-N7OV4C3V.js} +1 -1
  16. package/chunk-NI56PZU2.js +1 -0
  17. package/{chunk-U5M4TYR3.js → chunk-OLUQUWUK.js} +1 -1
  18. package/{chunk-7GKCOHDX.js → chunk-Q25US4N2.js} +1 -1
  19. package/{chunk-JZM3B2LL.js → chunk-RPZIOMLU.js} +1 -1
  20. package/{chunk-7M7NEFRU.js → chunk-RVEUNKOZ.js} +1 -1
  21. package/{chunk-NGY7QDWS.js → chunk-SHEVSJ34.js} +1 -1
  22. package/{chunk-QK4W3BGY.js → chunk-U2WKXQQF.js} +1 -1
  23. package/chunk-VXM4FDHN.js +7 -0
  24. package/{chunk-F22SO6BQ.js → chunk-WTBARN66.js} +1 -1
  25. package/{chunk-FA5SZDUK.js → chunk-Y6H6VNCN.js} +1 -1
  26. package/index.html +2 -2
  27. package/{main-2G5QRDWJ.js → main-GHHA6Y2C.js} +1 -1
  28. package/package.json +1 -1
  29. package/chunk-J4Z57NEI.js +0 -1
  30. package/chunk-PKLV4S5S.js +0 -7
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"dealposbooks","version":"5.33.1"}
1
+ {"name":"dealposbooks","version":"5.33.2"}
package/chunk-J4Z57NEI.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-JZM3B2LL.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-QK4W3BGY.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-U5M4TYR3.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-7M7NEFRU.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-7GKCOHDX.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-KPAVEB7H.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-VDDGE5HW.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-3CO4TF6P.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-NGY7QDWS.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
package/chunk-PKLV4S5S.js DELETED
@@ -1,7 +0,0 @@
1
- import{a as Le,b as Ve}from"./chunk-HHJMN4BS.js";import{a as vt,b as be}from"./chunk-IQ6VG3YL.js";import"./chunk-FA5SZDUK.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-AWXT2WGR.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":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),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
- ,
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
- ,
5
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Gt=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(o,r){o&1&&(n(0,"p"),a(1,"report-trial-balance works!"),i(),a(2,`
6
- ,
7
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var xr=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Lt},{path:"profit-loss",component:Vt},{path:"balance-sheet",component:kt},{path:"comparative-balance",component:Bt},{path:"trial-balance",component:Gt},{path:"cash-flow",component:Ot}]}];export{xr as REPORTS_ROUTES};