dealposbooks 1.9.8 → 5.32.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 (141) hide show
  1. package/3rdpartylicenses.txt +52 -52
  2. package/assets/scss/style.scss +8 -1
  3. package/{chunk-V4IY7RIP.js → chunk-253IFSMV.js} +1 -1
  4. package/chunk-2BCAGP7R.js +1 -0
  5. package/chunk-2FU3LWGL.js +1 -0
  6. package/{chunk-27P5HOS3.js → chunk-2KB4NNVP.js} +1 -1
  7. package/{chunk-H6BPUKCW.js → chunk-33PMTNWY.js} +1 -1
  8. package/chunk-33YEAYJV.js +1 -0
  9. package/{chunk-JO3SI6HU.js → chunk-3LDYJV3L.js} +1 -1
  10. package/chunk-3WD3CTYC.js +1 -0
  11. package/{chunk-WWWY3VE7.js → chunk-42UIGXWH.js} +1 -1
  12. package/chunk-4ANXHXE3.js +7 -0
  13. package/{chunk-W4KTL6Y6.js → chunk-4LGDNQMZ.js} +1 -1
  14. package/chunk-56GDP75Z.js +1 -0
  15. package/{chunk-7IPVVF6Y.js → chunk-5R3XKSDM.js} +1 -1
  16. package/chunk-63YXSI43.js +1 -0
  17. package/{chunk-LMI4DLB5.js → chunk-67VPWIWW.js} +51 -51
  18. package/chunk-6ACYDH2N.js +1 -0
  19. package/{chunk-AZWJMXL6.js → chunk-6DRYMDZA.js} +1 -1
  20. package/{chunk-NR3EHEG3.js → chunk-6LENP6AB.js} +1 -1
  21. package/{chunk-3RM5CDGW.js → chunk-6NGIQJIP.js} +2 -2
  22. package/chunk-6OQPMZXU.js +1 -0
  23. package/{chunk-L66QS3IX.js → chunk-6UGXXSQ3.js} +1 -1
  24. package/chunk-74MJ3NFN.js +1 -0
  25. package/chunk-7EJVMM7V.js +252 -0
  26. package/chunk-7EZGTYA2.js +1 -0
  27. package/chunk-7VQQO4OE.js +1 -0
  28. package/{chunk-XAH4P23E.js → chunk-A7EGGUJQ.js} +1 -1
  29. package/{chunk-DXIZC3FM.js → chunk-ABBBWSSO.js} +1 -1
  30. package/{chunk-OXGCSUUS.js → chunk-AIZN44RL.js} +2 -2
  31. package/{chunk-DJAICZNR.js → chunk-AZUQDRJU.js} +1 -1
  32. package/chunk-B5JORMF2.js +1 -0
  33. package/{chunk-DAQCANBV.js → chunk-B63BKC6F.js} +2 -2
  34. package/{chunk-6PS3NJ62.js → chunk-B7WHT2EP.js} +1 -1
  35. package/{chunk-W6LBFCQQ.js → chunk-BHV2HCJY.js} +1 -1
  36. package/{chunk-4V5YFD3N.js → chunk-BLJMNWUM.js} +1 -1
  37. package/{chunk-TLLNQB5C.js → chunk-BMBVCXB4.js} +2 -2
  38. package/chunk-BQXWTZHK.js +129 -0
  39. package/{chunk-XYU65DNE.js → chunk-BTDW4G2F.js} +1 -1
  40. package/chunk-C2GO6SPF.js +1 -0
  41. package/{chunk-YJ3CWPO4.js → chunk-C6U3U6SW.js} +1 -1
  42. package/{chunk-BX74ZLQG.js → chunk-C7LM5UCK.js} +1 -1
  43. package/{chunk-RSGEQTNJ.js → chunk-EDCDR4RJ.js} +1 -1
  44. package/{chunk-CEZEYAWZ.js → chunk-EW3R2HAB.js} +1 -1
  45. package/{chunk-SH4ALZVS.js → chunk-F5XF3NTF.js} +1 -1
  46. package/{chunk-4PK4TO7C.js → chunk-F5Z3IX4J.js} +1 -1
  47. package/{chunk-U75O34AW.js → chunk-FBEBMNVC.js} +1 -1
  48. package/{chunk-3GHEXAAZ.js → chunk-FMVCTBCQ.js} +1 -1
  49. package/{chunk-BDJHC5O6.js → chunk-GH5Z5SPB.js} +1 -1
  50. package/chunk-GORMHEMA.js +1 -0
  51. package/{chunk-4MEPU7FI.js → chunk-HAZ77TED.js} +1 -1
  52. package/{chunk-6332DY2I.js → chunk-HHDFSN55.js} +1 -1
  53. package/{chunk-TIX3GAPF.js → chunk-HHJMN4BS.js} +1 -1
  54. package/chunk-INXSCWN3.js +1 -0
  55. package/chunk-IU2PF53V.js +1 -0
  56. package/{chunk-CNLYDNON.js → chunk-J4XRJAME.js} +1 -1
  57. package/{chunk-FTI2QPWV.js → chunk-JBSIAXM5.js} +1 -1
  58. package/{chunk-WCXWWANV.js → chunk-JP6RBSB3.js} +3 -3
  59. package/chunk-JPP5O2O5.js +1 -0
  60. package/{chunk-KANHSSLO.js → chunk-KJ6CKUEI.js} +3 -3
  61. package/chunk-L725MUU2.js +160 -0
  62. package/{chunk-HFUW7PYZ.js → chunk-LRRVQSMI.js} +1 -1
  63. package/{chunk-7ET5CSOO.js → chunk-M4Z3FI3C.js} +1 -1
  64. package/{chunk-RLR2HFSC.js → chunk-MDH73MG3.js} +1 -1
  65. package/chunk-MFH4UZ6J.js +1 -0
  66. package/{chunk-77BBQI2T.js → chunk-MWDWM2EU.js} +1 -1
  67. package/chunk-MXBBJHYA.js +202 -0
  68. package/{chunk-35ER6BC7.js → chunk-NA5YXAMJ.js} +1 -1
  69. package/{chunk-CZWWMQFD.js → chunk-O4QM64EH.js} +1 -1
  70. package/{chunk-YVGWGEPX.js → chunk-OLOVFS3Y.js} +1 -1
  71. package/{chunk-MYLHWS7O.js → chunk-OYHHWU2W.js} +1 -1
  72. package/chunk-P3V7Z3A6.js +1 -0
  73. package/{chunk-RNOSD5RO.js → chunk-PKN47FQE.js} +2 -2
  74. package/chunk-PV3NLUKC.js +1 -0
  75. package/chunk-Q33XIUDN.js +1 -0
  76. package/chunk-QCLAOAVG.js +1 -0
  77. package/chunk-QLUQTLSH.js +1 -0
  78. package/{chunk-LFVBO7JG.js → chunk-QSWSGP4B.js} +1 -1
  79. package/{chunk-J6H5UCJR.js → chunk-QYXQYPHB.js} +1 -1
  80. package/chunk-RBTNUVT5.js +130 -0
  81. package/chunk-REXWFSN3.js +1 -0
  82. package/chunk-RMRYZWCP.js +1 -0
  83. package/chunk-SEGRH6C4.js +1 -0
  84. package/chunk-TT745CJN.js +1 -0
  85. package/{chunk-JZTK7BS7.js → chunk-TVNXFJII.js} +1 -1
  86. package/chunk-UWNAF5OL.js +1 -0
  87. package/{chunk-RYHNURUZ.js → chunk-UYC454VQ.js} +1 -1
  88. package/{chunk-BPFL7VRT.js → chunk-VAXEGESW.js} +1 -1
  89. package/{chunk-TDMJ2M6W.js → chunk-VFEEFGWW.js} +1 -1
  90. package/chunk-VVHTNAHQ.js +1 -0
  91. package/{chunk-KHP7E7JG.js → chunk-VYK2CQ72.js} +1 -1
  92. package/{chunk-R6XNFCQM.js → chunk-W24I5WPW.js} +1 -1
  93. package/{chunk-CLVUILX2.js → chunk-W4SAEISC.js} +12 -12
  94. package/chunk-WSZ5MU6V.js +1 -0
  95. package/{chunk-BOVEGMBL.js → chunk-XILGARZ5.js} +1 -1
  96. package/chunk-XJEZJFWN.js +1 -0
  97. package/chunk-XKCLERWG.js +1 -0
  98. package/chunk-XKI7WLHE.js +1 -0
  99. package/chunk-YDEVG4CR.js +1 -0
  100. package/{chunk-VJLO7GNT.js → chunk-YO23YVSC.js} +1 -1
  101. package/{chunk-Z3SHAW6W.js → chunk-YOUPD27G.js} +1 -1
  102. package/{chunk-ZHU3HOWQ.js → chunk-YRCXWYJC.js} +1 -1
  103. package/chunk-ZNIFAG4O.js +1 -0
  104. package/index.html +4 -4
  105. package/main-OTYR5DFR.js +1 -0
  106. package/package.json +1 -1
  107. package/{styles-XXVTW56A.css → styles-TTHIY3OR.css} +1 -1
  108. package/chunk-2QWAAI3V.js +0 -1
  109. package/chunk-3OJSEDLY.js +0 -1
  110. package/chunk-46XJU64Z.js +0 -1
  111. package/chunk-5RRPJBLN.js +0 -1
  112. package/chunk-7JGGV5FX.js +0 -1
  113. package/chunk-7TOJMYLE.js +0 -1
  114. package/chunk-C3N6HRIE.js +0 -1
  115. package/chunk-CGUMUBB7.js +0 -1
  116. package/chunk-DCKLQNGL.js +0 -1
  117. package/chunk-EJCLRSB2.js +0 -1
  118. package/chunk-I3BTHUK3.js +0 -160
  119. package/chunk-IL6G454L.js +0 -1
  120. package/chunk-IY6KCAQ4.js +0 -1
  121. package/chunk-K4ALA724.js +0 -1
  122. package/chunk-LRI7YFKN.js +0 -1
  123. package/chunk-MPHC4J2R.js +0 -1
  124. package/chunk-NHEN24Y3.js +0 -1
  125. package/chunk-NOZEL54G.js +0 -1
  126. package/chunk-NRULEUE7.js +0 -1
  127. package/chunk-ONMFMNUN.js +0 -129
  128. package/chunk-PDNXU4MC.js +0 -1
  129. package/chunk-R6NK3ROE.js +0 -1
  130. package/chunk-RQ52IUQY.js +0 -130
  131. package/chunk-SRNYKRLK.js +0 -1
  132. package/chunk-TOYTUB2K.js +0 -1
  133. package/chunk-U4SERSDK.js +0 -1
  134. package/chunk-UNWDCLFZ.js +0 -1
  135. package/chunk-UUZOSCEV.js +0 -7
  136. package/chunk-UWWFSGE7.js +0 -1
  137. package/chunk-VDBXI7BY.js +0 -1
  138. package/chunk-VJVWTOYU.js +0 -1
  139. package/chunk-WUPQR4WU.js +0 -1
  140. package/chunk-X26YDRRO.js +0 -1
  141. package/main-LKLXHNSP.js +0 -1
package/chunk-TOYTUB2K.js DELETED
@@ -1 +0,0 @@
1
- import{a as A}from"./chunk-R6XNFCQM.js";import{a as He}from"./chunk-RLR2HFSC.js";import{b as ze}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as re}from"./chunk-K4ALA724.js";import{a as Pe}from"./chunk-DCKLQNGL.js";import{a as P,b as z}from"./chunk-CZWWMQFD.js";import{d as ke,i as Ne,j as Re,k as Me}from"./chunk-CEZEYAWZ.js";import{a as Fe,b as Ve}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import"./chunk-RNOSD5RO.js";import{a as Je,b as De}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 Ie,h as Ae}from"./chunk-RYHNURUZ.js";import{b as Ee,c as Te}from"./chunk-BX74ZLQG.js";import{a as be,b as Ce}from"./chunk-CNLYDNON.js";import{a as v,b as Se,c as we,d as ve,e as ye,f as je}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{b as ae,c as le,e as me,f as pe,k as se,l as de,o as ue,v as ce,y as fe}from"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{c as Z,e as ee,f as te,k as ie,l as ne,m as oe}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ab as W,Ac as T,Cb as g,Ga as D,Jc as I,Kb as d,Kc as Y,Lc as M,Mc as S,Nb as K,Ub as a,Vb as r,Wb as b,X as J,Yc as y,Z as B,_b as j,bb as G,c as F,cb as U,dc as E,ec as f,gb as m,ha as w,pa as h,qa as x,qc as p,rc as C,s as V,sc as k,uc as q,vc as Q,wb as L,wc as N,xc as $,yc as X,zc as R}from"./chunk-WCXWWANV.js";import{a as s,b as c}from"./chunk-YQFG5XE2.js";var Ue={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},H=Se(je(Ue),we(t=>({first:y(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:y(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:y(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:y(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),ye(t=>{let l=w(A);return{updateFilter(n){v(t,i=>c(s({},i),{filter:s(s({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!0}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onRowUnselect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(s({},u),{checked:!1}):u);return c(s({},i),{data:c(s({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){v(t,i=>{let o=i.data.data.map(u=>c(s({},u),{checked:n}));return c(s({},i),{data:c(s({},i.data),{data:o})})})},getGJAdjustmentLoader:P(F(J(()=>l.getGJAdjustmentLoader().pipe(z({next:n=>{v(t,i=>c(s({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:P(F(V(n=>Object.entries(n).reduce((i,[o,u])=>(u!=null&&(i[o]=u),i),{})),J(n=>l.getAdjustmentJournal(n).pipe(V(i=>c(s({},i),{data:i.data.map(o=>c(s({},o),{checked:!1}))})),z({next:i=>{v(t,o=>c(s({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var Le=()=>({height:"calc(100vh - 70px)"}),O=t=>({"ng-invalid ng-dirty":t}),We=()=>({});function Ke(t,l){if(t&1){let e=j();a(0,"p-button",10),E("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function qe(t,l){if(t&1&&g(0,Ke,1,0,"p-button",9),t&2){let e=f();d("ngIf",e.store.hasCheckedRows())}}function Qe(t,l){t&1&&(a(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),p(4,"Outlet"),r(),a(5,"th",14),p(6,"Number"),r(),a(7,"th",15),p(8,"Date"),r(),a(9,"th",14),p(10,"Adjustment Qty"),r(),a(11,"th",13),p(12,"Type"),r(),a(13,"th",16),p(14,"State"),r(),a(15,"th",17),p(16,"Note"),r(),b(17,"th",12),r())}function $e(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",18),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",19),p(7),r()(),a(8,"td"),p(9),I(10,"date"),r(),a(11,"td"),p(12),I(13,"number"),r(),a(14,"td"),p(15),r(),a(16,"td"),p(17),r(),a(18,"td"),b(19,"div",20),r(),a(20,"td"),b(21,"p-button",21),r()()),t&2){let e=l.$implicit,n=f(2);m(2),d("value",e),m(2),C(e.outlet),m(2),d("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,U),m(),k(" ",e.number," "),m(2),C(M(10,12,e.date,"d MMM y")),m(3),C(Y(13,15,e.quantitySUM)),m(3),C(e.type),m(2),C(e.state),m(2),d("innerHTML",e.note,G),m(2),d("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,l){if(t&1&&p(0),t&2){let e=f(2);q(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,l){t&1&&(a(0,"tr")(1,"td",22)(2,"span"),p(3,"No records found."),r()()())}function Ze(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),E("onRowSelect",function(i){h(e);let o=f();return x(o.onRowSelect(i))})("onRowUnselect",function(i){h(e);let o=f();return x(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){h(e);let o=f();return x(o.onHeaderCheckboxToggle(i))})("onPage",function(i){h(e);let o=f();return x(o.onPageChange(i))}),g(2,Qe,18,0,"ng-template",null,3,S)(4,$e,22,17,"ng-template",null,4,S)(6,Xe,1,3,"ng-template",null,5,S)(8,Ye,4,0,"ng-template",null,6,S),r()()}if(t&2){let e=f();K(R(9,Le)),m(),d("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 et(t,l){if(t&1&&(a(0,"span",31),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;d("pTooltip",e.name),m(),k(" ",M(2,2,e.name,30)," ")}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function it(t,l){if(t&1&&(a(0,"div"),g(1,tt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("from"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function ot(t,l){if(t&1&&(a(0,"div"),g(1,nt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("to"))}}function rt(t,l){if(t&1&&(a(0,"div")(1,"span",33),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function at(t,l){if(t&1&&(a(0,"div"),g(1,rt,3,1,"div",32),r()),t&2){let e=f(2);m(),d("ngForOf",e.getErrors("pageSize"))}}function lt(t,l){if(t&1&&(a(0,"form",23)(1,"div",24)(2,"label",25),p(3,"Outlet"),r(),a(4,"p-select",26),g(5,et,3,5,"ng-template",null,7,S),r()(),a(7,"div",24)(8,"label",25),p(9,"From"),r(),b(10,"p-datepicker",27),g(11,it,2,1,"div",28),r(),a(12,"div",24)(13,"label",25),p(14,"To"),r(),b(15,"p-datepicker",29),g(16,ot,2,1,"div",28),r(),a(17,"div",24)(18,"label",25),p(19,"Page Size"),r(),b(20,"input",30),g(21,at,2,1,"div",28),r()()),t&2){let e=f();d("formGroup",e.form),m(4),d("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(6),d("iconDisplay","input")("showIcon",!0)("ngClass",T(14,O,e.isInvalid("from"))),m(),d("ngIf",e.isInvalid("from")),m(4),d("iconDisplay","input")("showIcon",!0)("ngClass",T(16,O,e.isInvalid("to"))),m(),d("ngIf",e.isInvalid("to")),m(4),d("autoNumeric",R(18,We))("ngClass",T(19,O,e.isInvalid("pageSize"))),m(),d("ngIf",e.isInvalid("pageSize"))}}var Kt=(()=>{class t extends Pe{constructor(){super(),this.store=w(H),this.generateJournalService=w(A),this.authService=w(re),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=w(ce),this.dayjsService=w(ze)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,rowCount:u,pageSize:_,export:Oe,exportPageNumber:Be,exportRowCount:Ge}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),rowCount:this.fb.control(u),pageSize:this.fb.control(_,[le.required]),export:this.fb.control(Oe),exportPageNumber:this.fb.control(Be),exportRowCount:this.fb.control(Ge)})}onSearch(e){this.store.updateFilter(c(s({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(s({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(B(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=L({type:t,selectors:[["app-adjustment-journal"]],features:[X([H]),W],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","scrollable","scrollHeight","paginator","rows","totalRecords","lazy"],[2,"width","4rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[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"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=j();a(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),E("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,qe,1,1,"ng-template",null,0,S)(3,Ze,10,10,"ng-template",null,1,S)(5,lt,22,21,"ng-template",null,2,S),r()}n&2&&(d("isSearchableInput",!0)("isFilterable",!0),Q("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible))},dependencies:[Ae,Me,ke,Ne,Re,oe,Z,ee,te,ne,ie,Ce,be,xe,he,Ve,Fe,De,Je,fe,se,ae,me,pe,de,ue,ge,_e,Ie,Te,Ee,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Kt as AdjustmentJournalComponent};
package/chunk-U4SERSDK.js DELETED
@@ -1 +0,0 @@
1
- import{a as Me,b as Fe}from"./chunk-6332DY2I.js";import{b as Te}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as ke,b as ye}from"./chunk-ZHU3HOWQ.js";import"./chunk-Z3SHAW6W.js";import{a as Ie}from"./chunk-DCKLQNGL.js";import"./chunk-DJAICZNR.js";import{a as j,b as V}from"./chunk-CZWWMQFD.js";import{d as Ce,i as Pe,j as we,k as De}from"./chunk-CEZEYAWZ.js";import{a as Se,b as ve}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as C}from"./chunk-C3N6HRIE.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{h as be}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as ue,b as fe}from"./chunk-CNLYDNON.js";import{a as x,b as ge,c as xe,d as he,e as _e,f as Ee,g as Re}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as me,x as de}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{c as F,e as oe,f as ae,l as se,o as le,v as pe,y as ce}from"./chunk-3GHEXAAZ.js";import{a as re}from"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{F as ie,M as ne,c as W,e as X,f as Y,k as Z,l as ee,m as te}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ab as G,Ac as I,Cb as h,D as L,Jc as T,Kb as f,Kc as J,L as N,Lc as Q,Mc as R,Nb as q,O as A,Ub as a,Vb as o,Wb as _,X as D,Yc as M,Z as U,_b as k,ba as O,c as w,dc as y,ec as g,gb as d,ha as u,pa as S,qa as v,qc as m,rc as E,s as b,sc as $,wb as B,yc as K,zc as z}from"./chunk-WCXWWANV.js";import{a as s,b as p}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=u(re)}getPostRecurringExpenseLoader(){return this.httpService.get(void 0,"api/RecurringExpenseLoader/RecurringExpensesGenerate")}previewPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGeneratePreview",e)}submitPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGenerate",e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=O({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ve={data:{data:[]},meta:{options:{expenses:[]},form:{date:"",number:"",listIDs:[]}},filter:{date:"",number:"",listIDs:[]}},H=ge(Ee(Ve),Re("PostRecurringExpenseStore"),xe(t=>({hasCheckedRows:M(()=>t.data().data.some(l=>l.checked)),checkedPRE:M(()=>t.data().data.filter(l=>l.checked))})),_e(t=>{let l=u(P);return{updateFilter:i=>{x(t,n=>p(s({},n),{filter:s(s({},n.filter),i)}))},emptyData(){x(t,i=>p(s({},i),{data:{data:[],totalCount:0}}))},onRowSelect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!0}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onRowUnselect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!1}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){x(t,n=>{let r=n.data.data.map(c=>p(s({},c),{checked:i}));return p(s({},n),{data:p(s({},n.data),{data:r})})})},getPRELoader:j(w(D(()=>l.getPostRecurringExpenseLoader().pipe(V({next:i=>{x(t,n=>p(s({},n),{meta:i}))},error:i=>{console.error("Error fetching PRE Loader:",i)}}))))),getPREPreview:j(w(L(i=>i.date&&i.listIDs.length>0),b(i=>({Date:i.date,Number:i.number,ListIDs:i.listIDs})),D(i=>l.previewPostRecurringExpense(i).pipe(b(n=>p(s({},n),{data:n.data.map(r=>p(s({},r),{checked:!1}))})),V({next:n=>{x(t,r=>p(s({},r),{data:n}))},error:n=>{console.error("Error fetching PRE Preview:",n)}})))))}}),he(t=>({onInit:()=>{t.getPRELoader(),t.getPREPreview(t.filter)}})));var He=()=>({height:"calc(100vh - 70px)"}),Le=t=>({"ng-invalid ng-dirty":t}),Ne=t=>["/pages/recurring/recurring-expense/details/",t];function Ae(t,l){if(t&1){let e=k();a(0,"p-button",7),y("onClick",function(){S(e);let n=g(2);return v(n.onSubmitPRE())}),o()}}function Ue(t,l){if(t&1&&h(0,Ae,1,0,"p-button",6),t&2){let e=g();f("ngIf",e.store.hasCheckedRows())}}function Oe(t,l){if(t&1&&(a(0,"div")(1,"span",19),m(2),o()()),t&2){let e=l.$implicit;d(2),E(e)}}function Be(t,l){if(t&1&&(a(0,"div"),h(1,Oe,3,1,"div",18),o()),t&2){let e=g(2);d(),f("ngForOf",e.getErrors("listIDs"))}}function Ge(t,l){t&1&&(a(0,"tr")(1,"th",20),_(2,"p-tableHeaderCheckbox"),o(),a(3,"th"),m(4,"Name"),o(),a(5,"th"),m(6,"Date"),o(),a(7,"th"),m(8,"Asset Account"),o(),a(9,"th"),m(10,"Expense Account"),o(),a(11,"th",21),m(12,"Amount"),o()())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),_(2,"p-tableCheckbox",22),o(),a(3,"td")(4,"a",23),m(5),o()(),a(6,"td"),m(7),T(8,"date"),o(),a(9,"td"),m(10),o(),a(11,"td"),m(12),o(),a(13,"td",21),m(14),T(15,"number"),o()()),t&2){let e=l.$implicit;d(2),f("value",e),d(2),f("routerLink",I(12,Ne,e.id)),d(),$(" ",e.name," "),d(2),E(Q(8,7,e.nextExpenseDate,"d MMM y")),d(3),E(e.paymentName),d(2),E(e.expenseName),d(2),E(J(15,10,e.amount))}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function Ke(t,l){if(t&1){let e=k();a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12)(6,"label",13),m(7,"Date"),o(),_(8,"p-datepicker",14),o()(),a(9,"div",11)(10,"div",12)(11,"label",13),m(12,"Recurring Expense"),o(),_(13,"p-multiselect",15),h(14,Be,2,1,"div",16),o()()()()(),_(15,"p-divider"),a(16,"p-table",17),y("onRowSelect",function(n){S(e);let r=g();return v(r.onRowSelect(n))})("onRowUnselect",function(n){S(e);let r=g();return v(r.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let r=g();return v(r.onHeaderCheckboxToggle(n))}),h(17,Ge,13,0,"ng-template",null,2,R)(19,qe,16,14,"ng-template",null,3,R)(21,$e,4,0,"ng-template",null,4,R),o()()}if(t&2){let e=g();q(z(9,He)),d(),f("formGroup",e.form),d(12),f("ngClass",I(10,Le,e.isInvalid("listIDs")))("options",e.store.meta().options.expenses),d(),f("ngIf",e.isInvalid("listIDs")),d(2),f("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 200px)")}}var jt=(()=>{class t extends Ie{constructor(){super(),this.store=u(H),this.fb=u(pe),this.dayjsService=u(Te),this.PREService=u(P)}ngOnInit(){this.initForm(),this.form.valueChanges.pipe(N(300),A(),C("Form Value Changes"),b(e=>Object.entries(e).reduce((i,[n,r])=>{switch(n){case"date":typeof r=="object"&&r!==null&&!Array.isArray(r)?i[n]=this.dayjsService.from(r)?this.dayjsService.format(r):null:(typeof r=="string"||typeof r=="number"||r instanceof Date)&&!Array.isArray(r)?i[n]=r!=null?String(r):null:i[n]=null;break;default:i[n]=r===null?"":r;break}return i},{})),C("Mapped Form Value"),U(e=>{(!e.listIDs||e.listIDs.length===0)&&this.store.emptyData(),this.store.updateFilter(e)})).subscribe()}initForm(){let{date:e,listIDs:i,number:n}=this.store.filter();this.form=this.fb.group({date:this.fb.control(this.dayjsService.from(e)?this.dayjsService.from(e).toDate():this.dayjsService.now.toDate(),[F.required]),number:this.fb.control(n||""),listIDs:this.fb.control(i,[F.required])})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(i=>{this.store.onRowUnselect(i)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onSubmitPRE(){console.log(this.store.checkedPRE());let i=this.store.checkedPRE().reduce((r,c)=>(r[c.id]||(r[c.id]={ID:c.id,ListDate:[]}),r[c.id].ListDate.push(c.lastExpenseDate),r),{}),n=Object.values(i);console.log("Submitting PRE with body:",n),this.PREService.submitPostRecurringExpense(n).pipe(C("Submit Post Recurring Expense")).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-post-recurring-expense"]],features:[K([H]),G],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["emptymessage",""],["pageTitle","Post Recurring Expense"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"row"],[1,"col"],[1,"d-flex","flex-column"],["for",""],["fluid","","formControlName","date"],["display","chip","formControlName","listIDs","optionLabel","name","optionValue","id","placeholder","Select Recurring Expenses","fluid","",3,"ngClass","options"],[4,"ngIf"],["dataKey","lastExpenseDate",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","scrollable","scrollHeight"],[4,"ngFor","ngForOf"],[1,"text-danger"],[2,"width","4rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(i,n){i&1&&(a(0,"app-main-panel",5),h(1,Ue,1,1,"ng-template",null,0,R)(3,Ke,23,12,"ng-template",null,1,R),o())},dependencies:[be,te,W,X,Y,ee,Z,fe,ue,Fe,Me,ve,Se,ye,ke,ce,oe,ae,se,le,De,Ce,Pe,we,de,me,ne,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{jt as PostRecurringExpenseComponent};
package/chunk-UNWDCLFZ.js DELETED
@@ -1 +0,0 @@
1
- import{J as U,N as m,Qc as $,V,X as P,ba as c,ca as G,ea as w,ga as l,m as o,mb as F,o as u,s as E,ta as T,w as _,x as A,xb as B,y as K,za as p,zb as H}from"./chunk-WCXWWANV.js";import{a as S}from"./chunk-YQFG5XE2.js";var L=class{},q=(()=>{class n extends L{getTranslation(e){return o({})}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(n)))(i||n)}})();static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})(),D=class{},J=(()=>{class n{handle(e){return e.key}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})();function y(n,r){if(n===r)return!0;if(n===null||r===null)return!1;if(n!==n&&r!==r)return!0;let e=typeof n,t=typeof r,i,s,a;if(e==t&&e=="object")if(Array.isArray(n)){if(!Array.isArray(r))return!1;if((i=n.length)==r.length){for(s=0;s<i;s++)if(!y(n[s],r[s]))return!1;return!0}}else{if(Array.isArray(r))return!1;a=Object.create(null);for(s in n){if(!y(n[s],r[s]))return!1;a[s]=!0}for(s in r)if(!(s in a)&&typeof r[s]<"u")return!1;return!0}return!1}function h(n){return typeof n<"u"&&n!==null}function M(n){return n&&typeof n=="object"&&!Array.isArray(n)}function W(n,r){let e=Object.assign({},n);return M(n)&&M(r)&&Object.keys(r).forEach(t=>{M(r[t])?t in n?e[t]=W(n[t],r[t]):Object.assign(e,{[t]:r[t]}):Object.assign(e,{[t]:r[t]})}),e}var C=class{},X=(()=>{class n extends C{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,t){let i;return typeof e=="string"?i=this.interpolateString(e,t):typeof e=="function"?i=this.interpolateFunction(e,t):i=e,i}getValue(e,t){let i=typeof t=="string"?t.split("."):[t];t="";do t+=i.shift(),h(e)&&h(e[t])&&(typeof e[t]=="object"||!i.length)?(e=e[t],t=""):i.length?t+=".":e=void 0;while(i.length);return e}interpolateFunction(e,t){return e(t)}interpolateString(e,t){return t?e.replace(this.templateMatcher,(i,s)=>{let a=this.getValue(t,s);return h(a)?a:i}):e}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(n)))(i||n)}})();static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})(),v=class{},z=(()=>{class n extends v{compile(e,t){return e}compileTranslations(e,t){return e}static \u0275fac=(()=>{let e;return function(i){return(e||(e=T(n)))(i||n)}})();static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})(),j=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new p;onLangChange=new p;onDefaultLangChange=new p},R=new w("USE_STORE"),I=new w("USE_DEFAULT_LANG"),N=new w("DEFAULT_LANGUAGE"),O=new w("USE_EXTEND"),x=(()=>{class n{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;isolate;extend;loadingTranslations;pending=!1;_onTranslationChange=new p;_onLangChange=new p;_onDefaultLangChange=new p;_defaultLang;_currentLang;_langs=[];_translations={};_translationRequests={};get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(e){this.isolate?this._defaultLang=e:this.store.defaultLang=e}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(e){this.isolate?this._currentLang=e:this.store.currentLang=e}get langs(){return this.isolate?this._langs:this.store.langs}set langs(e){this.isolate?this._langs=e:this.store.langs=e}get translations(){return this.isolate?this._translations:this.store.translations}set translations(e){this.isolate?this._translations=e:this.store.translations=e}constructor(e,t,i,s,a,f=!0,g=!1,d=!1,b){this.store=e,this.currentLoader=t,this.compiler=i,this.parser=s,this.missingTranslationHandler=a,this.useDefaultLang=f,this.isolate=g,this.extend=d,b&&this.setDefaultLang(b)}setDefaultLang(e){if(e===this.defaultLang)return;let t=this.retrieveTranslations(e);typeof t<"u"?(this.defaultLang==null&&(this.defaultLang=e),t.pipe(m(1)).subscribe(i=>{this.changeDefaultLang(e)})):this.changeDefaultLang(e)}getDefaultLang(){return this.defaultLang}use(e){if(e===this.currentLang)return o(this.translations[e]);let t=this.retrieveTranslations(e);return typeof t<"u"?(this.currentLang||(this.currentLang=e),t.pipe(m(1)).subscribe(i=>{this.changeLang(e)}),t):(this.changeLang(e),o(this.translations[e]))}retrieveTranslations(e){let t;return(typeof this.translations[e]>"u"||this.extend)&&(this._translationRequests[e]=this._translationRequests[e]||this.getTranslation(e),t=this._translationRequests[e]),t}getTranslation(e){this.pending=!0;let t=this.currentLoader.getTranslation(e).pipe(V(1),m(1));return this.loadingTranslations=t.pipe(E(i=>this.compiler.compileTranslations(i,e)),V(1),m(1)),this.loadingTranslations.subscribe({next:i=>{this.translations[e]=this.extend&&this.translations[e]?S(S({},i),this.translations[e]):i,this.updateLangs(),this.pending=!1},error:i=>{this.pending=!1}}),t}setTranslation(e,t,i=!1){t=this.compiler.compileTranslations(t,e),(i||this.extend)&&this.translations[e]?this.translations[e]=W(this.translations[e],t):this.translations[e]=t,this.updateLangs(),this.onTranslationChange.emit({lang:e,translations:this.translations[e]})}getLangs(){return this.langs}addLangs(e){e.forEach(t=>{this.langs.indexOf(t)===-1&&this.langs.push(t)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResult(e,t,i){let s;if(t instanceof Array){let a={},f=!1;for(let g of t)a[g]=this.getParsedResult(e,g,i),u(a[g])&&(f=!0);if(f){let g=t.map(d=>u(a[d])?a[d]:o(a[d]));return K(g).pipe(E(d=>{let b={};return d.forEach((Z,Q)=>{b[t[Q]]=Z}),b}))}return a}if(e&&(s=this.parser.interpolate(this.parser.getValue(e,t),i)),typeof s>"u"&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(s=this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang],t),i)),typeof s>"u"){let a={key:t,translateService:this};typeof i<"u"&&(a.interpolateParams=i),s=this.missingTranslationHandler.handle(a)}return typeof s<"u"?s:t}get(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');if(this.pending)return this.loadingTranslations.pipe(U(i=>(i=this.getParsedResult(i,e,t),u(i)?i:o(i))));{let i=this.getParsedResult(this.translations[this.currentLang],e,t);return u(i)?i:o(i)}}getStreamOnTranslationChange(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return _(A(()=>this.get(e,t)),this.onTranslationChange.pipe(P(i=>{let s=this.getParsedResult(i.translations,e,t);return typeof s.subscribe=="function"?s:o(s)})))}stream(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');return _(A(()=>this.get(e,t)),this.onLangChange.pipe(P(i=>{let s=this.getParsedResult(i.translations,e,t);return u(s)?s:o(s)})))}instant(e,t){if(!h(e)||!e.length)throw new Error('Parameter "key" required');let i=this.getParsedResult(this.translations[this.currentLang],e,t);if(u(i)){if(e instanceof Array){let s={};return e.forEach((a,f)=>{s[e[f]]=e[f]}),s}return e}else return i}set(e,t,i=this.currentLang){this.translations[i][e]=this.compiler.compile(t,i),this.updateLangs(),this.onTranslationChange.emit({lang:i,translations:this.translations[i]})}changeLang(e){this.currentLang=e,this.onLangChange.emit({lang:e,translations:this.translations[e]}),this.defaultLang==null&&this.changeDefaultLang(e)}changeDefaultLang(e){this.defaultLang=e,this.onDefaultLangChange.emit({lang:e,translations:this.translations[e]})}reloadLang(e){return this.resetLang(e),this.getTranslation(e)}resetLang(e){this._translationRequests[e]=void 0,this.translations[e]=void 0}getBrowserLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;if(e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,!(typeof e>"u"))return e.indexOf("-")!==-1&&(e=e.split("-")[0]),e.indexOf("_")!==-1&&(e=e.split("_")[0]),e}getBrowserCultureLang(){if(typeof window>"u"||typeof window.navigator>"u")return;let e=window.navigator.languages?window.navigator.languages[0]:null;return e=e||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,e}static \u0275fac=function(t){return new(t||n)(l(j),l(L),l(v),l(C),l(D),l(I),l(R),l(O),l(N))};static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})();var he=(()=>{class n{translate;_ref;value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onDefaultLangChange;constructor(e,t){this.translate=e,this._ref=t}updateValue(e,t,i){let s=a=>{this.value=a!==void 0?a:e,this.lastKey=e,this._ref.markForCheck()};if(i){let a=this.translate.getParsedResult(i,e,t);u(a.subscribe)?a.subscribe(s):s(a)}this.translate.get(e,t).subscribe(s)}transform(e,...t){if(!e||!e.length)return e;if(y(e,this.lastKey)&&y(t,this.lastParams))return this.value;let i;if(h(t[0])&&t.length)if(typeof t[0]=="string"&&t[0].length){let s=t[0].replace(/(\')?([a-zA-Z0-9_]+)(\')?(\s)?:/g,'"$2":').replace(/:(\s)?(\')(.*?)(\')/g,':"$3"');try{i=JSON.parse(s)}catch{throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${t[0]}`)}}else typeof t[0]=="object"&&!Array.isArray(t[0])&&(i=t[0]);return this.lastKey=e,this.lastParams=t,this.updateValue(e,i),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(s=>{this.lastKey&&s.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(s=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(t){return new(t||n)(F(x,16),F($,16))};static \u0275pipe=H({name:"translate",type:n,pure:!1,standalone:!1});static \u0275prov=c({token:n,factory:n.\u0275fac})}return n})(),fe=(()=>{class n{static forRoot(e={}){return{ngModule:n,providers:[e.loader||{provide:L,useClass:q},e.compiler||{provide:v,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:D,useClass:J},j,{provide:R,useValue:e.isolate},{provide:I,useValue:e.useDefaultLang},{provide:O,useValue:e.extend},{provide:N,useValue:e.defaultLanguage},x]}}static forChild(e={}){return{ngModule:n,providers:[e.loader||{provide:L,useClass:q},e.compiler||{provide:v,useClass:z},e.parser||{provide:C,useClass:X},e.missingTranslationHandler||{provide:D,useClass:J},{provide:R,useValue:e.isolate},{provide:I,useValue:e.useDefaultLang},{provide:O,useValue:e.extend},{provide:N,useValue:e.defaultLanguage},x]}}static \u0275fac=function(t){return new(t||n)};static \u0275mod=B({type:n});static \u0275inj=G({})}return n})();export{L as a,he as b,fe as c};
package/chunk-UUZOSCEV.js DELETED
@@ -1,7 +0,0 @@
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};
package/chunk-UWWFSGE7.js DELETED
@@ -1 +0,0 @@
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};
package/chunk-VDBXI7BY.js DELETED
@@ -1 +0,0 @@
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};
package/chunk-VJVWTOYU.js DELETED
@@ -1 +0,0 @@
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};
package/chunk-WUPQR4WU.js DELETED
@@ -1 +0,0 @@
1
- var e={production:!0,version:"1.9.8",changelogUrl:"https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=1.0.9",defaultTimezone:"Asia/Jakarta"};export{e as a};
package/chunk-X26YDRRO.js DELETED
@@ -1 +0,0 @@
1
- import{a as V,b as oe}from"./chunk-KHP7E7JG.js";import"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as te,b as ie}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as K,b as Q}from"./chunk-W4KTL6Y6.js";import{a as ne,b as re}from"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import{b as ee}from"./chunk-7IPVVF6Y.js";import{h as $}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as Y,b as Z}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as U,x as X}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{e as G,j as H,x as q}from"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import{a as A}from"./chunk-TDMJ2M6W.js";import{i as z,m as R}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Cb as L,Ga as b,Jc as T,Kb as u,Kc as P,Mc as M,Nb as S,Ub as r,V as E,Vb as o,Wb as C,X as B,Z as W,_b as h,dc as f,ec as m,gb as s,h as J,ha as x,pa as l,qa as p,qc as _,ra as I,s as y,sa as N,vc as c,wb as O,wc as g,xc as d,yc as j,zc as F}from"./chunk-WCXWWANV.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:50,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};