dealposbooks 1.9.6 → 1.9.8

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 (134) hide show
  1. package/3rdpartylicenses.txt +26 -26
  2. package/assets/scss/style.scss +30 -0
  3. package/{chunk-RBDJZRHY.js → chunk-27P5HOS3.js} +1 -1
  4. package/chunk-2QWAAI3V.js +1 -0
  5. package/{chunk-CSMMP7XG.js → chunk-35ER6BC7.js} +1 -1
  6. package/{chunk-BNI5KUDE.js → chunk-3GHEXAAZ.js} +3 -3
  7. package/chunk-3OJSEDLY.js +1 -0
  8. package/{chunk-TC43COAE.js → chunk-3RM5CDGW.js} +1 -1
  9. package/chunk-46XJU64Z.js +1 -0
  10. package/chunk-4MEPU7FI.js +1 -0
  11. package/chunk-4PK4TO7C.js +1 -0
  12. package/{chunk-46TNY5N4.js → chunk-4V5YFD3N.js} +1 -1
  13. package/chunk-5RRPJBLN.js +1 -0
  14. package/chunk-6332DY2I.js +82 -0
  15. package/{chunk-OVCTOPAO.js → chunk-6PS3NJ62.js} +1 -1
  16. package/{chunk-J2SK4PGN.js → chunk-77BBQI2T.js} +1 -1
  17. package/{chunk-PGECEXRR.js → chunk-7ET5CSOO.js} +1 -1
  18. package/{chunk-6ZZARVQO.js → chunk-7IPVVF6Y.js} +1 -1
  19. package/chunk-7JGGV5FX.js +1 -0
  20. package/chunk-7TOJMYLE.js +1 -0
  21. package/chunk-AZWJMXL6.js +449 -0
  22. package/chunk-BDJHC5O6.js +2 -0
  23. package/{chunk-GJXWL5XV.js → chunk-BOVEGMBL.js} +1 -1
  24. package/{chunk-IIB2DZLA.js → chunk-BPFL7VRT.js} +1 -1
  25. package/{chunk-EXVUABTO.js → chunk-BX74ZLQG.js} +1 -1
  26. package/chunk-C3N6HRIE.js +1 -0
  27. package/{chunk-TFV5QZKR.js → chunk-CEZEYAWZ.js} +1 -1
  28. package/chunk-CGUMUBB7.js +1 -0
  29. package/{chunk-OEOAUJY5.js → chunk-CLVUILX2.js} +1 -1
  30. package/{chunk-JDW35ZB5.js → chunk-CNLYDNON.js} +1 -1
  31. package/{chunk-JP3F2QND.js → chunk-CZWWMQFD.js} +1 -1
  32. package/{chunk-BYD3JK4R.js → chunk-DAQCANBV.js} +1 -1
  33. package/{chunk-OZACNHDP.js → chunk-DJAICZNR.js} +1 -1
  34. package/chunk-DXIZC3FM.js +87 -0
  35. package/chunk-EJCLRSB2.js +1 -0
  36. package/{chunk-4S33ZRKF.js → chunk-FTI2QPWV.js} +1 -1
  37. package/{chunk-ASK2IVMC.js → chunk-H6BPUKCW.js} +1 -1
  38. package/{chunk-TK3G2BVM.js → chunk-HFUW7PYZ.js} +1 -1
  39. package/chunk-I3BTHUK3.js +160 -0
  40. package/chunk-IL6G454L.js +1 -0
  41. package/chunk-IY6KCAQ4.js +1 -0
  42. package/{chunk-JMLETF7Y.js → chunk-J6H5UCJR.js} +1 -1
  43. package/{chunk-J77A3DFB.js → chunk-JO3SI6HU.js} +1 -1
  44. package/{chunk-32BR7AQL.js → chunk-JZTK7BS7.js} +1 -1
  45. package/{chunk-P6CJ2ONT.js → chunk-K4ALA724.js} +1 -1
  46. package/{chunk-NF3TF3LT.js → chunk-KANHSSLO.js} +1 -1
  47. package/{chunk-G6FJQBZZ.js → chunk-KHP7E7JG.js} +1 -1
  48. package/chunk-L66QS3IX.js +81 -0
  49. package/chunk-LFVBO7JG.js +1 -0
  50. package/{chunk-YOEPO6LK.js → chunk-LMI4DLB5.js} +1 -1
  51. package/chunk-LRI7YFKN.js +1 -0
  52. package/chunk-MPHC4J2R.js +1 -0
  53. package/chunk-MYLHWS7O.js +1 -0
  54. package/chunk-NHEN24Y3.js +1 -0
  55. package/chunk-NOZEL54G.js +1 -0
  56. package/{chunk-3L7IWFXM.js → chunk-NR3EHEG3.js} +1 -1
  57. package/chunk-ONMFMNUN.js +129 -0
  58. package/chunk-OXGCSUUS.js +2 -0
  59. package/{chunk-LTZA6IIO.js → chunk-PDNXU4MC.js} +1 -1
  60. package/chunk-R6NK3ROE.js +1 -0
  61. package/{chunk-54OPMMIM.js → chunk-R6XNFCQM.js} +1 -1
  62. package/{chunk-HRQJ5DXP.js → chunk-RLR2HFSC.js} +1 -1
  63. package/{chunk-HFFH2WIX.js → chunk-RNOSD5RO.js} +1 -1
  64. package/chunk-RQ52IUQY.js +130 -0
  65. package/{chunk-DOM7WYRM.js → chunk-RSGEQTNJ.js} +1 -1
  66. package/{chunk-35CWG2OK.js → chunk-RYHNURUZ.js} +2 -2
  67. package/{chunk-3DN7TZCI.js → chunk-SH4ALZVS.js} +1 -1
  68. package/chunk-SRNYKRLK.js +1 -0
  69. package/{chunk-3HW557B7.js → chunk-TDMJ2M6W.js} +1 -1
  70. package/{chunk-AKMHO3LC.js → chunk-TIX3GAPF.js} +1 -1
  71. package/{chunk-XKEV5AED.js → chunk-TLLNQB5C.js} +1 -1
  72. package/chunk-TOYTUB2K.js +1 -0
  73. package/chunk-U4SERSDK.js +1 -0
  74. package/{chunk-C5GEP4MM.js → chunk-U75O34AW.js} +1 -1
  75. package/{chunk-I3HFXOYS.js → chunk-UNWDCLFZ.js} +1 -1
  76. package/chunk-UUZOSCEV.js +7 -0
  77. package/chunk-UWWFSGE7.js +1 -0
  78. package/{chunk-6TA77CRR.js → chunk-V4IY7RIP.js} +1 -1
  79. package/chunk-VDBXI7BY.js +1 -0
  80. package/{chunk-RT5PUZ5F.js → chunk-VJLO7GNT.js} +1 -1
  81. package/chunk-VJVWTOYU.js +1 -0
  82. package/{chunk-LKZL77YR.js → chunk-W4KTL6Y6.js} +1 -1
  83. package/{chunk-ZWHB7NI7.js → chunk-W6LBFCQQ.js} +1 -1
  84. package/{chunk-YVEUYFCE.js → chunk-WCXWWANV.js} +5 -5
  85. package/{chunk-34XRAZFC.js → chunk-WUPQR4WU.js} +1 -1
  86. package/{chunk-LR2DJRRL.js → chunk-WWWY3VE7.js} +1 -1
  87. package/chunk-X26YDRRO.js +1 -0
  88. package/chunk-XAH4P23E.js +1 -0
  89. package/{chunk-7WXXPCRV.js → chunk-XYU65DNE.js} +1 -1
  90. package/chunk-YJ3CWPO4.js +1 -0
  91. package/{chunk-3WB76KQC.js → chunk-YVGWGEPX.js} +1 -1
  92. package/{chunk-TQZNJ5WF.js → chunk-Z3SHAW6W.js} +1 -1
  93. package/{chunk-AOSPVPK7.js → chunk-ZHU3HOWQ.js} +1 -1
  94. package/index.html +2 -2
  95. package/{main-U5PC2W2C.js → main-LKLXHNSP.js} +1 -1
  96. package/package.json +1 -1
  97. package/{styles-GTUKYMN7.css → styles-XXVTW56A.css} +1 -1
  98. package/chunk-27SWEVDU.js +0 -1
  99. package/chunk-2DV653RD.js +0 -1
  100. package/chunk-2OECREUZ.js +0 -1
  101. package/chunk-35KDUCM3.js +0 -1
  102. package/chunk-3G3QSUWH.js +0 -1
  103. package/chunk-43WCLYRX.js +0 -1
  104. package/chunk-4FGQ5T64.js +0 -2
  105. package/chunk-4KXSM3HP.js +0 -1
  106. package/chunk-4QKRWFW4.js +0 -1
  107. package/chunk-6HQX2SM2.js +0 -1
  108. package/chunk-B7JILYJO.js +0 -1
  109. package/chunk-BX3CRF44.js +0 -1
  110. package/chunk-C4LZX33Q.js +0 -449
  111. package/chunk-C7UZ6ZYF.js +0 -1
  112. package/chunk-CTCQB63H.js +0 -1
  113. package/chunk-DNK2GUDB.js +0 -1
  114. package/chunk-ELWFWCNU.js +0 -246
  115. package/chunk-GNP7WGSH.js +0 -1
  116. package/chunk-GTGRV7IH.js +0 -1
  117. package/chunk-HRPP75N7.js +0 -1
  118. package/chunk-JYNZPVLW.js +0 -1
  119. package/chunk-K6753MGR.js +0 -7
  120. package/chunk-LD4G6ND6.js +0 -130
  121. package/chunk-M7MFX6BW.js +0 -1
  122. package/chunk-MCDQ2TIS.js +0 -1
  123. package/chunk-MJVSTWYY.js +0 -1
  124. package/chunk-N2RYBZK7.js +0 -1
  125. package/chunk-N6JCA3CN.js +0 -2
  126. package/chunk-OEJBOFI5.js +0 -1
  127. package/chunk-QPKNYNLC.js +0 -210
  128. package/chunk-UEOO2LYA.js +0 -82
  129. package/chunk-WEWEITR7.js +0 -1
  130. package/chunk-WGZN6AN2.js +0 -1
  131. package/chunk-WZO2ZLBL.js +0 -1
  132. package/chunk-X34Y3TVX.js +0 -1
  133. package/chunk-XFSZDZPJ.js +0 -1
  134. package/chunk-XZGFG6E3.js +0 -1
@@ -0,0 +1,7 @@
1
+ import{a as Te,b as Le}from"./chunk-TIX3GAPF.js";import{a as Ct,b as ye}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as Fe}from"./chunk-K4ALA724.js";import{a as St}from"./chunk-NRULEUE7.js";import{b as ht,c as xt}from"./chunk-KANHSSLO.js";import{a as Se,b as Ce}from"./chunk-ZHU3HOWQ.js";import"./chunk-Z3SHAW6W.js";import{b as gt}from"./chunk-VJLO7GNT.js";import"./chunk-DJAICZNR.js";import{a as q,b as H}from"./chunk-CZWWMQFD.js";import{a as ut,b as _t,d as he,k as xe}from"./chunk-CEZEYAWZ.js";import{a as fe,b as ge}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as ft}from"./chunk-YJ3CWPO4.js";import{a as be}from"./chunk-C3N6HRIE.js";import{a as ne,b as De}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import{b as Re}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import{e as ct}from"./chunk-3RM5CDGW.js";import{b as _e}from"./chunk-7IPVVF6Y.js";import{f as dt,h as ue}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as ae,b as le}from"./chunk-CNLYDNON.js";import{a as V,b as pe,c as me,d as ce,e as se,f as de,g as st}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as oe,x as re}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{e as Q,f as X,g as pt,i as G,k as Z,l as ee,o as te,t as mt,v as we,y as ie}from"./chunk-3GHEXAAZ.js";import{a as lt}from"./chunk-R6NK3ROE.js";import{a as at}from"./chunk-TDMJ2M6W.js";import{C as rt,F as $,M as J,f as Ie,k as nt,l as z,m as U,s as ot}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as F,Cb as C,D as Ee,Ga as L,Jc as x,Kb as c,Kc as S,L as $e,Lc as tt,Mc as s,Nb as j,Pb as O,Qb as Me,Sb as ke,Tb as Be,Ub as n,V as Je,Vb as i,W as Qe,Wb as I,X as P,Yc as T,Z as M,Zc as it,_b as D,ba as Xe,c as A,cb as Ze,dc as w,ec as d,gb as l,ha as h,hc as et,pa as v,qa as b,qc as a,rc as _,s as Ue,sc as R,vc as Y,wb as k,wc as N,xc as W,yc as K,zc as E}from"./chunk-WCXWWANV.js";import{a as g,b as y,c as Ve,e as ze}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=h(lt),this.authService=h(Fe)}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 ot({fromObject:Object.fromEntries(Object.entries(e).map(([f,u])=>[f,String(u)]))}),m=g({params:r},o);return this.httpService.get(void 0,"/api/BalanceSheet",m)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,o={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),o)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Xe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ot={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}},Oe=pe(de(Ot),st("General Ledger Store"),me(t=>({debitTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.debitAmount||0),0),0)),creditTotal:T(()=>t.items.data().reduce((p,e)=>p+e.data.reduce((o,r)=>o+(r.creditAmount||0),0),0))})),se(t=>{let p=h(B),e={updateFilter:o=>{V(t,r=>y(g({},r),{filter:o}))},loadList:q(A(Ee(o=>o.listAccountID.length>0),P(o=>p.fetchGeneralLedgerReport(o).pipe(H({next:r=>{V(t,m=>y(g({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:q(A(P(()=>p.fetchGeneralLedgerLoader().pipe(H({next:o=>{V(t,r=>y(g({},r),{metadata:o,filter:y(g({},r.filter),{listCategoryID:o.filter.listCategoryID})})),e.loadList(t.filter)},error:o=>{console.error(o)}})))))};return e}),ce({onInit:t=>{t.loadLoader()}}));var Pt=()=>({height:"calc(100vh - 70px)"}),jt=()=>({height:"calc(100vh - 100px)"}),Nt=t=>["/pages/journal/journal-entry/",t],qt=()=>({scrollHeight:"250px"});function Ht(t,p){if(t&1){let e=D();n(0,"div",11)(1,"a",12),a(2,"Return to Accounts"),i(),n(3,"p-button",13),w("onClick",function(){v(e);let r=d();return b(r.onExport())}),i()()}}function Yt(t,p){if(t&1&&(n(0,"div",11)(1,"span",16)(2,"h2",17),a(3),i()(),n(4,"span",16)(5,"h2",17),a(6),i()()()),t&2){let e=d().$implicit;l(3),_(e.name),l(3),R(" (",e.chartOfAccountCode,") ")}}function Wt(t,p){t&1&&(n(0,"tr")(1,"th",18),a(2,"Outlet"),i(),n(3,"th",18),a(4,"No."),i(),n(5,"th",18),a(6,"Date"),i(),n(7,"th",18),a(8,"Name"),i(),n(9,"th",18),a(10,"Description"),i(),n(11,"th",19),a(12,"Debit"),i(),n(13,"th",20),a(14,"Credit"),i(),n(15,"th",20),a(16,"Balance"),i()())}function Kt(t,p){if(t&1&&(n(0,"td",25),a(1,"Starting Balance"),i(),n(2,"td",26),a(3),x(4,"number"),i()),t&2){let e=d(2).$implicit;l(3),R(" ",S(4,1,e.startBalance)," ")}}function zt(t,p){if(t&1&&(n(0,"tr"),C(1,Kt,5,3),i(),n(2,"tr")(3,"td",21),a(4),i(),n(5,"td",21)(6,"a",22),a(7),i()(),n(8,"td",21),a(9),x(10,"date"),i(),n(11,"td",21)(12,"a",23),a(13),i()(),I(14,"td"),n(15,"td",24),a(16),x(17,"number"),i(),n(18,"td",24),a(19),x(20,"number"),i(),n(21,"td",24),a(22),x(23,"number"),i()()),t&2){let e=p.$implicit,o=p.rowIndex,r=d(4);l(),O(o===0&&r.store.items().data.length>1?1:-1),l(3),_(e.outletName),l(2),c("routerLink",F(19,Nt,e.id)),l(),_(e.number),l(2),_(tt(10,10,e.date,"dd MMM yyyy")),l(3),c("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ze),l(),_(e.contactName),l(3),R(" ",S(17,13,e.debitAmount)," "),l(3),R(" ",S(20,15,e.creditAmount)," "),l(3),_(S(23,17,e.balance))}}function Ut(t,p){if(t&1&&(n(0,"tr"),I(1,"td",27),n(2,"td",28),a(3,"Total"),i(),n(4,"td",28),a(5),x(6,"number"),i(),n(7,"td",28),a(8),x(9,"number"),i(),I(10,"td"),i()),t&2){let e=d().$index,o=d(3);l(5),R(" ",S(6,2,o.store.items().data[e].debitTotal)," "),l(3),R(" ",S(9,4,o.store.items().data[e].creditTotal)," ")}}function $t(t,p){t&1&&(n(0,"tr")(1,"td",29)(2,"span"),a(3,"No records found."),i()()())}function Jt(t,p){if(t&1&&(n(0,"p-table",15),C(1,Yt,7,2,"ng-template",null,3,s)(3,Wt,17,0,"ng-template",null,4,s)(5,zt,24,21,"ng-template",null,5,s)(7,Ut,11,6,"ng-template",null,6,s)(9,$t,4,0,"ng-template",null,7,s),i()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function Qt(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel"),ke(2,Jt,11,2,"p-table",15,Me),i()()),t&2){let e=d(2);j(E(4,Pt)),l(),j(E(5,jt)),l(),Be(e.store.items().data)}}function Xt(t,p){if(t&1&&C(0,Qt,4,6,"p-panel",14),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function Zt(t,p){if(t&1&&(n(0,"div",11)(1,"div",16)(2,"span",41),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",16)(8,"span",42),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ei(t,p){if(t&1&&(n(0,"div",11)(1,"div",16)(2,"span",41),a(3),i()(),n(4,"div")(5,"span"),a(6,"-"),i()(),n(7,"div",16)(8,"span",42),a(9),i()()()),t&2){let e=p.$implicit;l(3),R("(",e.code,")"),l(6),_(e.name)}}function ti(t,p){if(t&1&&(n(0,"div",43)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function ii(t,p){if(t&1&&(n(0,"div",40),I(1,"p-radiobutton",44),n(2,"label",45),a(3),i()()),t&2){let e=p.$implicit;l(),c("value",e.key)("inputId",e.key),l(),et("for",e.key),l(),_(e.value)}}function ni(t,p){if(t&1){let e=D();n(0,"div",31)(1,"label",32),a(2,"Customer"),i(),n(3,"p-autocomplete",46),w("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 oi(t,p){if(t&1){let e=D();n(0,"div",31)(1,"label",32),a(2,"Supplier"),i(),n(3,"p-autocomplete",47),w("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 ri(t,p){if(t&1){let e=D();n(0,"div",31)(1,"label",32),a(2,"Customer"),i(),n(3,"p-autocomplete",46),w("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 ai(t,p){if(t&1){let e=D();n(0,"form",30)(1,"div",31)(2,"label",32),a(3,"Accounts"),i(),n(4,"p-multiselect",33),w("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),C(5,Zt,10,2,"ng-template",null,8,s)(7,ei,10,2,"ng-template",null,9,s),i()(),n(9,"div",31)(10,"label",32),a(11,"From"),i(),I(12,"p-datepicker",34),i(),n(13,"div",31)(14,"label",32),a(15,"To"),i(),I(16,"p-datepicker",35),i(),n(17,"div",31)(18,"label",32),a(19,"Outlets"),i(),n(20,"p-multiselect",36),C(21,ti,3,1,"ng-template",null,9,s),i()(),n(23,"div",31)(24,"label",32),a(25,"Category"),i(),n(26,"p-treeselect",37),w("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),i()(),n(27,"div",31)(28,"label",38),a(29,"Contact Type"),i(),n(30,"div",39),ke(31,ii,4,4,"div",40,Me),i()(),C(33,ni,4,1,"div",31)(34,oi,4,1,"div",31)(35,ri,4,1,"div",31),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,qt))("options",o.categoriesOptions()),l(5),Be(o.store.metadata().options.contactTypeOptions),l(2),O((e=o.generalLedgerFilterForm.controls.contactType.value)===1?33:e===2?34:35)}}var Rt=(()=>{class t{constructor(){this.dialogFilterVisible=L(!1),this.reportService=h(B),this.coaService=h(ft),this.authService=h(Fe),this.store=h(Oe),this.categoriesOptions=L([]),this.customerSuggestions=L([]),this.supplierSuggestions=L([]),this.route=h(rt),this.dayjsService=h(ye),this.initDialogVisible=L(!0),this.fb=h(we),this.toastr=h(at)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe(Ue(e=>e.get("id")),M(e=>{e&&(this.initDialogVisible.update(o=>!o),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(g({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange(),this.generalLedgerFilterForm.valueChanges.pipe($e(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=Ve(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=Ve(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=>{St(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([Oe])],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-download","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=D();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)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),C(1,Ht,4,0,"ng-template",null,0,s)(3,Xt,1,1,"ng-template",null,1,s)(5,ai,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:[ue,U,Ie,z,nt,_e,xe,he,dt,re,oe,Re,ge,fe,Le,Te,ie,Z,Q,X,mt,ee,te,Ce,Se,De,ne,ct,xt,ht,gt,le,ae,J,$,_t,ut],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var li={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Ge=pe(de(li),me(t=>{let p={totalCOGS:T(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalRevenue:T(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),totalExpense:T(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((o,r)=>o+(r?.amount??0),0):0}),grossProfit:T(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:T(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:T(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),se(t=>{let p=h(B),e=h(ye),o={updateFilter(r){V(t,m=>y(g({},m),{filter:g(g({},m.filter),r)}))},getLoader:q(A(P(()=>p.getIncomeStatementLoader().pipe(H({next:r=>{V(t,m=>y(g({},m),{loader:r,filter:y(g({},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(g({},m),{isLoading:!0}))),H({next:m=>{V(t,f=>y(g({},f),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return o}),ce({onInit:t=>{t.getLoader()}}));var pi=()=>({height:"calc(100vh - 70px)"}),mi=()=>({height:"calc(100vh - 150px)"}),Ae=()=>({}),Pe=t=>["/pages/chart-of-account/account/",t],je=()=>["/pages/report/general-ledger"],Ne=t=>({id:t});function ci(t,p){if(t&1){let e=D();n(0,"div",8)(1,"p-button",9),w("onClick",function(){v(e);let r=d();return b(r.onExport())}),i()()}}function si(t,p){t&1&&(n(0,"tr")(1,"th",14),a(2,"Code"),i(),n(3,"th",15),a(4,"Name"),i(),n(5,"th",16),a(6,"Total"),i()())}function di(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",17),a(5),i()(),n(6,"td",16)(7,"a",18),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Pe,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,je))("queryParams",F(11,Ne,e.accountID)),l(),_(S(9,6,e.amount))}}function ui(t,p){if(t&1&&(n(0,"tr"),I(1,"td",19),n(2,"td",20)(3,"div",21)(4,"span",22),a(5,"Total Revenue :"),i(),n(6,"span",23),a(7),x(8,"number"),i()()()()),t&2){let e=d(4);l(7),_(S(8,1,e.store.totalRevenue()))}}function _i(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No revenue records available"),i()()())}function fi(t,p){if(t&1&&(n(0,"h6",12),a(1,"Revenue"),i(),n(2,"p-table",13),C(3,si,7,0,"ng-template",null,3,s)(5,di,10,13,"ng-template",null,4,s)(7,ui,9,3,"ng-template",null,5,s)(9,_i,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 gi(t,p){t&1&&(n(0,"tr")(1,"th",14),a(2,"Code"),i(),n(3,"th",15),a(4,"Name"),i(),n(5,"th",25),a(6,"Total"),i()())}function hi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",17),a(5),i()(),n(6,"td",16)(7,"a",18),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Pe,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,je))("queryParams",F(11,Ne,e.AccountID)),l(),_(S(9,6,e.amount))}}function xi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",26),n(2,"td",20)(3,"div",21)(4,"span",22),a(5,"Total COGS :"),i(),n(6,"span",23),a(7),x(8,"number"),i()()()(),n(9,"tr"),I(10,"td",26),n(11,"td",20)(12,"div",21)(13,"span",22),a(14,"Gross Profit :"),i(),n(15,"span",23),a(16),x(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(S(8,2,e.store.totalCOGS())),l(9),_(S(17,4,e.store.grossProfit()))}}function Si(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No COGS records available"),i()()())}function Ci(t,p){if(t&1&&(n(0,"h4",12),a(1,"COGS"),i(),n(2,"p-table",13),C(3,gi,7,0,"ng-template",null,3,s)(5,hi,10,13,"ng-template",null,4,s)(7,xi,18,6,"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.cogs)}}function yi(t,p){t&1&&(n(0,"tr")(1,"th",14),a(2,"Code"),i(),n(3,"th",15),a(4,"Name"),i(),n(5,"th",16),a(6,"Total"),i()())}function vi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",17),a(5),i()(),n(6,"td",16)(7,"a",18),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Pe,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,je))("queryParams",F(11,Ne,e.AccountID)),l(),_(S(9,6,e.amount))}}function bi(t,p){if(t&1&&(n(0,"tr"),I(1,"td",26),n(2,"td",20)(3,"div",21)(4,"span",22),a(5,"Total Expense :"),i(),n(6,"span",23),a(7),x(8,"number"),i()()()(),n(9,"tr"),I(10,"td",26),n(11,"td",20)(12,"div",21)(13,"span",22),a(14,"Profit / Loss :"),i(),n(15,"span",23),a(16),x(17,"number"),i()()()()),t&2){let e=d(4);l(7),_(S(8,2,e.store.totalExpense())),l(9),_(S(17,4,e.store.profitOrLoss()))}}function Ei(t,p){t&1&&(n(0,"tr")(1,"td",24)(2,"span"),a(3,"No expense records available"),i()()())}function Ii(t,p){if(t&1&&(n(0,"h4",12),a(1,"Expense"),i(),n(2,"p-table",13),C(3,yi,7,0,"ng-template",null,3,s)(5,vi,10,13,"ng-template",null,4,s)(7,bi,18,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.expense)}}function Fi(t,p){if(t&1&&(n(0,"p-scroll-panel")(1,"div",11),C(2,fi,11,1)(3,Ci,11,1)(4,Ii,11,1),i()()),t&2){let e,o,r,m=d(2);j(E(5,mi)),l(2),O(m.Object.keys((e=m.store.data().data)!==null&&e!==void 0?e:E(6,Ae)).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,Ae)).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,Ae)).length>0?4:-1)}}function wi(t,p){if(t&1&&(n(0,"p-panel"),C(1,Fi,5,9,"p-scroll-panel",10),i()),t&2){let e=d();j(E(3,pi)),l(),c("ngIf",e.store.data())}}function Di(t,p){if(t&1){let e=D();n(0,"form",27)(1,"div",28)(2,"label",29),a(3,"Outlet"),i(),I(4,"p-multiselect",30),i(),n(5,"div",28)(6,"label",29),a(7,"Cashier"),i(),n(8,"p-autocomplete",31),w("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",28)(10,"label",29),a(11,"From"),i(),I(12,"p-datepicker",32),i(),n(13,"div",28)(14,"label",29),a(15,"To"),i(),I(16,"p-datepicker",33),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 Tt=(()=>{class t{constructor(){this.dayjsService=h(ye),this.store=h(Ge),this.fb=h(we),this.reportService=h(B),this.isInitDialogFilterVisible=L(!1),this.dialogFilterVisible=L(!1),this.cashierSuggestions=L([]),this.cashierHashMap=new Map,this.Object=Object,it(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(be("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(g(g({},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(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(be("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([Ge])],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"],[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","2 ",1,"fw-semibold","text-end",2,"width","50%"],[1,"text-end","fw-semibold"],[1,"row"],[1,"col-9"],[1,"col"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],["colspan","2",1,"fw-semibold"],[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=D();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)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),C(1,ci,2,0,"ng-template",null,0,s)(3,wi,2,4,"ng-template",null,1,s)(5,Di,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:[ue,U,Ie,z,Re,ge,fe,ie,Z,Q,X,ee,te,Ce,Se,_e,xe,he,le,ae,ne,J,$,Le,Te,re,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var qe=ze(Ct());var Ri={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,qe.default)().format("YYYY-MM-DD"),listOutletParam:[]}},He=pe(de(Ri),me(t=>({totalAsset:T(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:T(()=>t.data().liability.reduce((p,e)=>p+ +e.counterAmount,0)),totalEquity:T(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),se(t=>{let p=h(B),e={updateFilter:o=>{V(t,r=>y(g({},r),{filter:o}))},fetchBalanceSheet:q(A(Ee(()=>{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(g({},m),{data:r}))},error:r=>{console.error(r)}}))),Je(1))),fetchLoader:q(A(P(()=>p.getBalanceSheetLoader().pipe(H({next:o=>{V(t,r=>y(g({},r),{metadata:o,filter:{date:(0,qe.default)(o.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:o=>{console.error(o)}})))))};return e}),ce(t=>({onInit:()=>{t.fetchLoader()}})));var Lt=ze(Ct());var Ti=()=>({height:"calc(100vh - 70px)"}),Li=()=>({height:"calc(100vh - 100px)"}),Ye=t=>["/pages/chart-of-account/account/",t],We=()=>["/pages/report/general-ledger"],Ke=t=>({id:t});function Vi(t,p){if(t&1){let e=D();n(0,"div",9)(1,"p-button",10),w("onClick",function(){v(e);let r=d();return b(r.onExport())}),i()()}}function Mi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th"),a(4,"Asset"),i(),n(5,"th",16),a(6,"Total"),i()())}function ki(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",17),a(5),i()(),n(6,"td",18)(7,"a",19),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Ye,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,We))("queryParams",F(11,Ke,e.accountID)),l(),_(S(9,6,e.amount))}}function Bi(t,p){if(t&1&&(n(0,"tr")(1,"td",20),a(2,"Total Asset"),i(),n(3,"td",21),a(4),x(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",S(5,1,e.store.totalAsset())," ")}}function Oi(t,p){t&1&&(n(0,"tr")(1,"td",22)(2,"span"),a(3,"No asset records found."),i()()())}function Gi(t,p){if(t&1&&(n(0,"h4",13),a(1,"Asset"),i(),n(2,"p-table",14),C(3,Mi,7,0,"ng-template",null,3,s)(5,ki,10,13,"ng-template",null,4,s)(7,Bi,6,3,"ng-template",null,5,s)(9,Oi,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function Ai(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th"),a(4,"Liability"),i(),n(5,"th",16),a(6,"Total"),i()())}function Pi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",24),a(5),i()(),n(6,"td",18)(7,"a",19),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Ye,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,We))("queryParams",F(11,Ke,e.accountID)),l(),_(S(9,6,e.counterAmount))}}function ji(t,p){if(t&1&&(n(0,"tr")(1,"td",20),a(2," Total Liability "),i(),n(3,"td",21),a(4),x(5,"number"),i()()),t&2){let e=d(3);l(4),R(" ",S(5,1,e.store.totalLiability())," ")}}function Ni(t,p){t&1&&(n(0,"tr")(1,"td",22)(2,"span"),a(3,"No liability records found."),i()()())}function qi(t,p){if(t&1&&(n(0,"h4",23),a(1,"Liability"),i(),n(2,"p-table",14),C(3,Ai,7,0,"ng-template",null,3,s)(5,Pi,10,13,"ng-template",null,4,s)(7,ji,6,3,"ng-template",null,5,s)(9,Ni,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function Hi(t,p){t&1&&(n(0,"tr")(1,"th",15),a(2,"Code"),i(),n(3,"th"),a(4,"Equity"),i(),n(5,"th",16),a(6,"Total"),i()())}function Yi(t,p){if(t&1&&(n(0,"tr")(1,"td"),a(2),i(),n(3,"td")(4,"a",17),a(5),i()(),n(6,"td",18)(7,"a",19),a(8),x(9,"number"),i()()()),t&2){let e=p.$implicit;l(2),_(e.code),l(2),c("routerLink",F(8,Ye,e.accountID)),l(),_(e.name),l(2),c("routerLink",E(10,We))("queryParams",F(11,Ke,e.accountID)),l(),_(S(9,6,e.counterAmount))}}function Wi(t,p){if(t&1&&(n(0,"tr")(1,"td",20),a(2,"Total Equity"),i(),n(3,"td",21),a(4),x(5,"number"),i()(),n(6,"tr")(7,"td",20),a(8," Total Liability + Equity "),i(),n(9,"td",21),a(10),x(11,"number"),i()()),t&2){let e=d(3);l(4),R(" ",S(5,2,e.store.totalEquity())," "),l(6),R(" ",S(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Ki(t,p){t&1&&(n(0,"tr")(1,"td",22)(2,"span"),a(3,"No equity records found."),i()()())}function zi(t,p){if(t&1&&(n(0,"h4",23),a(1,"Equity"),i(),n(2,"p-table",14),C(3,Hi,7,0,"ng-template",null,3,s)(5,Yi,10,13,"ng-template",null,4,s),a(7," <"),C(8,Wi,12,6,"ng-template",null,5,s)(10,Ki,4,0,"ng-template",null,6,s),i()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function Ui(t,p){if(t&1&&(n(0,"p-panel",11)(1,"p-scroll-panel")(2,"div",12),C(3,Gi,11,1)(4,qi,11,1)(5,zi,12,1),i()()()),t&2){let e=d();j(E(8,Ti)),c("showHeader",!1),l(),j(E(9,Li)),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 $i(t,p){if(t&1&&(n(0,"div",30)(1,"div"),a(2),i()()),t&2){let e=p.$implicit;l(2),_(e.value)}}function Ji(t,p){if(t&1&&(n(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),i(),n(4,"p-multiselect",28),C(5,$i,3,1,"ng-template",null,7,s),i()(),n(7,"div",26)(8,"label",27),a(9,"From"),i(),I(10,"p-datepicker",29),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 Vt=(()=>{class t{constructor(){this.store=h(He),this.ReportServiceStore=h(B),this.dialogFilterVisible=L(!1),this.isInitDialogFilterVisible=L(!1),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new pt({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:o}=this.filterForm.value;this.store.updateFilter({date:(0,Lt.default)(e).format("YYYY-MM-DD"),listOutletParam:o}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(be("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([He])],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"],[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=D();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)}),w("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),C(1,Vi,2,0,"ng-template",null,0,s)(3,Ui,6,10,"ng-template",null,1,s)(5,Ji,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:[ue,U,z,xe,he,_e,re,oe,ie,Z,Q,X,ee,te,Ce,Se,ge,fe,De,ne,le,ae,J,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Mt=(()=>{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 kt=(()=>{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 Bt=(()=>{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 mr=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Rt},{path:"profit-loss",component:Tt},{path:"balance-sheet",component:Vt},{path:"comparative-balance",component:Mt},{path:"trial-balance",component:Bt},{path:"cash-flow",component:kt}]}];export{mr as REPORTS_ROUTES};
@@ -0,0 +1 @@
1
+ import{a as we}from"./chunk-27P5HOS3.js";import"./chunk-K4ALA724.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-4V5YFD3N.js";import{b as ye,c as Ve,d as Se}from"./chunk-NR3EHEG3.js";import{d as _e,f as ue,g as fe,h as xe,k as ge}from"./chunk-CEZEYAWZ.js";import"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as R}from"./chunk-C3N6HRIE.js";import{a as ie}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as ce,b as de}from"./chunk-7IPVVF6Y.js";import{e as pe,f as me,h as se}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as ae,b as le}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as oe,x as re}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{E as ne,c as X,f as Y,k as Z,l as ee,m as te}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as T,Cb as d,Cc as q,Ga as S,I as N,Jc as E,Kb as m,Kc as I,Lc as G,Mc as c,Nb as A,Pb as h,Qb as F,Sb as P,Tb as D,Ub as n,Vb as i,Wb as _,X as U,Z as w,_b as v,dc as y,eb as j,ec as s,gb as l,ha as k,kc as H,lc as L,m as M,mc as O,pa as f,pc as $,qa as x,qc as r,rc as g,s as B,sc as C,vc as Q,wb as K,wc as W,xc as z,zc as J}from"./chunk-WCXWWANV.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
@@ -1 +1 @@
1
- import{h as p}from"./chunk-YOEPO6LK.js";import{Ab as s,Jb as l,Ob as C,Ub as c,Vb as m,Wb as d,ra as o,ta as a,wb as r}from"./chunk-YVEUYFCE.js";var g=(()=>{class t extends p{static \u0275fac=(()=>{let i;return function(e){return(i||(i=a(t)))(e||t)}})();static \u0275cmp=r({type:t,selectors:[["ChevronRightIcon"]],features:[s],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z","fill","currentColor"]],template:function(n,e){n&1&&(o(),c(0,"svg",0),d(1,"path",1),m()),n&2&&(C(e.getClassNames()),l("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role))},encapsulation:2})}return t})();export{g as a};
1
+ import{h as p}from"./chunk-LMI4DLB5.js";import{Ab as s,Jb as l,Ob as C,Ub as c,Vb as m,Wb as d,ra as o,ta as a,wb as r}from"./chunk-WCXWWANV.js";var g=(()=>{class t extends p{static \u0275fac=(()=>{let i;return function(e){return(i||(i=a(t)))(e||t)}})();static \u0275cmp=r({type:t,selectors:[["ChevronRightIcon"]],features:[s],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z","fill","currentColor"]],template:function(n,e){n&1&&(o(),c(0,"svg",0),d(1,"path",1),m()),n&2&&(C(e.getClassNames()),l("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role))},encapsulation:2})}return t})();export{g as a};
@@ -0,0 +1 @@
1
+ import{a as v,b as A}from"./chunk-CZWWMQFD.js";import{d as V,k as W}from"./chunk-CEZEYAWZ.js";import"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import"./chunk-RNOSD5RO.js";import"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{b as Q}from"./chunk-7IPVVF6Y.js";import{h as J}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as N,b as j}from"./chunk-CNLYDNON.js";import{a as S,b as G,c as K,d as U,e as q,f as $,g as z}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{x as H}from"./chunk-3GHEXAAZ.js";import{a as O}from"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{F as R,M as F,l as I,m as L}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as x,Cb as g,Jc as k,Kb as m,Kc as B,Mc as c,Nb as b,Ub as n,Vb as a,Wb as M,X as u,Yc as D,ba as y,c as f,ec as C,gb as l,ha as p,qc as i,rc as s,sc as T,wb as P,yc as w,zc as _}from"./chunk-WCXWWANV.js";import{a as d,b as h}from"./chunk-YQFG5XE2.js";var X=(()=>{class t{constructor(){this.httpService=p(O)}fetchCashAndBankLoader(){return this.httpService.get("","api/CashAndBankLoader/GetCashAndBank")}fetchCashAndBankData(){return this.httpService.get("","api/CashAndBank/GetCashAndBank")}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var et={data:[],filter:[],options:{hasGeneralLedger:!1}},E=G(z("cash-bank-store"),$(et),K(t=>({totalBalance:D(()=>t.data().reduce((o,e)=>o+e.balance,0))})),q(t=>{let o=p(X);return{loadCashAndBankLoader:v(f(u(()=>o.fetchCashAndBankLoader().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{options:e.options}))},error:e=>{console.log("error",e)}}))))),loadCashAndBankData:v(f(u(()=>o.fetchCashAndBankData().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{data:e}))},error:e=>{console.log("error",e)}})))))}}),U({onInit(t){t.loadCashAndBankLoader(),t.loadCashAndBankData()}}));var nt=["class","page"],at=()=>({height:"calc(100vh - 70px)"}),ot=t=>[t],it=()=>["/pages/report/general-ledger"],rt=t=>({id:t});function lt(t,o){t&1&&(n(0,"tr")(1,"th"),i(2,"Code"),a(),n(3,"th"),i(4,"Name"),a(),n(5,"th",7),i(6,"Balance"),a()())}function pt(t,o){if(t&1&&(n(0,"tr")(1,"td"),i(2),a(),n(3,"td")(4,"a",8),i(5),a()(),n(6,"td",7)(7,"a",9),i(8),k(9,"number"),a()()()),t&2){let e=o.$implicit;l(2),s(e.code),l(2),m("routerLink",x(8,ot,"/pages/chart-of-account/account/"+e.accountID)),l(),s(e.name),l(2),m("routerLink",_(10,it))("queryParams",x(11,rt,e.accountID)),l(),s(B(9,6,e.balance))}}function ct(t,o){if(t&1&&(n(0,"tr"),M(1,"td"),n(2,"td",10),i(3,"Total"),a(),n(4,"td",11),i(5),k(6,"number"),a()()),t&2){let e=C(2);l(5),T(" ",B(6,1,e.store.totalBalance())," ")}}function mt(t,o){t&1&&(n(0,"tr")(1,"td",12)(2,"span"),i(3,"No records found."),a()()())}function st(t,o){if(t&1&&(n(0,"p-panel")(1,"p-table",6),g(2,lt,7,0,"ng-template",null,1,c)(4,pt,10,13,"ng-template",null,2,c)(6,ct,7,3,"ng-template",null,3,c)(8,mt,4,0,"ng-template",null,4,c),a()()),t&2){let e=C();b(_(4,at)),l(),m("value",e.store.data())("scrollHeight","calc(100vh - 100px)")}}var Y=(()=>{class t{constructor(){this.store=p(E),this.routeInfo=Z}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-cash-bank",8,"page"]],features:[w([E])],attrs:nt,decls:3,vars:0,consts:[["content",""],["header",""],["body",""],["footer",""],["emptymessage",""],["pageTitle","Cash and Bank"],["scrollable","",3,"value","scrollHeight"],[1,"text-end"],[1,"link","link-primary",3,"routerLink"],[1,"link","link-primary",3,"routerLink","queryParams"],[1,"fw-bold"],[1,"text-end","fw-bold"],["colspan","3"]],template:function(r,dt){r&1&&(n(0,"app-main-panel",5),g(1,st,10,5,"ng-template",null,0,c),a())},dependencies:[L,I,J,H,W,V,Q,F,R,j,N],styles:[".card[_ngcontent-%COMP%]{height:calc(100vh - 120px)}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:inherit;overflow-y:auto}"],changeDetection:0})}}return t})();var qt=[{path:"",component:Y,children:[]}],Z={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[]};export{qt as CASH_BANK_ROUTES,Z as CASH_BANK_ROUTE_PAGE};
@@ -1,4 +1,4 @@
1
- import{a as U,r as H}from"./chunk-YOEPO6LK.js";import{Ma as q,Na as w,Va as P,a as G}from"./chunk-BNI5KUDE.js";import{c as N,g as j,h as R,m as z}from"./chunk-BYD3JK4R.js";import{Ab as M,Cb as m,Jb as g,Kb as s,Nb as F,Ob as E,Pb as I,Ub as h,Uc as p,Vb as f,Vc as x,Zb as L,_b as O,aa as v,ba as $,ca as C,dc as y,ec as A,gb as a,ha as _,ic as k,jc as B,kc as d,lc as u,pa as r,qa as c,ta as b,wb as S,xb as V,xc as D,za as T,zc as Q}from"./chunk-YVEUYFCE.js";var Y=["handle"],Z=["input"],ee=e=>({checked:e});function te(e,K){e&1&&L(0)}function ie(e,K){if(e&1&&m(0,te,1,0,"ng-container",4),e&2){let i=A();s("ngTemplateOutlet",i.handleTemplate||i._handleTemplate)("ngTemplateOutletContext",Q(2,ee,i.checked()))}}var oe=({dt:e})=>`
1
+ import{a as U,r as H}from"./chunk-LMI4DLB5.js";import{Ma as q,Na as w,Va as P,a as G}from"./chunk-3GHEXAAZ.js";import{c as N,g as j,h as R,m as z}from"./chunk-DAQCANBV.js";import{Ab as M,Ac as Q,Cb as m,Jb as g,Kb as s,Nb as F,Ob as E,Pb as I,Ub as h,Vb as f,Vc as p,Wc as x,Zb as L,_b as O,aa as v,ba as $,ca as C,dc as y,ec as A,gb as a,ha as _,jc as k,kc as B,lc as d,mc as u,pa as r,qa as c,ta as b,wb as S,xb as V,yc as D,za as T}from"./chunk-WCXWWANV.js";var Y=["handle"],Z=["input"],ee=e=>({checked:e});function te(e,K){e&1&&L(0)}function ie(e,K){if(e&1&&m(0,te,1,0,"ng-container",4),e&2){let i=A();s("ngTemplateOutlet",i.handleTemplate||i._handleTemplate)("ngTemplateOutletContext",Q(2,ee,i.checked()))}}var oe=({dt:e})=>`
2
2
  .p-toggleswitch {
3
3
  display: inline-block;
4
4
  width: ${e("toggleswitch.width")};
@@ -0,0 +1 @@
1
+ import{a as A}from"./chunk-R6XNFCQM.js";import{a as Ue}from"./chunk-G4XX7EU2.js";import{a as Oe,b as Be}from"./chunk-TIX3GAPF.js";import{a as He}from"./chunk-RLR2HFSC.js";import{b as V}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as ae}from"./chunk-K4ALA724.js";import"./chunk-Z3SHAW6W.js";import{a as ze}from"./chunk-DCKLQNGL.js";import"./chunk-DJAICZNR.js";import{a as z,b as H}from"./chunk-CZWWMQFD.js";import{d as ke,i as Me,j as Pe,k as je}from"./chunk-CEZEYAWZ.js";import{a as Ae,b as De}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import"./chunk-RNOSD5RO.js";import{a as Je,b as Ne}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{g as Fe,h as Ve}from"./chunk-RYHNURUZ.js";import{b as Ee,c as Te}from"./chunk-BX74ZLQG.js";import{a as be,b as Se}from"./chunk-CNLYDNON.js";import{a as v,b as we,c as ve,d as ye,e as Re,f as Ie}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{n as ge,o as he,w as xe,x as Ce}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{b as le,c as me,e as pe,f as se,k as ce,l as de,o as ue,v as fe,y as _e}from"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{c as ee,e as te,f as ie,i as ne,k as oe,m as re}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ab as W,Ac as T,Cb as g,Ga as k,Jc as I,Kb as c,Kc as Z,Lc as F,Mc as w,Nb as $,Ub as r,Vb as o,Wb as b,X as N,Yc as E,Z as U,_b as y,bb as L,c as D,cb as G,dc as R,ec as _,gb as m,ha as C,pa as h,qa as x,qc as p,rc as S,s as J,sc as M,uc as q,vc as Q,wb as K,wc as P,xc as X,yc as Y,zc as j}from"./chunk-WCXWWANV.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var Qe={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}},O=we(Ie(Qe),ve(t=>({first:E(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:E(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:E(()=>t.data().data.some(a=>a.checked)),checkedARCollection:E(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Re(t=>{let a=C(A),e=C(V);return{updateFilter(n){v(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let u=i.data.data.map(s=>s.id===n.id?f(d({},s),{checked:!0}):s);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){v(t,i=>{let u=i.data.data.map(s=>s.id===n.id?f(d({},s),{checked:!1}):s);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){v(t,i=>{let u=i.data.data.map(s=>f(d({},s),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(D(N(()=>a.getARJournalLoader().pipe(H({next:n=>{v(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(D(J(n=>Object.entries(n).reduce((i,[u,s])=>(s!=null&&(i[u]=s),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),H({next:i=>{v(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ye(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var Xe=()=>({height:"calc(100vh - 70px)"}),B=t=>({"ng-invalid ng-dirty":t}),Ye=()=>({});function Ze(t,a){if(t&1){let e=y();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function et(t,a){if(t&1&&g(0,Ze,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function tt(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),p(4,"Outlet"),o(),r(5,"th",14),p(6,"Number"),o(),r(7,"th",15),p(8,"Customer"),o(),r(9,"th",16),p(10,"Date"),o(),r(11,"th",16),p(12,"Due"),o(),r(13,"th",15),p(14,"Note"),o(),r(15,"th",17),p(16,"Payment"),o(),b(17,"th",12),o())}function it(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",18),o(),r(3,"td"),p(4),o(),r(5,"td")(6,"a",19),p(7),o()(),r(8,"td"),p(9),o(),r(10,"td"),p(11),I(12,"date"),o(),r(13,"td"),p(14),I(15,"date"),o(),r(16,"td"),b(17,"div",20),o(),r(18,"td"),p(19),o(),r(20,"td"),b(21,"p-button",21),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,G),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(F(12,12,e.date,"d MMM y")),m(3),S(e.due?F(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,L),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function nt(t,a){if(t&1&&p(0),t&2){let e=_(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ot(t,a){t&1&&(r(0,"tr")(1,"td",22)(2,"span"),p(3,"No records found."),o()()())}function rt(t,a){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,tt,18,0,"ng-template",null,3,w)(4,it,22,18,"ng-template",null,4,w)(6,nt,1,3,"ng-template",null,5,w)(8,ot,4,0,"ng-template",null,6,w),o()()}if(t&2){let e=_();$(j(9,Xe)),m(),c("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function at(t,a){if(t&1&&(r(0,"span",32),p(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",F(2,2,e.name,30)," ")}}function lt(t,a){if(t&1&&(r(0,"div")(1,"span",34),p(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function mt(t,a){if(t&1&&(r(0,"div"),g(1,lt,3,1,"div",33),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function pt(t,a){if(t&1&&(r(0,"div")(1,"span",34),p(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function st(t,a){if(t&1&&(r(0,"div"),g(1,pt,3,1,"div",33),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function ct(t,a){if(t&1&&(r(0,"div")(1,"span",34),p(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function dt(t,a){if(t&1&&(r(0,"div"),g(1,ct,3,1,"div",33),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function ut(t,a){if(t&1){let e=y();r(0,"form",23)(1,"div",24)(2,"label",25),p(3,"Outlet"),o(),r(4,"p-select",26),g(5,at,3,5,"ng-template",null,7,w),o()(),r(7,"div",24)(8,"label",25),p(9,"From"),o(),b(10,"p-datepicker",27),g(11,mt,2,1,"div",28),o(),r(12,"div",24)(13,"label",25),p(14,"To"),o(),b(15,"p-datepicker",29),g(16,st,2,1,"div",28),o(),r(17,"div",24)(18,"label",25),p(19,"Customer"),o(),r(20,"p-autocomplete",30),I(21,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(22,"div",24)(23,"label",25),p(24,"Page Size"),o(),b(25,"input",31),g(26,dt,2,1,"div",28),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(6),c("iconDisplay","input")("showIcon",!0)("ngClass",T(17,B,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(4),c("iconDisplay","input")("showIcon",!0)("ngClass",T(19,B,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",Z(21,15,e.customerSuggestions$)),m(5),c("autoNumeric",j(21,Ye))("ngClass",T(22,B,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var ni=(()=>{class t extends ze{constructor(){super(),this.store=C(O),this.generateJournalService=C(A),this.authService=C(ae),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(fe),this.dayjsService=C(V)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,rowCount:u,pageSize:s,export:Le,exportPageNumber:Ge,exportRowCount:Ke,outletName:We,customerID:$e,paymentState:qe}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),rowCount:this.fb.control(u),pageSize:this.fb.control(s,[me.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ge),exportRowCount:this.fb.control(Ke),outletName:this.fb.control(We),customerID:this.fb.control($e),paymentState:this.fb.control(qe)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=Ue);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(U(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-ar-journal"]],features:[Y([O]),W],decls:8,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AR Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","4rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=y();r(0,"app-main-panel",8),X("isDialogFilterVisibleChange",function(s){return h(i),P(n.isDialogFilterVisible,s)||(n.isDialogFilterVisible=s),x(s)})("isInitDialogFilterVisibleChange",function(s){return h(i),P(n.isInitDialogFilterVisible,s)||(n.isInitDialogFilterVisible=s),x(s)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(s){return h(i),x(n.onSearch(s))}),g(1,et,1,1,"ng-template",null,0,w)(3,rt,10,10,"ng-template",null,1,w),p(5," <"),g(6,ut,27,24,"ng-template",null,2,w),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Ve,re,ee,te,ie,ne,oe,je,ke,Me,Pe,Ce,xe,Se,be,_e,ce,le,pe,se,de,ue,Ne,Je,De,Ae,Be,Oe,he,ge,Fe,Te,Ee,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ni as ARJournalComponent};
@@ -1,4 +1,4 @@
1
- import{a as J}from"./chunk-YOEPO6LK.js";import{A as d,C as f,Ea as K,Ma as Z,Na as B,Va as G,W as O}from"./chunk-BNI5KUDE.js";import{c as $,g as q,h as W,m as N,n as j}from"./chunk-BYD3JK4R.js";import{Aa as k,Ab as X,Cb as Y,Jb as m,Kb as V,Ob as x,Pb as P,Ub as v,Vb as g,Vc as U,Zb as z,_b as R,ba as S,ca as E,dc as y,fc as I,gb as u,gc as H,ha as _,ic as L,jc as b,kc as h,lc as p,pa as s,qa as a,ta as C,wb as F,xb as A,xc as Q}from"./chunk-YVEUYFCE.js";var ee=["content"],oe=["container"],re=["xBar"],le=["yBar"],se=["*"];function ae(i,ie){i&1&&H(0)}function ce(i,ie){i&1&&z(0)}var ue=({dt:i})=>`
1
+ import{a as J}from"./chunk-LMI4DLB5.js";import{A as d,C as f,Ea as K,Ma as Z,Na as B,Va as G,W as O}from"./chunk-3GHEXAAZ.js";import{c as $,g as q,h as W,m as N,n as j}from"./chunk-DAQCANBV.js";import{Aa as k,Ab as X,Cb as Y,Jb as m,Kb as V,Ob as x,Pb as P,Ub as v,Vb as g,Wc as U,Zb as z,_b as R,ba as S,ca as E,dc as y,fc as I,gb as u,gc as H,ha as _,jc as L,kc as b,lc as h,mc as p,pa as s,qa as a,ta as C,wb as F,xb as A,yc as Q}from"./chunk-WCXWWANV.js";var ee=["content"],oe=["container"],re=["xBar"],le=["yBar"],se=["*"];function ae(i,ie){i&1&&H(0)}function ce(i,ie){i&1&&z(0)}var ue=({dt:i})=>`
2
2
  .p-scrollpanel-content-container {
3
3
  overflow: hidden;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{Wc as t,Yc as d,ha as u,i as s,na as i,va as c,wa as a}from"./chunk-YVEUYFCE.js";function v(l,n){!n?.injector&&i(v);let r=n?.injector??u(c),e=new s(1),b=d(()=>{let o;try{o=l()}catch(f){t(()=>e.error(f));return}t(()=>e.next(o))},{injector:r,manualCleanup:!0});return r.get(a).onDestroy(()=>{b.destroy(),e.complete()}),e.asObservable()}export{v as a};
1
+ import{Xc as t,Zc as d,ha as u,i as s,na as i,va as c,wa as a}from"./chunk-WCXWWANV.js";function v(l,n){!n?.injector&&i(v);let r=n?.injector??u(c),e=new s(1),b=d(()=>{let o;try{o=l()}catch(f){t(()=>e.error(f));return}t(()=>e.next(o))},{injector:r,manualCleanup:!0});return r.get(a).onDestroy(()=>{b.destroy(),e.complete()}),e.asObservable()}export{v as a};