dealposbooks 5.37.0 → 5.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/3rdpartylicenses.txt +26 -26
  2. package/chunk-2AMMZHXQ.js +1 -0
  3. package/{chunk-NA4MKIZU.js → chunk-2TOKALFG.js} +1 -1
  4. package/{chunk-PW4323VJ.js → chunk-4TW5N3R5.js} +1 -1
  5. package/{chunk-RFVPTZXE.js → chunk-4V6IW37R.js} +1 -1
  6. package/{chunk-HY2XAZAH.js → chunk-5AD3KAHO.js} +1 -1
  7. package/{chunk-DE2473W5.js → chunk-5B3BG43K.js} +1 -1
  8. package/{chunk-CIAGHK5E.js → chunk-5YZ63KSK.js} +1 -1
  9. package/{chunk-NU5466MQ.js → chunk-5ZZHL43J.js} +1 -1
  10. package/{chunk-MKHLXGRK.js → chunk-64BNX23H.js} +1 -1
  11. package/{chunk-3ZQVIJMU.js → chunk-64ODJHGP.js} +1 -1
  12. package/chunk-6OQBIS63.js +1 -0
  13. package/{chunk-QURNJXUA.js → chunk-6WODKZWN.js} +1 -1
  14. package/{chunk-5ZHMTEH2.js → chunk-76AI32N3.js} +1 -1
  15. package/{chunk-C2YOJOPY.js → chunk-76QGHXHT.js} +1 -1
  16. package/chunk-7CUSFSFC.js +1 -0
  17. package/chunk-7IC4BZ6J.js +7 -0
  18. package/chunk-7U7SHAIK.js +160 -0
  19. package/{chunk-XSOIDS3T.js → chunk-7UB4B7A7.js} +1 -1
  20. package/chunk-7VGK2GTV.js +1 -0
  21. package/{chunk-BPQN4YWQ.js → chunk-A256BFGM.js} +1 -1
  22. package/{chunk-4XCMTFFH.js → chunk-A7LRQMLA.js} +1 -1
  23. package/{chunk-5O73U6P7.js → chunk-AE7ZMPUT.js} +1 -1
  24. package/{chunk-52KGCI4Z.js → chunk-B5RBLDGE.js} +1 -1
  25. package/{chunk-6T64IBSG.js → chunk-BPNHJZKZ.js} +1 -1
  26. package/{chunk-SW4SZC2K.js → chunk-BRCJWPEZ.js} +1 -1
  27. package/{chunk-6WHZBKFW.js → chunk-BSFKUGYO.js} +1 -1
  28. package/{chunk-KOOYDMFN.js → chunk-C4C5DIN2.js} +1 -1
  29. package/{chunk-M3QTXO6B.js → chunk-CDXFHUDN.js} +1 -1
  30. package/{chunk-O74X6MMZ.js → chunk-CTKWFS7F.js} +1 -1
  31. package/{chunk-47CQRQIP.js → chunk-DKXXL4X2.js} +1 -1
  32. package/{chunk-GFOJNJA4.js → chunk-DOKG43W6.js} +1 -1
  33. package/{chunk-GC5XCOU5.js → chunk-DUEYD2IO.js} +1 -1
  34. package/{chunk-U63X7T6B.js → chunk-E34SEVZS.js} +1 -1
  35. package/{chunk-D36YVGIB.js → chunk-EALZUKSJ.js} +1 -1
  36. package/chunk-ECNRIDLC.js +1 -0
  37. package/{chunk-53IBQLYQ.js → chunk-ENOCDIVK.js} +2 -2
  38. package/chunk-ENZMSDHX.js +129 -0
  39. package/{chunk-WA6V7JTY.js → chunk-GLOECGB7.js} +1 -1
  40. package/{chunk-LINWFXJ3.js → chunk-H4KAOKJR.js} +1 -1
  41. package/chunk-HMSYKSI6.js +7 -0
  42. package/{chunk-BPEU23J5.js → chunk-I4WD74I3.js} +1 -1
  43. package/chunk-I5YQOGRZ.js +1 -0
  44. package/{chunk-UC564LFH.js → chunk-IGWW72HN.js} +1 -1
  45. package/chunk-IQRU2J36.js +1 -0
  46. package/chunk-ISQYSQRX.js +1 -0
  47. package/{chunk-E4CGQOU2.js → chunk-IXOM3GPT.js} +2 -2
  48. package/{chunk-ITHIPR7R.js → chunk-JYELXDHY.js} +1 -1
  49. package/{chunk-5PURHPFH.js → chunk-KEMY45CH.js} +1 -1
  50. package/{chunk-TXK2JSMZ.js → chunk-KIFK2NRF.js} +1 -1
  51. package/{chunk-4TQOJBQI.js → chunk-KKZF4RQM.js} +1 -1
  52. package/{chunk-LLPDH7S2.js → chunk-LNN3TWH2.js} +1 -1
  53. package/{chunk-ZHINPNBR.js → chunk-MASZROSE.js} +1 -1
  54. package/{chunk-DGTLYGTT.js → chunk-MDNCQKUT.js} +1 -1
  55. package/{chunk-LVCF2WZK.js → chunk-MS6ARTHK.js} +1 -1
  56. package/{chunk-WX27CT5F.js → chunk-MUFRLGLG.js} +1 -1
  57. package/{chunk-J7WAS2GN.js → chunk-MWMAH2KO.js} +1 -1
  58. package/{chunk-76YIDIBJ.js → chunk-N5W3C4LG.js} +1 -1
  59. package/{chunk-FTFZVOHA.js → chunk-NHXCR55X.js} +1 -1
  60. package/{chunk-FKPQJ7WA.js → chunk-NI4XE6XQ.js} +1 -1
  61. package/{chunk-J3DB5YKJ.js → chunk-NTCCFR6P.js} +1 -1
  62. package/{chunk-AIUDSJBN.js → chunk-NTTAMN4Q.js} +1 -1
  63. package/chunk-NU6SYZAJ.js +1 -0
  64. package/{chunk-R4A7YDIK.js → chunk-OPTFBHGE.js} +1 -1
  65. package/{chunk-HQVGMXBL.js → chunk-OXAHPW2L.js} +1 -1
  66. package/{chunk-NNNW5RBV.js → chunk-P6CXZZTO.js} +1 -1
  67. package/{chunk-PEETBOXD.js → chunk-PQSFZ3JI.js} +1 -1
  68. package/{chunk-UIVUT5SZ.js → chunk-PS4MFIBX.js} +1 -1
  69. package/{chunk-2N5X42BK.js → chunk-PTEBSIFB.js} +1 -1
  70. package/{chunk-YGTWGZKQ.js → chunk-PWPKBPEC.js} +1 -1
  71. package/{chunk-QLLOZ2EX.js → chunk-R3JWL2J6.js} +1 -1
  72. package/{chunk-7FYHB5GM.js → chunk-RNPNKSFR.js} +1 -1
  73. package/{chunk-WH54KYS2.js → chunk-RWTIBNIV.js} +2 -2
  74. package/{chunk-U2ZDSR5F.js → chunk-RZI2OI6V.js} +1 -1
  75. package/{chunk-UR7ARZNH.js → chunk-S2Q6V4IV.js} +1 -1
  76. package/{chunk-MH6BKDDC.js → chunk-SUBNNB3F.js} +1 -1
  77. package/{chunk-Q2WT6OSY.js → chunk-T4TFJFL4.js} +1 -1
  78. package/{chunk-IRBPX3RE.js → chunk-TAJINBQY.js} +1 -1
  79. package/{chunk-YK5QR3KS.js → chunk-TKBMWC2X.js} +1 -1
  80. package/{chunk-DKORHYIR.js → chunk-TWSGVX4G.js} +1 -1
  81. package/chunk-TYG6AINI.js +1 -0
  82. package/{chunk-3PRXAPAT.js → chunk-UA264VBG.js} +1 -1
  83. package/{chunk-HK6C7EEJ.js → chunk-UTG7WNU7.js} +1 -1
  84. package/{chunk-5JHWAF7R.js → chunk-UVIJU7TM.js} +1 -1
  85. package/{chunk-3CUYHDDG.js → chunk-V6VS3FMZ.js} +1 -1
  86. package/{chunk-Q4TUK2EO.js → chunk-VDXMHX3J.js} +1 -1
  87. package/{chunk-PBVHXSHH.js → chunk-VU532YE3.js} +2 -2
  88. package/{chunk-NIT7TJ5P.js → chunk-W6IKDXXT.js} +1 -1
  89. package/{chunk-J6SZIJEO.js → chunk-W7Q3NWBG.js} +1 -1
  90. package/{chunk-DYSMAYNT.js → chunk-WNA57NZF.js} +1 -1
  91. package/chunk-WPMY4QOF.js +1 -0
  92. package/{chunk-PGXO6FU3.js → chunk-WZXOEZ5J.js} +1 -1
  93. package/{chunk-AMMK4U54.js → chunk-X3JXYOSR.js} +1 -1
  94. package/{chunk-3OWUTEG2.js → chunk-XAGCP2AA.js} +1 -1
  95. package/{chunk-PAOPYGNU.js → chunk-Y52DQWVS.js} +1 -1
  96. package/{chunk-GRIGOPOO.js → chunk-YO2YHPV5.js} +1 -1
  97. package/{chunk-CEN7UP6Q.js → chunk-YS5U5SXP.js} +1 -1
  98. package/{chunk-LZSOBSQV.js → chunk-ZA6OJTWT.js} +1 -1
  99. package/{chunk-B5GNFDMG.js → chunk-ZBVMLQ5Q.js} +1 -1
  100. package/{chunk-4GUP7433.js → chunk-ZGVGNFVA.js} +1 -1
  101. package/{chunk-WAVSEPCG.js → chunk-ZUBQV3YF.js} +1 -1
  102. package/{chunk-65OCC4LR.js → chunk-ZVRETQOI.js} +1 -1
  103. package/index.html +3 -3
  104. package/{main-4IGHB4KX.js → main-KU6QKT2F.js} +1 -1
  105. package/package.json +1 -1
  106. package/{styles-ERZ5377A.css → styles-6G3XMEOP.css} +1 -1
  107. package/chunk-2EIZ76HE.js +0 -1
  108. package/chunk-3EH6PALU.js +0 -1
  109. package/chunk-7WAZPKOK.js +0 -1
  110. package/chunk-C7CIUOM5.js +0 -1
  111. package/chunk-D4VGEGUS.js +0 -7
  112. package/chunk-FWT56GXG.js +0 -1
  113. package/chunk-JPAZOYCQ.js +0 -129
  114. package/chunk-KEW6IMWJ.js +0 -7
  115. package/chunk-LEE5F54T.js +0 -1
  116. package/chunk-QJ76JVYM.js +0 -1
  117. package/chunk-RVJEKOIL.js +0 -1
  118. package/chunk-S74D2EJ3.js +0 -1
  119. package/chunk-SHTUKWGG.js +0 -160
  120. package/chunk-UTEKWFDP.js +0 -1
  121. package/chunk-WU3WCPYE.js +0 -1
package/chunk-KEW6IMWJ.js DELETED
@@ -1,7 +0,0 @@
1
- import{a as pt}from"./chunk-SMZ363LC.js";import{a as we,b as De}from"./chunk-UR7ARZNH.js";import{a as jt,b as ce}from"./chunk-J6SZIJEO.js";import{a as Se}from"./chunk-GRIGOPOO.js";import{b as Ot,c as lt,d as at}from"./chunk-XSOIDS3T.js";import{a as me,b as se}from"./chunk-YK5QR3KS.js";import"./chunk-3ZQVIJMU.js";import{b as rt}from"./chunk-HK6C7EEJ.js";import"./chunk-WA6V7JTY.js";import{a as ie}from"./chunk-CEN7UP6Q.js";import"./chunk-4TQOJBQI.js";import{a as Ee,b as Ie}from"./chunk-7FYHB5GM.js";import{a as it,b as nt,d as ae,k as pe}from"./chunk-SW4SZC2K.js";import{a as re,b as le}from"./chunk-76YIDIBJ.js";import"./chunk-6WHZBKFW.js";import"./chunk-ZHINPNBR.js";import{a as ot}from"./chunk-C7CIUOM5.js";import{a as Me}from"./chunk-2EIZ76HE.js";import{b as ye}from"./chunk-M3QTXO6B.js";import"./chunk-FKPQJ7WA.js";import{a as Pt,b as Te}from"./chunk-U2ZDSR5F.js";import"./chunk-4XCMTFFH.js";import"./chunk-PW4323VJ.js";import"./chunk-J3DB5YKJ.js";import"./chunk-NIT7TJ5P.js";import"./chunk-DE2473W5.js";import{d as Ke}from"./chunk-5JHWAF7R.js";import"./chunk-D36YVGIB.js";import{b as oe}from"./chunk-UIVUT5SZ.js";import{e as et,f as tt,h as ne}from"./chunk-LVCF2WZK.js";import"./chunk-DYSMAYNT.js";import{a as Ye,b as te}from"./chunk-WX27CT5F.js";import{a as O,b as $e,c as Xe,d as Je,e as Qe,f as Ze}from"./chunk-52KGCI4Z.js";import"./chunk-C2YOJOPY.js";import{n as Ue,o as We,w as Z,x as ee}from"./chunk-DGTLYGTT.js";import{b as ve}from"./chunk-RFVPTZXE.js";import{b as He,c as At,e as K,f as Y,g as Gt,i as st,k as $,l as X,o as J,u as Ce,x as Q}from"./chunk-FTFZVOHA.js";import{b as ze,e as U,l as W}from"./chunk-GFOJNJA4.js";import{a as Bt,b as be}from"./chunk-RVJEKOIL.js";import{a as qe}from"./chunk-QLLOZ2EX.js";import"./chunk-F2X3VGZZ.js";import{h as Oe,k as z,p as je,q,r as H,x as kt,y as Nt}from"./chunk-PBVHXSHH.js";import{$c as R,Ac as de,Bc as Ae,Cb as b,Cc as F,D as Ne,Dc as M,Ec as Mt,Fc as Ge,Ga as E,Kb as s,Mc as C,Nb as Be,Nc as y,Oc as Pe,Pb as L,Pc as _,Qb as Re,Sb as Fe,Tb as Ve,Ub as o,V as Dt,Vb as r,W as Rt,Wb as T,X as xe,Z as V,_b as w,ad as ue,ba as Ft,bb as j,c as ge,cb as he,dc as I,ec as c,gb as p,ha as S,hc as Vt,pa as x,qa as h,qc as l,rc as f,s as ke,sc as D,tc as Le,vc as A,wb as N,wc as B,xc as P,yc as Lt,zc as mt}from"./chunk-D4VGEGUS.js";import{a as g,b as v,c as fe,e as wt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=S(Bt),this.authService=S(Se)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetSingleCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new Nt({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),a=new kt({"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"}),u=g({params:i,headers:a},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ti=()=>({width:"30vw"}),ii=()=>({"1199px":"75vw","575px":"90vw"}),ni=t=>({"ng-dirty ng-invalid":t}),oi=t=>["/pages/journal/journal-entry/",t];function ri(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;p(3),D("(",e.code,")"),p(6),f(e.name)}}function li(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;p(3),D("(",e.code,")"),p(6),f(e.name)}}function ai(t,m){t&1&&(o(0,"div",37),l(1," Account is required. "),r())}function pi(t,m){if(t&1&&(o(0,"div",38)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function mi(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),T(2,"p-radiobutton",39),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),f(e.value)}}function si(t,m){if(t&1){let e=w();o(0,"div",16)(1,"label",17),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){x(e);let a=c(3);return h(a.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function ci(t,m){if(t&1){let e=w();o(0,"div",16)(1,"label",17),l(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){x(e);let a=c(3);return h(a.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function di(t,m){if(t&1){let e=w();o(0,"div",16)(1,"label",17),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){x(e);let a=c(3);return h(a.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function ui(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),l(3,"Accounts"),r(),o(4,"p-select",18),b(5,ri,10,2,"ng-template",null,5,_)(7,li,10,2,"ng-template",null,6,_),r(),b(9,ai,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),l(12,"From"),r(),o(13,"div",20),T(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),l(18,"Outlets"),r(),o(19,"p-multiselect",23),b(20,pi,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),l(24,"Contact Type"),r(),o(25,"div",25),Fe(26,mi,5,4,"div",26,Re),r()(),o(28,"div",16)(29,"label",24),l(30,"Sort order"),r(),o(31,"div",25)(32,"div",26)(33,"div",27),T(34,"p-radiobutton",28),o(35,"label",29),l(36,"Asc"),r()()(),o(37,"div",30)(38,"div",27),T(39,"p-radiobutton",31),o(40,"label",32),l(41,"Desc"),r()()()()(),b(42,si,4,1,"div",16)(43,ci,4,1,"div",16)(44,di,4,1,"div",16),r()),t&2){let e,n,i,a=c(2);s("formGroup",a.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",a.loaderMetadata().options.accounts)("ngClass",M(14,ni,((e=a.form.get("accountID"))==null?null:e.invalid)&&(((e=a.form.get("accountID"))==null?null:e.touched)||((e=a.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=a.form.get("accountID"))==null?null:n.invalid)&&(((n=a.form.get("accountID"))==null?null:n.touched)||((n=a.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",a.loaderMetadata().options.outlets),p(7),Ve(a.loaderMetadata().options.contactTypeOptions),p(8),s("value",!0),p(5),s("value",!1),p(3),L((i=a.form.controls.contactType.value)===1?42:i===2?43:44)}}function _i(t,m){if(t&1&&b(0,ui,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function fi(t,m){if(t&1){let e=w();o(0,"p-button",45),I("onClick",function(){x(e);let i=c(2);return h(i.onToggleExportDialog())}),r()}}function gi(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),l(2,"Return to Accounts"),r(),b(3,fi,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global.export)}}function xi(t,m){if(t&1&&(o(0,"div",33)(1,"span",34)(2,"h2",52),l(3),r()(),o(4,"span",34)(5,"h2",52),l(6),r()()()),t&2){let e=c(3);p(3),f(e.items().data.name),p(3),D(" (",e.items().data.chartOfAccountCode,") ")}}function hi(t,m){t&1&&(o(0,"tr")(1,"th",53),l(2,"Outlet"),r(),o(3,"th",53),l(4,"No."),r(),o(5,"th",53),l(6,"Date"),r(),o(7,"th"),l(8,"Contact / Note"),r(),o(9,"th",54),l(10,"Debit"),r(),o(11,"th",55),l(12,"Credit"),r(),o(13,"th",55),l(14,"Balance"),r()())}function bi(t,m){if(t&1&&(o(0,"div",16)(1,"a",58),l(2),r(),T(3,"div",60),o(4,"span",61),l(5),r()()),t&2){let e=c().$implicit,n=c(3);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),D("",e.note," ")}}function Si(t,m){if(t&1&&(o(0,"div",16),T(1,"span",60)(2,"div",60),o(3,"span",61),l(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),D("",e.note," ")}}function Ci(t,m){if(t&1&&(o(0,"tr")(1,"td",56),l(2),r(),o(3,"td",56)(4,"a",57),l(5),r()(),o(6,"td",56),l(7),C(8,"date"),r(),o(9,"td",56)(10,"div",16)(11,"a",58),l(12),r(),b(13,bi,6,4,"div",16)(14,Si,5,3,"div",16),r()(),o(15,"td",59),l(16),C(17,"number"),r(),o(18,"td",59),l(19),C(20,"number"),r(),o(21,"td",59),l(22),C(23,"number"),r()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.outletName),p(2),s("routerLink",M(19,oi,e.id)),p(),f(e.number),p(2),f(Pe(8,10,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),L(n.buildReferenceUrl(e)?13:14),p(3),D(" ",y(17,13,e.debitAmount)," "),p(3),D(" ",y(20,15,e.creditAmount)," "),p(3),f(y(23,17,e.balance))}}function vi(t,m){if(t&1&&(o(0,"tr"),T(1,"td",62),o(2,"td",63),l(3,"Total"),r(),o(4,"td",63),l(5),C(6,"number"),r(),o(7,"td",63),l(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c(3);p(5),f(y(6,2,e.debitSubTotal())),p(3),D(" ",y(9,4,e.creditSubTotal())," ")}}function yi(t,m){t&1&&(o(0,"tr")(1,"td",64)(2,"span"),l(3,"No records found."),r()()())}function Ei(t,m){if(t&1){let e=w();o(0,"button",65),I("click",function(){x(e);let i=c(3);return h(i.getGLCount())})("keyup.enter",function(){x(e);let i=c(3);return h(i.getGLCount())}),r()}}function Ii(t,m){if(t&1&&l(0),t&2){let e=c(3);D(" ",e.count()," ")}}function Ti(t,m){if(t&1){let e=w();o(0,"p-button",66),I("onClick",function(){x(e);let i=c(3);return h(i.onNextPage())}),r()}}function wi(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),b(2,xi,7,2,"ng-template",null,7,_)(4,hi,15,0,"ng-template",null,8,_)(6,Ci,24,21,"ng-template",null,9,_)(8,vi,11,6,"ng-template",null,4,_)(10,yi,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),l(14),b(15,Ei,1,0,"button",50)(16,Ii,1,1),l(17," entries "),r(),o(18,"div",33),b(19,Ti,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Le(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),L(e.totalRecords()===-1?15:16),p(4),L(e.pagination().hasNext?19:-1)}}function Di(t,m){if(t&1&&b(0,wi,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Ri(t,m){if(t&1&&(o(0,"div",67)(1,"div",68)(2,"div",69)(3,"div",25)(4,"div",70)(5,"label",24),l(6,"Page"),r()(),o(7,"div",70),T(8,"input",71),r()()()(),o(9,"div",72)(10,"div",27),T(11,"i",73),o(12,"span",74),l(13),C(14,"number"),C(15,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(12),Le("Exporting data from ",y(14,3,e.filter().exportPageNumber)," - ",y(15,5,e.filter().exportPageSize),"")}}function Fi(t,m){if(t&1){let e=w();o(0,"p-button",75),I("onClick",function(){x(e);let i=c();return h(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Vi(t,m){if(t&1){let e=w();o(0,"p-button",76),I("click",function(){x(e);let i=c();return h(i.onToggleExportDialog())}),r(),o(1,"p-button",77),I("click",function(){x(e);let i=c();return h(i.onExport())}),r()}}var qt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(ze),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(ot),this.toastr=S(qe),this.dayjsService=S(ce),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,a=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!a}}),this.queryFilter=ve(this.route.queryParamMap.pipe(ke(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,a={},u=e.get("id");return be.IsNotEmpty(u)&&(a=v(g({},a),{accountID:u})),be.IsNotEmpty(n)&&be.IsNotEmpty(i)&&(a=v(g({},a),{from:n,to:i})),a})),{initialValue:null}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),ue(()=>{let e=this.filter();e&&(be.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),ue(()=>{let e=this.filter(),n=this.form.value.accountID;!e||be.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(a=>e.pageNumber===1?i:v(g({},i),{data:v(g({},i.data),{data:[...a?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return pt(e)}ngOnInit(){this.route.queryParamMap.pipe(Ne(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[At.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let a=this.findNodeByKey(i.children,n);if(a)return a}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,a])=>{switch(i){case"from":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():null;break;case"to":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(a)?n[i]=a.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(a)?a:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=a!=null?Number(a):0;break;case"sortAscending":case"export":n[i]=!!a;break;case"contactType":n[i]=a!=null?Number(a):null;break;default:n[i]=a}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let a=this.form.getRawValue(),{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),a="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(a=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;at(u,a,u.type)}buildExportBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(a=>v(g({},a),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[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","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[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"],["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"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[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"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let a=w();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return x(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),h(d)})("isInitDialogFilterVisibleChange",function(d){return x(a),B(i.initDialogVisible,d)||(i.initDialogVisible=d),h(d)}),I("filterConfirmed",function(){return x(a),h(i.onFilterOKEvent())}),b(1,_i,1,1,"ng-template",null,0,_)(3,gi,4,1,"ng-template",null,1,_)(5,Di,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return x(a),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),h(d)}),b(8,Ri,16,7,"div",13)(9,Fi,1,2,"ng-template",null,3,_)(11,Vi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Be(F(11,ti)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(12,ii)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[ne,H,Oe,z,q,je,oe,pe,ae,tt,et,ee,Z,Te,Pt,le,re,De,we,Q,$,He,K,Y,X,J,se,me,ye,Ke,lt,rt,te,W,U,nt,it,We,Ue],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}}},ht=$e(Ze(Li),Xe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),Qe(t=>{let m=S(G),e=S(ce),n={updateFilter(i){O(t,a=>v(g({},a),{filter:g(g({},a.filter),i)}))},getLoader:Ee(ge(xe(()=>m.getIncomeStatementLoader().pipe(Ie({next:i=>{O(t,a=>v(g({},a),{loader:i,filter:v(g({},a.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ee(ge(xe(i=>m.getIncomeStatement(i).pipe(Rt(()=>O(t,a=>v(g({},a),{isLoading:!0}))),Ie({next:a=>{O(t,u=>v(g({},u),{data:a,isLoading:!1}))},error:a=>{console.error(a)}})))))};return n}),Je({onInit:t=>{t.getLoader()}}));var bt=()=>({}),St=t=>["/pages/chart-of-account/account/",t],Ct=()=>["/pages/report/general-ledger"],vt=(t,m,e)=>({id:t,from:m,to:e});function ki(t,m){if(t&1){let e=w();o(0,"p-button",10),I("onClick",function(){x(e);let i=c(2);return h(i.onExport())}),r()}}function Ni(t,m){if(t&1&&(o(0,"div",8),b(1,ki,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global.export)}}function Bi(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function Ai(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",M(8,St,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Ct))("queryParams",Ge(11,vt,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Gi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Revenue :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,1,e.store.totalRevenue()))}}function Pi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No revenue records available"),r()()())}function Oi(t,m){if(t&1&&(o(0,"h6",12),l(1,"Revenue"),r(),o(2,"p-table",13),b(3,Bi,7,0,"ng-template",null,3,_)(5,Ai,10,15,"ng-template",null,4,_)(7,Gi,8,3,"ng-template",null,5,_)(9,Pi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function ji(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",24),l(6,"Total"),r()())}function zi(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",M(8,St,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Ct))("queryParams",Ge(11,vt,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total COGS :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Gross Profit :"),r(),o(13,"span",22),l(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalCOGS())),p(8),f(y(15,4,e.store.grossProfit()))}}function Hi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No COGS records available"),r()()())}function Ui(t,m){if(t&1&&(o(0,"h4",12),l(1,"COGS"),r(),o(2,"p-table",13),b(3,ji,7,0,"ng-template",null,3,_)(5,zi,10,15,"ng-template",null,4,_)(7,qi,16,6,"ng-template",null,5,_)(9,Hi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function Wi(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",M(8,St,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Ct))("queryParams",Ge(11,vt,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Yi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Expense :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Profit / Loss :"),r(),o(13,"span",22),l(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalExpense())),p(8),f(y(15,4,e.store.profitOrLoss()))}}function $i(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No expense records available"),r()()())}function Xi(t,m){if(t&1&&(o(0,"h4",12),l(1,"Expense"),r(),o(2,"p-table",13),b(3,Wi,7,0,"ng-template",null,3,_)(5,Ki,10,15,"ng-template",null,4,_)(7,Yi,16,6,"ng-template",null,5,_)(9,$i,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function Ji(t,m){if(t&1&&(Lt(0)(1),o(2,"p-panel")(3,"div",11),b(4,Oi,11,1)(5,Ui,11,1)(6,Xi,11,1),r()()),t&2){let e,n,i,a,u,d=c();mt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),mt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),L(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:F(5,bt)).length>0?4:-1),p(),L(d.Object.keys((a=(a=d.store.data().data)==null?null:a.cogs)!==null&&a!==void 0?a:F(6,bt)).length>0?5:-1),p(),L(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:F(7,bt)).length>0?6:-1)}}function Qi(t,m){if(t&1){let e=w();o(0,"form",25)(1,"div",26)(2,"label",27),l(3,"Outlet"),r(),T(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),l(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){x(e);let a=c();return h(a.onCashierSearch(i))})("onSelect",function(i){x(e);let a=c();return h(a.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),l(11,"From - To"),r(),o(12,"div",31),T(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var Ht=(()=>{class t{constructor(){this.dayjsService=S(ce),this.store=S(ht),this.fb=S(Ce),this.reportService=S(G),this.roleService=S(ie),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ue(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Me("Cashier Suggestions"),V(n=>this.cashierSuggestions.set(n))).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(),n=Object.entries(e).reduce((i,[a,u])=>(a==="from"||a==="to"?u instanceof Date&&(i[a]=this.dayjsService.from(u).format()):i[a]=u||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),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=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Me("Export Profit & Loss"),V(n=>{let i=n.type,a=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(a,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Ae([ht])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["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"],[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"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let a=w();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return x(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),h(d)})("isInitDialogFilterVisibleChange",function(d){return x(a),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),h(d)}),I("filterConfirmed",function(){return x(a),h(i.onFilterOK())}),b(1,Ni,2,1,"ng-template",null,0,_)(3,Ji,7,8,"ng-template",null,1,_)(5,Qi,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,Te,le,re,Q,$,K,Y,X,J,se,me,oe,pe,ae,te,Ye,W,U,De,we,ee,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yt=wt(jt());var Zi={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,yt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Et=$e(Ze(Zi),Xe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),Qe(t=>{let m=S(G),e={updateFilter:n=>{O(t,i=>v(g({},i),{filter:n}))},fetchBalanceSheet:Ee(ge(Ne(()=>{let n=t.filter();return Object.entries(n).every(([i,a])=>a!=null&&a!=="")}),xe(n=>m.getBalanceSheet(n).pipe(Ie({next:i=>{O(t,a=>v(g({},a),{data:i}))},error:i=>{console.error(i)}}))),Dt(1))),fetchLoader:Ee(ge(xe(()=>m.getBalanceSheetLoader().pipe(Ie({next:n=>{O(t,i=>v(g({},i),{metadata:n,filter:{date:(0,yt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Je(t=>({onInit:()=>{t.fetchLoader()}})));var Ut=wt(jt());var It=t=>["/pages/chart-of-account/account/",t],Tt=()=>["/pages/report/general-ledger"],en=(t,m)=>({id:t,to:m}),Wt=t=>({id:t});function tn(t,m){if(t&1){let e=w();o(0,"p-button",11),I("onClick",function(){x(e);let i=c(2);return h(i.onExport())}),r()}}function nn(t,m){if(t&1&&(o(0,"div",9),b(1,tn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global.export)}}function on(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Asset"),r(),o(5,"th",17),l(6,"Total"),r()())}function rn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.code),p(2),s("routerLink",M(8,It,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Tt))("queryParams",Mt(11,en,e.accountID,n.store.filter().date)),p(),f(y(9,6,e.amount))}}function ln(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Asset"),r(),o(3,"td",22),l(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),D(" ",y(5,1,e.store.totalAsset())," ")}}function an(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No asset records found."),r()()())}function pn(t,m){if(t&1&&(o(0,"h4",14),l(1,"Asset"),r(),o(2,"p-table",15),b(3,on,7,0,"ng-template",null,3,_)(5,rn,10,14,"ng-template",null,4,_)(7,ln,6,3,"ng-template",null,5,_)(9,an,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function mn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Liability"),r(),o(5,"th",17),l(6,"Total"),r()())}function sn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",25),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",M(8,It,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Tt))("queryParams",M(11,Wt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function cn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2," Total Liability "),r(),o(3,"td",22),l(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),D(" ",y(5,1,e.store.totalLiability())," ")}}function dn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No liability records found."),r()()())}function un(t,m){if(t&1&&(o(0,"h4",24),l(1,"Liability"),r(),o(2,"p-table",15),b(3,mn,7,0,"ng-template",null,3,_)(5,sn,10,13,"ng-template",null,4,_)(7,cn,6,3,"ng-template",null,5,_)(9,dn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().liability)}}function _n(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Equity"),r(),o(5,"th",17),l(6,"Total"),r()())}function fn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",M(8,It,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Tt))("queryParams",M(11,Wt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function gn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Equity"),r(),o(3,"td",22),l(4),C(5,"number"),r()(),o(6,"tr")(7,"td",21),l(8," Total Liability + Equity "),r(),o(9,"td",22),l(10),C(11,"number"),r()()),t&2){let e=c(3);p(4),D(" ",y(5,2,e.store.totalEquity())," "),p(6),D(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function xn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No equity records found."),r()()())}function hn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Equity"),r(),o(2,"p-table",15),b(3,_n,7,0,"ng-template",null,3,_)(5,fn,10,13,"ng-template",null,4,_),l(7," <"),b(8,gn,12,6,"ng-template",null,5,_)(10,xn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function bn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),b(2,pn,11,1)(3,un,11,1)(4,hn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),L(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),L(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),L(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Sn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Cn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),l(3,"Outlet"),r(),o(4,"p-multiselect",29),b(5,Sn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),l(9,"From"),r(),T(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Kt=(()=>{class t{constructor(){this.store=S(Et),this.ReportServiceStore=S(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=S(ie),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Gt({date:new st(new Date),outletID:new st([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Ut.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Me("Export Balance Sheet"),V(n=>{let i=n.type,a=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(a,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Ae([Et])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["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,"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(n,i){if(n&1){let a=w();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return x(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),h(d)})("isInitDialogFilterVisibleChange",function(d){return x(a),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),h(d)}),I("filterConfirmed",function(){return x(a),h(i.onFilterOKEvent())}),b(1,nn,2,1,"ng-template",null,0,_)(3,bn,5,4,"ng-template",null,1,_)(5,Cn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,pe,ae,oe,ee,Z,Q,$,K,Y,X,J,se,me,le,re,ye,te,Ye,W,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Yt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-comparative-balance works!"),r(),l(2,`
2
- ,
3
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var $t=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-cash-flow works!"),r(),l(2,`
4
- ,
5
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Xt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-trial-balance works!"),r(),l(2,`
6
- ,
7
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vn=()=>({width:"30vw"}),yn=()=>({"1199px":"75vw","575px":"90vw"}),En=t=>["/pages/journal/journal-entry/",t],In=t=>({"ng-dirty ng-invalid":t}),Tn=()=>({scrollHeight:"250px"});function wn(t,m){if(t&1){let e=w();o(0,"p-button",27),I("onClick",function(){x(e);let i=c(2);return h(i.onToggleExportDialog())}),r()}}function Dn(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),l(2,"Return to Accounts"),r(),b(3,wn,1,0,"p-button",26),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global.export)}}function Rn(t,m){if(t&1&&(o(0,"div",24)(1,"span",31)(2,"h2",32),l(3),r()(),o(4,"span",31)(5,"h2",32),l(6),r()()()),t&2){let e=c().$implicit;p(3),f(e.name),p(3),D(" (",e.chartOfAccountCode,") ")}}function Fn(t,m){t&1&&(o(0,"tr")(1,"th",33),l(2,"Outlet"),r(),o(3,"th",33),l(4,"No."),r(),o(5,"th",33),l(6,"Date"),r(),o(7,"th"),l(8,"Contact / Note"),r(),o(9,"th",34),l(10,"Debit"),r(),o(11,"th",35),l(12,"Credit"),r(),o(13,"th",35),l(14,"Balance"),r()())}function Vn(t,m){if(t&1&&(o(0,"div",38)(1,"a",39),l(2),r(),T(3,"div",41),o(4,"span",42),l(5),r()()),t&2){let e=c().$implicit,n=c(4);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),D("",e.note," ")}}function Ln(t,m){if(t&1&&(o(0,"div",38),T(1,"span",41)(2,"div",41),o(3,"span",42),l(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),D("",e.note," ")}}function Mn(t,m){if(t&1&&(o(0,"tr")(1,"td",36),l(2),r(),o(3,"td",36)(4,"a",37),l(5),r()(),o(6,"td",36),l(7),C(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),l(12),r(),b(13,Vn,6,4,"div",38)(14,Ln,5,3,"div",38),r()(),o(15,"td",40),l(16),C(17,"number"),r(),o(18,"td",40),l(19),C(20,"number"),r(),o(21,"td",40),l(22),C(23,"number"),r()()),t&2){let e=m.$implicit,n=c(4);p(2),f(e.outletName),p(2),s("routerLink",M(19,En,e.id)),p(),f(e.number),p(2),f(Pe(8,10,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),L(n.buildReferenceUrl(e)?13:14),p(3),D(" ",y(17,13,e.debitAmount)," "),p(3),D(" ",y(20,15,e.creditAmount)," "),p(3),f(y(23,17,e.balance))}}function kn(t,m){if(t&1&&(o(0,"tr"),T(1,"td",43),o(2,"td",44),l(3,"Total"),r(),o(4,"td",44),l(5),C(6,"number"),r(),o(7,"td",44),l(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c().$index,n=c(3);p(5),D(" ",y(6,2,n.items().data[e].debitTotal)," "),p(3),D(" ",y(9,4,n.items().data[e].creditTotal)," ")}}function Nn(t,m){t&1&&(o(0,"tr")(1,"td",45)(2,"span"),l(3,"No records found."),r()()())}function Bn(t,m){if(t&1&&(o(0,"p-table",30),b(1,Rn,7,2,"ng-template",null,5,_)(3,Fn,15,0,"ng-template",null,6,_)(5,Mn,24,21,"ng-template",null,7,_)(7,kn,11,6,"ng-template",null,4,_)(9,Nn,4,0,"ng-template",null,8,_),r()),t&2){let e=m.$implicit;s("value",e.data)}}function An(t,m){if(t&1&&(o(0,"div",29),Fe(1,Bn,11,1,"p-table",30,Re),r()),t&2){let e=c(2);p(),Ve(e.items().data)}}function Gn(t,m){if(t&1&&b(0,An,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Pn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",31)(8,"span",62),l(9),r()()()),t&2){let e=m.$implicit;p(3),D("(",e.code,")"),p(6),f(e.name)}}function On(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",31)(8,"span",62),l(9),r()()()),t&2){let e=m.$implicit;p(3),D("(",e.code,")"),p(6),f(e.name)}}function jn(t,m){t&1&&(o(0,"div",63),l(1," Account is required. "),r())}function zn(t,m){if(t&1&&(o(0,"div",64)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function qn(t,m){if(t&1&&(o(0,"div",55)(1,"div",21),T(2,"p-radiobutton",65),o(3,"label",66),l(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),Vt("for",e.key),p(),f(e.value)}}function Hn(t,m){if(t&1){let e=w();o(0,"div",38)(1,"label",47),l(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){x(e);let a=c(2);return h(a.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function Un(t,m){if(t&1){let e=w();o(0,"div",38)(1,"label",47),l(2,"Supplier"),r(),o(3,"p-autocomplete",68),I("completeMethod",function(i){x(e);let a=c(2);return h(a.searchSupplier(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.supplierSuggestions())}}function Wn(t,m){if(t&1){let e=w();o(0,"div",38)(1,"label",47),l(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){x(e);let a=c(2);return h(a.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function Kn(t,m){if(t&1){let e=w();o(0,"form",46)(1,"div",38)(2,"label",47),l(3,"Accounts"),r(),o(4,"p-multiselect",48),I("onChange",function(i){x(e);let a=c();return h(a.onAccountChange(i))}),b(5,Pn,10,2,"ng-template",null,9,_)(7,On,10,2,"ng-template",null,10,_),r(),b(9,jn,2,0,"div",49),r(),o(10,"div",38)(11,"label",47),l(12,"From"),r(),o(13,"div",50),T(14,"p-datepicker",51)(15,"p-datepicker",52),r()(),o(16,"div",38)(17,"label",47),l(18,"Outlets"),r(),o(19,"p-multiselect",53),b(20,zn,3,1,"ng-template",null,10,_),r()(),o(22,"div",38)(23,"label",47),l(24,"Category"),r(),o(25,"p-treeselect",54),I("onFocus",function(){x(e);let i=c();return h(i.onCategoryFocus())}),r()(),o(26,"div",38)(27,"label",18),l(28,"Contact Type"),r(),o(29,"div",16),Fe(30,qn,5,4,"div",55,Re),r()(),o(32,"div",38)(33,"label",18),l(34,"Sort order"),r(),o(35,"div",16)(36,"div",55)(37,"div",21),T(38,"p-radiobutton",56),o(39,"label",57),l(40,"Asc"),r()()(),o(41,"div",58)(42,"div",21),T(43,"p-radiobutton",59),o(44,"label",60),l(45,"Desc"),r()()()()(),b(46,Hn,4,1,"div",38)(47,Un,4,1,"div",38)(48,Wn,4,1,"div",38),r()}if(t&2){let e,n,i,a,u,d,k=c();s("formGroup",k.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(e=k.loaderMetadata())==null||e.options==null?null:e.options.accounts)("selectionLimit",5)("ngClass",M(22,In,((n=k.form.get("listAccountID"))==null?null:n.invalid)&&(((n=k.form.get("listAccountID"))==null?null:n.touched)||((n=k.form.get("listAccountID"))==null?null:n.dirty)))),p(5),s("ngIf",((i=k.form.get("listAccountID"))==null?null:i.invalid)&&(((i=k.form.get("listAccountID"))==null?null:i.touched)||((i=k.form.get("listAccountID"))==null?null:i.dirty))),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(a=k.loaderMetadata())==null||a.options==null?null:a.options.outlets),p(6),s("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",F(24,Tn))("options",k.categoriesOptions()),p(5),Ve((u=k.loaderMetadata())==null||u.options==null?null:u.options.contactTypeOptions),p(8),s("value",!0),p(5),s("value",!1),p(3),L((d=k.form.controls.contactType.value)===1?46:d===2?47:48)}}function Yn(t,m){if(t&1){let e=w();o(0,"p-button",69),I("onClick",function(){x(e);let i=c();return h(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function $n(t,m){if(t&1){let e=w();o(0,"p-button",70),I("click",function(){x(e);let i=c();return h(i.onToggleExportDialog())}),r(),o(1,"p-button",71),I("click",function(){x(e);let i=c();return h(i.onExport())}),r()}}var Jt=(()=>{class t{buildReferenceUrl(e){return pt(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(ze),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(ot),this.toastr=S(qe),this.dayjsService=S(ce),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=Math.min(e.pageNumber*e.pageSize,isFinite(n)?n:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(n)?e.pageNumber*e.pageSize<n:!0}}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("multiple"),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=ve(this.route.queryParamMap.pipe(ke(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=R(()=>{let e=this.baseFilter(),n=this.queryFilter(),i=this.localFilter();return e?g(g(g({},e),n??{}),i):null}),this.creditSubTotal=R(()=>0),this.debitSubTotal=R(()=>0),this.initializeForm(),ue(()=>{let e=this.filter();e&&(e.listAccountID.length>0||e.listCategoryID.length>0)&&(this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1}),this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(n=>{this.items.set(n)}))})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(null),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listCategoryID:this.fb.control([]),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let a=this.findNodeByKey(i.children,n);if(a)return a}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,a])=>{switch(i){case"from":break;case"to":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(a)?n[i]=a.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(a)?a:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=a!=null?Number(a):0;break;case"sortAscending":case"export":n[i]=!!a;break;case"contactType":n[i]=a!=null?Number(a):null;break;default:n[i]=a}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}onFormValueChange(){let e=this.form.controls.listAccountID.value,n=this.form.controls.listCategoryID.value;e.length<=0&&n.length<=0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1})):e.length>0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.disable({emitEvent:!1})):n.length>0&&(this.form.controls.listAccountID.disable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1}))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at most 5 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e)}buildFilterBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),a="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(a=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;at(u,a,u.type)}buildExportBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(a=>v(g({},a),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-multiple-ledger"]],decls:28,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"row"],[1,"col"],["for",""],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],[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"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[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"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","selectionLimit","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["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","key","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"col-4"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[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"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let a=w();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return x(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),h(d)})("isInitDialogFilterVisibleChange",function(d){return x(a),B(i.initDialogVisible,d)||(i.initDialogVisible=d),h(d)}),I("filterConfirmed",function(){return x(a),h(i.onFilterOKEvent())}),b(1,Dn,4,1,"ng-template",null,0,_)(3,Gn,1,1,"ng-template",null,1,_)(5,Kn,49,25,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return x(a),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),h(d)}),o(8,"div",13)(9,"div",14)(10,"div",15)(11,"div",16)(12,"div",17)(13,"label",18),l(14,"Page"),r()(),o(15,"div",17),T(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),T(19,"i",22),o(20,"span",23),l(21),C(22,"number"),C(23,"number"),r()()()(),b(24,Yn,1,2,"ng-template",null,3,_)(26,$n,2,0,"ng-template",null,4,_),r()}if(n&2){let a;s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Be(F(17,vn)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(18,yn)),p(2),s("formGroup",i.form),p(12),Le("Exporting data from ",y(22,13,(a=i.filter())==null?null:a.exportPageNumber)," - ",y(23,15,(a=i.filter())==null?null:a.exportPageSize),"")}},dependencies:[ne,H,Oe,z,q,je,oe,pe,ae,tt,et,ee,Z,Te,le,re,De,we,Q,$,He,K,Y,X,J,se,me,ye,Ke,lt,Ot,rt,te,W,U,nt,it,We,Ue],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var Gl=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:qt},{path:"multiple-general-ledger",component:Jt},{path:"profit-loss",component:Ht},{path:"balance-sheet",component:Kt},{path:"comparative-balance",component:Yt},{path:"trial-balance",component:Xt},{path:"cash-flow",component:$t}]}];export{Gl as REPORTS_ROUTES};
package/chunk-LEE5F54T.js DELETED
@@ -1 +0,0 @@
1
- import{b as P}from"./chunk-J6SZIJEO.js";import{b as A}from"./chunk-M3QTXO6B.js";import{a as w,b}from"./chunk-UIVUT5SZ.js";import{b as y}from"./chunk-WX27CT5F.js";import{x as _}from"./chunk-DGTLYGTT.js";import{a as O}from"./chunk-RVJEKOIL.js";import{r as M,y as S}from"./chunk-PBVHXSHH.js";import{Cb as C,Da as c,Pc as a,Ub as i,Vb as r,Wb as x,ba as s,ec as m,gb as u,ha as d,qc as p,rc as v,sc as l,wb as h}from"./chunk-D4VGEGUS.js";var k=(()=>{class t{constructor(){this.httpService=d(O),this.dayjs=d(P)}migrateTaxAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/tax",{})}getManualJournalCount(){return this.httpService.get(void 0,"api/migrate/accounting/journalheader-count",{})}getCOACount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountcount",{})}getCOAConfigurationCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountConfigcount",{})}getCOACategoryCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountCategorycount",{})}getOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/outletaccount-count",{})}getPaymentMethodAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/paymentmethodaccountcount",{})}getWriteOffOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/writeoffoutletaccountCount",{})}getTaxAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/taxcount",{})}getExpenseAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/expenseaccountcount",{})}migrateCoaAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccount",{})}migrateCoaConfig(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountConfig",{})}migrateCoaCategory(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountCategory",{})}migrateOutletAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/outletaccount",{})}migrateManualJournal(e){let n={From:e.From?this.dayjs.from(e.From).format():null,To:e.To?this.dayjs.from(e.To).format():null,PageNumber:e.PageNumber||1,PageSize:e.PageSize||50},o=new S;return Object.keys(n).forEach(f=>{o=o.append(f,n[f])}),this.httpService.get(void 0,"api/migrate/accounting/journalheader",{params:o})}formatManualCOA(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa",{})}formatExpenseAccount(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-expenseaccount",{})}formatWriteOff(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-writeoff",{})}formatManualCOAConfig(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa-config",{})}formatOutletAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-outlet-account",{})}formatPaymentAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-paymentmethod",{})}formatTaxAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-tax",{})}formatManualJournal(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-journal",{})}formatManualCOACategory(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-coag",{})}migratePaymentMethod(){return this.httpService.post(void 0,"api/Migrate/accounting/paymentmethodaccount",{})}migrateWriteOffOutlet(){return this.httpService.post(void 0,"api/Migrate/accounting/writeoffoutletaccount",{})}migrateExpenseAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/expenseaccount",{})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=s({token:t,factory:t.\u0275fac})}}return t})();function j(t,g){t&1&&(i(0,"div",5)(1,"div",6),x(2,"i",7),r()())}function E(t,g){if(t&1&&(i(0,"div",8),p(1),r()),t&2){let e=m();u(),l(" ",e.migrationCount()," ")}}function z(t,g){if(t&1&&(i(0,"div",9),p(1),r()),t&2){let e=m();u(),l(" ",e.migrationTitle()," ")}}function F(t,g){if(t&1&&(i(0,"div",10)(1,"div",11),p(2),r()()),t&2){let e=m();u(2),v(e.migrationPlace())}}var X=(()=>{class t{constructor(){this.migrationTitle=c(),this.migrationCount=c(),this.migrationPlace=c()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["app-migration-cards"]],inputs:{migrationTitle:[1,"migrationTitle"],migrationCount:[1,"migrationCount"],migrationPlace:[1,"migrationPlace"]},decls:9,vars:0,consts:[["header",""],["title",""],["subtitle",""],["footer",""],[1,"text-center","flex","flex-column","justify-content-center","align-items-center","card-shadow","responsive-card"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center","align-items-center","mt-4",2,"width","60px","height","60px","background-color","#e0f0ff","border-radius","50%"],[1,"icon","fa-file-lines","fa-light",2,"font-size","25px","color","#007bff"],[1,"bigscale","fw-bold"],[1,"text-sm","text-secondary"],[1,"flex","mt-5"],[1,"p-6","fs-7","fw-bold"]],template:function(n,o){n&1&&(i(0,"p-card",4),C(1,j,3,0,"ng-template",null,0,a)(3,E,2,1,"ng-template",null,1,a)(5,z,2,1,"ng-template",null,2,a)(7,F,3,1,"ng-template",null,3,a),r())},dependencies:[M,b,w,_,A,y],styles:["[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}[_nghost-%COMP%] .p-card{box-shadow:0 .25rem 1.25rem #0000001a!important;width:21.875rem!important;height:25rem!important}@media (max-width: 85rem){[_nghost-%COMP%] .p-card{width:18.875rem!important;height:21rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:2rem!important;margin-top:1rem!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){[_nghost-%COMP%] .p-card{width:21rem!important;height:25rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}}@media (min-width: 98rem){[_nghost-%COMP%] .p-card{width:25rem!important;height:28rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:5rem!important;margin-top:2rem!important}}"]})}}return t})();export{k as a,X as b};
package/chunk-QJ76JVYM.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-47CQRQIP.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-HQVGMXBL.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-WAVSEPCG.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-DKORHYIR.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-LZSOBSQV.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-NU5466MQ.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-5ZHMTEH2.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-O74X6MMZ.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-UC564LFH.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
package/chunk-RVJEKOIL.js DELETED
@@ -1 +0,0 @@
1
- import{a as b}from"./chunk-QLLOZ2EX.js";import{A as I,B as g,C as D}from"./chunk-PBVHXSHH.js";import{I as u,Z as d,ba as m,ha as f,n as y,s as h}from"./chunk-D4VGEGUS.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(d(this.handleResponse.bind(this)),h(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var p={production:!0,version:"5.37.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var l=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();l.IsNotEmpty(t)&&window.Intercom("boot",{app_id:p.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return l.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,l as b,p as c,N as d};
package/chunk-S74D2EJ3.js DELETED
@@ -1 +0,0 @@
1
- import{a}from"./chunk-IRBPX3RE.js";import"./chunk-GRIGOPOO.js";import"./chunk-4TQOJBQI.js";import"./chunk-GFOJNJA4.js";import"./chunk-RVJEKOIL.js";import"./chunk-QLLOZ2EX.js";import"./chunk-F2X3VGZZ.js";import"./chunk-PBVHXSHH.js";import"./chunk-D4VGEGUS.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-WH54KYS2.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};