dealposbooks 5.51.0 → 5.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/{chunk-RFHL2MJ4.js → chunk-2P6N6225.js} +1 -1
  2. package/{chunk-JPKZVL57.js → chunk-3NF5ANCH.js} +1 -1
  3. package/{chunk-NTVIX4GB.js → chunk-4EGQ563G.js} +1 -1
  4. package/{chunk-YMV3SC73.js → chunk-5DAIWPJH.js} +1 -1
  5. package/{chunk-R45WWOYD.js → chunk-5UVNTB7W.js} +1 -1
  6. package/{chunk-GQ7SPEZH.js → chunk-6YXA7GFO.js} +1 -1
  7. package/{chunk-OILVKUFA.js → chunk-7QQAIIXC.js} +1 -1
  8. package/{chunk-2RXAK5B6.js → chunk-BPJERO47.js} +2 -2
  9. package/{chunk-QXE4YYQV.js → chunk-CNWZ52LV.js} +1 -1
  10. package/{chunk-GN7VAGHH.js → chunk-CYTZBS64.js} +1 -1
  11. package/{chunk-LF4HTMCE.js → chunk-DJAA5EF6.js} +1 -1
  12. package/{chunk-4GZGUASQ.js → chunk-DOPSA7V7.js} +1 -1
  13. package/chunk-EZGBB4MD.js +1 -0
  14. package/{chunk-VQ62YSFR.js → chunk-H6JPNVHO.js} +1 -1
  15. package/{chunk-ILQI2X5T.js → chunk-HK6564XM.js} +1 -1
  16. package/{chunk-KBJ25I3J.js → chunk-HKEKJASB.js} +1 -1
  17. package/{chunk-32QC4JFI.js → chunk-HUNIPNEV.js} +1 -1
  18. package/{chunk-2U3PIWWJ.js → chunk-I2SBX2TZ.js} +1 -1
  19. package/{chunk-7GORVGAV.js → chunk-IBPU4HMB.js} +1 -1
  20. package/{chunk-WPHZJHC6.js → chunk-ICDJTXVE.js} +1 -1
  21. package/{chunk-ELZ5FFFM.js → chunk-ITGMU5MB.js} +1 -1
  22. package/{chunk-VABCBO2E.js → chunk-IVCIH4GN.js} +1 -1
  23. package/{chunk-L27GCER2.js → chunk-JK2F33M6.js} +2 -2
  24. package/{chunk-F4PHXCVU.js → chunk-KR465WRL.js} +1 -1
  25. package/{chunk-D5WBKKO2.js → chunk-L5IWZ4Y2.js} +1 -1
  26. package/{chunk-ZLBNHUZF.js → chunk-LRD5A6EL.js} +1 -1
  27. package/{chunk-KJM3M7Y3.js → chunk-LTIBX74D.js} +1 -1
  28. package/{chunk-GEYRJ2MR.js → chunk-M2RAH7HZ.js} +1 -1
  29. package/{chunk-OKT36WED.js → chunk-NBWU3VSN.js} +1 -1
  30. package/{chunk-EDYUAYO2.js → chunk-NGMAZPWL.js} +1 -1
  31. package/{chunk-QSIXT7W7.js → chunk-Q4WVEWIJ.js} +1 -1
  32. package/{chunk-E57RWXDG.js → chunk-QQYGISGZ.js} +1 -1
  33. package/{chunk-DAN3PD7R.js → chunk-RBJEQZ2O.js} +1 -1
  34. package/{chunk-HYOAHRKW.js → chunk-RK23P4VG.js} +1 -1
  35. package/{chunk-TOAH3PY3.js → chunk-RSAW2IGP.js} +1 -1
  36. package/{chunk-BVHTVDYP.js → chunk-S36SGADP.js} +1 -1
  37. package/{chunk-7ET5ZE2L.js → chunk-SXKPF3GY.js} +1 -1
  38. package/{chunk-3RODMLL2.js → chunk-TRH6BRRC.js} +1 -1
  39. package/{chunk-7F5JJ627.js → chunk-TZH35FNY.js} +2 -2
  40. package/{chunk-NSMNMKCV.js → chunk-UCJ6JQWA.js} +1 -1
  41. package/{chunk-BT4SLG45.js → chunk-UPBPXKNV.js} +1 -1
  42. package/{chunk-KXWAD3X4.js → chunk-VQM5QCPU.js} +1 -1
  43. package/{chunk-5XVZW6BJ.js → chunk-W6SE4LJW.js} +1 -1
  44. package/{chunk-ZOMQLK4A.js → chunk-WZ5LBHF5.js} +1 -1
  45. package/{chunk-KU4BYYJE.js → chunk-WZ6BCBDQ.js} +1 -1
  46. package/{chunk-MCR6MBS2.js → chunk-YAFMVKX5.js} +1 -1
  47. package/{chunk-MWRTPPEI.js → chunk-YB424QNC.js} +1 -1
  48. package/{chunk-J346SEEU.js → chunk-YCOTHSE5.js} +1 -1
  49. package/{chunk-MHM3ED4J.js → chunk-Z2KELIGC.js} +1 -1
  50. package/{chunk-B7TGZ7J3.js → chunk-ZRPU3QYR.js} +1 -1
  51. package/{chunk-JPNJTPYJ.js → chunk-ZVDGEDMP.js} +1 -1
  52. package/{chunk-DM42MH3E.js → chunk-ZZLTM7V6.js} +1 -1
  53. package/index.html +2 -2
  54. package/{main-ET3JU27S.js → main-6DNI2R4P.js} +1 -1
  55. package/package.json +1 -1
  56. package/chunk-CPAPQNFC.js +0 -1
@@ -1,8 +1,8 @@
1
- import{a as Oe,b as je,c as Je,d as ze}from"./chunk-SLD7RSX6.js";import{a as Ue,b as He}from"./chunk-GIRWHO6Q.js";import{a as Ge}from"./chunk-SVGPDGYN.js";import{a as v}from"./chunk-52PEVPZN.js";import{b as Ne}from"./chunk-JPNJTPYJ.js";import"./chunk-ZC7ZENN7.js";import{m as J}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{b as Pe,g as Ve,h as Be,i as Q}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ie,b as Me}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Re}from"./chunk-BT7Y4ADP.js";import{a as De,b as Ee}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ke}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as S}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as I,b as M}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as q,o as E,w as k,x as K}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{Ia as D,b as T,c as ce,e as A,f as z,j as we,m as U,n as Te,o as Ae,p as H,v as W,x as $,y as L}from"./chunk-MGIEURA2.js";import{b as ve}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import{a as ye}from"./chunk-G3BJCT7T.js";import{a as Fe}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ge,l as xe,m as be,s as Se,u as w}from"./chunk-DM2JLWKE.js";import{Dc as j,Eb as d,Ec as oe,Fc as ie,Ha as B,L as pe,Mb as f,Oc as re,Pb as ne,Pc as ae,Rb as y,Sb as fe,Sc as u,Ub as he,Vb as _e,Wb as i,Xb as r,Yb as C,Z as de,_ as V,ac as g,bd as le,ca as ue,fc as x,g as me,gc as l,ia as p,ib as s,ob as te,qa as h,ra as _,s as se,sc as a,tc as Ce,uc as F,xc as N,yb as b,yc as G,zc as O}from"./chunk-6QJHEOXN.js";import{a as R,b as P}from"./chunk-YQFG5XE2.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),d(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),y(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datePicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",28),a(2),r(),i(3,"td"),C(4,"input",29),r(),i(5,"td"),C(6,"input",30),r()()),t&2){let e,n=c.$implicit,o=c.index,m=l(4);f("formGroupName",o),s(2),F(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),d(14,mt,7,2,"tr",27),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);f("formGroupName",n),s(2),F(" ",e.get("name").value," "),s(12),f("ngForOf",o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),d(1,ct,4,0,"ng-template",null,2,u),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),he(6,st,15,3,"div",10,fe),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),re(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),re(21,"number"),r()()()()()()),t&2){let e=l(2);ne(oe(11,it)),f("formGroup",e.formGroups),s(4),ne(oe(12,rt)),s(2),_e(e.formsArray.controls),s(10),F(" ",ae(17,7,e.subtotalDebit)," "),s(4),F(" ",ae(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&d(0,pt,22,13,"p-panel",7),t&2){let e=l();f("ngIf",e.formGroups)}}var Le=(()=>{class t{constructor(){this.destroy$=new me,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p(W),this.accSetupService=p(v),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(ve),this.roleService=p(J)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(pe(300),de(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(se(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Y,Z)=>{let ee=Z.get("debitAmount").value||0;return Y+ee},0),tt=o.controls.reduce((Y,Z)=>{let ee=Z.get("creditAmount").value||0;return Y+ee},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
1
+ import{a as Oe,b as je,c as Je,d as ze}from"./chunk-SLD7RSX6.js";import{a as Ue,b as He}from"./chunk-GIRWHO6Q.js";import{a as Ge}from"./chunk-SVGPDGYN.js";import{a as v}from"./chunk-52PEVPZN.js";import{b as Ne}from"./chunk-ZVDGEDMP.js";import"./chunk-ZC7ZENN7.js";import{m as J}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{b as Pe,g as Ve,h as Be,i as Q}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ie,b as Me}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Re}from"./chunk-BT7Y4ADP.js";import{a as De,b as Ee}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ke}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as S}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as I,b as M}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as q,o as E,w as k,x as K}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{Ia as D,b as T,c as ce,e as A,f as z,j as we,m as U,n as Te,o as Ae,p as H,v as W,x as $,y as L}from"./chunk-MGIEURA2.js";import{b as ve}from"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import{a as ye}from"./chunk-G3BJCT7T.js";import{a as Fe}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ge,l as xe,m as be,s as Se,u as w}from"./chunk-DM2JLWKE.js";import{Dc as j,Eb as d,Ec as oe,Fc as ie,Ha as B,L as pe,Mb as f,Oc as re,Pb as ne,Pc as ae,Rb as y,Sb as fe,Sc as u,Ub as he,Vb as _e,Wb as i,Xb as r,Yb as C,Z as de,_ as V,ac as g,bd as le,ca as ue,fc as x,g as me,gc as l,ia as p,ib as s,ob as te,qa as h,ra as _,s as se,sc as a,tc as Ce,uc as F,xc as N,yb as b,yc as G,zc as O}from"./chunk-6QJHEOXN.js";import{a as R,b as P}from"./chunk-YQFG5XE2.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),d(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),y(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datePicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",28),a(2),r(),i(3,"td"),C(4,"input",29),r(),i(5,"td"),C(6,"input",30),r()()),t&2){let e,n=c.$implicit,o=c.index,m=l(4);f("formGroupName",o),s(2),F(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),d(14,mt,7,2,"tr",27),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);f("formGroupName",n),s(2),F(" ",e.get("name").value," "),s(12),f("ngForOf",o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),d(1,ct,4,0,"ng-template",null,2,u),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),he(6,st,15,3,"div",10,fe),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),re(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),re(21,"number"),r()()()()()()),t&2){let e=l(2);ne(oe(11,it)),f("formGroup",e.formGroups),s(4),ne(oe(12,rt)),s(2),_e(e.formsArray.controls),s(10),F(" ",ae(17,7,e.subtotalDebit)," "),s(4),F(" ",ae(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&d(0,pt,22,13,"p-panel",7),t&2){let e=l();f("ngIf",e.formGroups)}}var Le=(()=>{class t{constructor(){this.destroy$=new me,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p(W),this.accSetupService=p(v),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(ve),this.roleService=p(J)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(pe(300),de(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(se(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Y,Z)=>{let ee=Z.get("debitAmount").value||0;return Y+ee},0),tt=o.controls.reduce((Y,Z)=>{let ee=Z.get("creditAmount").value||0;return Y+ee},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
2
2
  width`,`calc(
3
3
  100% - 243px
4
4
  )`,`/* adjust width to fit the remaining space */
5
5
  z-index`,"91","background-color","white",`/* added background */
6
6
  /* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
7
7
  padding`,"8px 0",`/* added padding for height */
8
- border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,lt,2,1,"ng-template",null,0,u)(3,dt,1,1,"ng-template",null,1,u),r(),C(5,"p-toast",4)),n&2&&f("scrollable",!0)},dependencies:[S,ke,w,xe,be,Se,Me,Ie,Q,Ee,De,$,T,A,z,E,Je,K,k,M,I,Ge,L,U,H,Te,Ae,He,Ue],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),d(2,ht,5,0,"ng-template",null,2,u),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),f("formGroup",e.credentialForm),s(5),f("ngClass",ie(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),f("ngClass",ie(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ce.required]],clientSecret:["",[ce.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(te(W),te(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,ft,4,0,"ng-template",null,0,u)(3,_t,15,7,"ng-template",null,1,u),r())},dependencies:[w,ge,L,T,A,z,U,H,E,q,M,I,S,K,k,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){h(e);let o=l(2);return _(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&d(0,Ct,2,0,"button",4),t&2){let e=l();y(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),d(2,xt,6,0,"ng-template",null,2,u),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){h(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),_(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(v),this.subdomain=B(""),this.toastrService=p(Fe),this.roleService=p(J)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,gt,1,1,"ng-template",null,0,u)(3,bt,12,1,"ng-template",null,1,u),r())},dependencies:[w,$,T,A,we,E,q,S,M,I,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(v).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(ye)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function St(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.onFlushCached())}),r()()}}function vt(t,c){if(t&1&&d(0,St,2,0,"div",5),t&2){let e=l();y(e.isAnyCacheSelected?0:-1)}}function Ft(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function yt(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),f("value",e),s(2),F(" ",e.label," "),s(2),Ce(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){h(e);let m=l();return _(m.onRowSelect(o))})("onRowUnselect",function(o){h(e);let m=l();return _(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){h(e);let m=l();return _(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){h(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),_(o)}),d(1,Ft,7,0,"ng-template",null,2,u)(3,yt,7,3,"ng-template",null,3,u),r()}if(t&2){let e=l();f("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=le(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=le(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),d(1,vt,1,1,"ng-template",null,0,u)(3,wt,5,6,"ng-template",null,1,u),r()),n&2&&f("overflowScroll",!0)("showCancelButton",!1)},dependencies:[S,Q,Pe,Ve,Be,k],encapsulation:2})}}return t})();var Qn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-F4PHXCVU.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-NSMNMKCV.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-OILVKUFA.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-MCR6MBS2.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-RFHL2MJ4.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-7GORVGAV.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-KU4BYYJE.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-ZLBNHUZF.js").then(t=>t.ClosingFormComponent)}]}];export{Qn as ACCOUNTING_SETUP_ROUTES};
8
+ border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,lt,2,1,"ng-template",null,0,u)(3,dt,1,1,"ng-template",null,1,u),r(),C(5,"p-toast",4)),n&2&&f("scrollable",!0)},dependencies:[S,ke,w,xe,be,Se,Me,Ie,Q,Ee,De,$,T,A,z,E,Je,K,k,M,I,Ge,L,U,H,Te,Ae,He,Ue],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),d(2,ht,5,0,"ng-template",null,2,u),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),f("formGroup",e.credentialForm),s(5),f("ngClass",ie(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),f("ngClass",ie(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ce.required]],clientSecret:["",[ce.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(te(W),te(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,ft,4,0,"ng-template",null,0,u)(3,_t,15,7,"ng-template",null,1,u),r())},dependencies:[w,ge,L,T,A,z,U,H,E,q,M,I,S,K,k,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){h(e);let o=l(2);return _(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&d(0,Ct,2,0,"button",4),t&2){let e=l();y(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),d(2,xt,6,0,"ng-template",null,2,u),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){h(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),_(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(v),this.subdomain=B(""),this.toastrService=p(Fe),this.roleService=p(J)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,gt,1,1,"ng-template",null,0,u)(3,bt,12,1,"ng-template",null,1,u),r())},dependencies:[w,$,T,A,we,E,q,S,M,I,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(v).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(ye)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function St(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.onFlushCached())}),r()()}}function vt(t,c){if(t&1&&d(0,St,2,0,"div",5),t&2){let e=l();y(e.isAnyCacheSelected?0:-1)}}function Ft(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function yt(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),f("value",e),s(2),F(" ",e.label," "),s(2),Ce(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){h(e);let m=l();return _(m.onRowSelect(o))})("onRowUnselect",function(o){h(e);let m=l();return _(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){h(e);let m=l();return _(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){h(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),_(o)}),d(1,Ft,7,0,"ng-template",null,2,u)(3,yt,7,3,"ng-template",null,3,u),r()}if(t&2){let e=l();f("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=le(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=le(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),d(1,vt,1,1,"ng-template",null,0,u)(3,wt,5,6,"ng-template",null,1,u),r()),n&2&&f("overflowScroll",!0)("showCancelButton",!1)},dependencies:[S,Q,Pe,Ve,Be,k],encapsulation:2})}}return t})();var Qn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-KR465WRL.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-UCJ6JQWA.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-7QQAIIXC.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-YAFMVKX5.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-2P6N6225.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-IBPU4HMB.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-WZ6BCBDQ.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-LRD5A6EL.js").then(t=>t.ClosingFormComponent)}]}];export{Qn as ACCOUNTING_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{a as T,b as J}from"./chunk-NTVIX4GB.js";import"./chunk-JPNJTPYJ.js";import{m as j}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as R,b as O}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import{a as V}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as C,Ec as v,Mb as m,Oc as c,Pb as y,Pc as l,Rb as h,Sc as S,W as M,Wb as n,Xb as o,Y as k,Yb as u,_ as A,ac as x,fc as P,gc as a,h as b,ia as s,ib as r,qa as g,ra as _,s as f,sa as B,ta as w,yb as $}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,d){if(t&1){let e=x();n(0,"p-button",6),P("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,d){if(t&1){let e=x();n(0,"p-button",7),c(1,"async"),c(2,"async"),P("onClick",function(){g(e);let p=a(2);return _(p.migratePaymentAccount())}),o()}if(t&2){let e=a(2);m("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,d){if(t&1&&(n(0,"div",3),C(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function X(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),c(4,"async"),B(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),c(8,"async"),o()()()),t&2){let e=a();y(v(12,K)),r(),y(v(13,K)),r(2),m("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),m("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var Ce=(()=>{class t{constructor(){this.migrateService=s(T),this.toastr=s(V),this.refresh$=new b(void 0),this.pageTitle="Payment Account",this.roleService=s(j)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getPaymentMethodAccountCount()),A(i=>console.log("API response:",i)),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-payment-account"]],features:[F([T])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),C(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),o()),i&2&&m("pageTitle",p.pageTitle)},dependencies:[z,I,E,O,R,H,G,q,L,J,N,D],encapsulation:2})}}return t})();export{Ce as PaymentAccountComponent};
1
+ import{a as T,b as J}from"./chunk-4EGQ563G.js";import"./chunk-ZVDGEDMP.js";import{m as j}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as R,b as O}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import{a as V}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as C,Ec as v,Mb as m,Oc as c,Pb as y,Pc as l,Rb as h,Sc as S,W as M,Wb as n,Xb as o,Y as k,Yb as u,_ as A,ac as x,fc as P,gc as a,h as b,ia as s,ib as r,qa as g,ra as _,s as f,sa as B,ta as w,yb as $}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,d){if(t&1){let e=x();n(0,"p-button",6),P("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,d){if(t&1){let e=x();n(0,"p-button",7),c(1,"async"),c(2,"async"),P("onClick",function(){g(e);let p=a(2);return _(p.migratePaymentAccount())}),o()}if(t&2){let e=a(2);m("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,d){if(t&1&&(n(0,"div",3),C(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function X(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),c(4,"async"),B(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),c(8,"async"),o()()()),t&2){let e=a();y(v(12,K)),r(),y(v(13,K)),r(2),m("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),m("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var Ce=(()=>{class t{constructor(){this.migrateService=s(T),this.toastr=s(V),this.refresh$=new b(void 0),this.pageTitle="Payment Account",this.roleService=s(j)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getPaymentMethodAccountCount()),A(i=>console.log("API response:",i)),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-payment-account"]],features:[F([T])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),C(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),o()),i&2&&m("pageTitle",p.pageTitle)},dependencies:[z,I,E,O,R,H,G,q,L,J,N,D],encapsulation:2})}}return t})();export{Ce as PaymentAccountComponent};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-U4AN6IWJ.js";import{f as xt}from"./chunk-YR5KRTHR.js";import{b as vt}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as N}from"./chunk-BT7Y4ADP.js";import{b as Pt}from"./chunk-5U7KZJ3H.js";import{a as P,b as D}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{g as S,h as E,i as Mt}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as Tt,b as Ot}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import{c as ft}from"./chunk-BFEM6LX7.js";import{y as kt,z as yt}from"./chunk-O44DI62I.js";import{a as w,b as H}from"./chunk-DTYVTTET.js";import{Ma as bt,y as Ct}from"./chunk-MGIEURA2.js";import{l as gt}from"./chunk-DZCJWJUG.js";import{b as q}from"./chunk-VQ62YSFR.js";import{a as ut}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{d as _t}from"./chunk-KL3TPLRB.js";import{s as mt,u as ht}from"./chunk-DM2JLWKE.js";import{Da as b,Eb as _,Fa as $,Ha as h,L as z,Mb as m,Oc as J,Pc as K,Rb as f,Sb as it,Sc as X,Ta as tt,Ub as ot,Vb as at,Wb as a,Wc as lt,Xb as r,Yb as g,_ as I,ac as C,bd as dt,ca as Z,cd as T,fc as B,gc as s,ia as u,ib as p,mc as rt,nb as et,nc as st,oc as pt,qa as l,ra as d,rc as R,s as F,sc as k,t as A,tb as nt,tc as ct,u as j,uc as U,wa as W,xc as y,yb as O,yc as M,zc as v}from"./chunk-6QJHEOXN.js";import{a as L,b as V}from"./chunk-YQFG5XE2.js";var G=(()=>{class n{constructor(){this.httpService=u(ut)}createDashboardParams(t){return new _t().set("DashboardPeriod",t)}fetchDashboardLoader(){return this.httpService.get(void 0,"api/DashboardLoader")}fetchCashAndSplineData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/getcashandbank",{params:e})}fetchCashAndBankPieData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/getcashandbankpiechart",{params:e})}fetchExpenseSplineData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/GetExpense",{params:e})}fetchExpensePieData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/GetExpensePieChart",{params:e})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Bt(n,c){if(n&1){let t=C();a(0,"p-card",2)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsSpline),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function Lt(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}function Vt(n,c){if(n&1){let t=C();a(0,"p-card",4)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsPie),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function Ft(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}var Et=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=u(G),this.cdr=u(lt),this.injector=u(W),this.params=h({dashboardPeriod:2}),this.cashBankTitle=b(),this.amountCashBank=b(),this.isLoading=nt(!0),this.tooltip=b(),this.cashAndBankSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:t})=>A([this.dashboardService.fetchCashAndSplineData(t),this.dashboardService.fetchCashAndBankPieData(t)])),N("Cash & Bank Dashboard Data"),I(([t])=>{this.isLoading.set(!1),this.amountCashBank.emit(t.data),this.tooltip.emit(t.toolTip)}),F(([t,e])=>({splineData:t,pieData:e}))),{initialValue:null}),T(()=>{let t=this.cashAndBankSource();if(!t)return;let{splineData:e,pieData:i}=t;this.cashBankTitle.emit(e.title),tt(()=>{this.chartOptionsSpline={chart:{height:300},title:{text:e.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...e.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},e.chart.series),{type:"spline",name:"Amount",data:[...e.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:e.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0,this.cdr.detectChanges()},{injector:this.injector})})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-cash-bank"]],inputs:{isLoading:[1,"isLoading"]},outputs:{cashBankTitle:"cashBankTitle",amountCashBank:"amountCashBank",isLoading:"isLoadingChange",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1),_(2,Bt,2,4,"p-card",2)(3,Lt,2,0,"p-card"),r(),a(4,"div",3),_(5,Vt,2,4,"p-card",4)(6,Ft,2,0,"p-card"),r()()),e&2&&(p(2),f(i.isLoading()?3:2),p(3),f(i.isLoading()?6:5))},dependencies:[Q,E,S,D,P],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function At(n,c){if(n&1){let t=C();a(0,"p-card",2)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsSpline),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function jt(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}function zt(n,c){if(n&1){let t=C();a(0,"p-card",4)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsPie),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function It(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}var Dt=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=u(G),this.isLoading=h(!0),this.amountExpense=b(),this.params=h({dashboardPeriod:2}),this.expenseTitle=b(),this.tooltip=b(),this.expenseSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:t})=>A([this.dashboardService.fetchExpenseSplineData(t),this.dashboardService.fetchExpensePieData(t)])),N("Expense Dashboard Data"),I(([t])=>{this.isLoading.set(!1),this.amountExpense.emit(t.data),this.expenseTitle.emit(t.title),this.tooltip.emit(t.toolTip)}),F(([t,e])=>({splineData:t,pieData:e}))),{initialValue:null}),T(()=>{let t=this.expenseSource();if(!t)return;let{splineData:e,pieData:i}=t;console.log("Spline Data:",e),console.log("Pie Data:",i),this.chartOptionsSpline={chart:{height:300},title:{text:e.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...e.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},e.chart.series),{type:"spline",name:"Amount",data:[...e.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:e.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-expense"]],outputs:{amountExpense:"amountExpense",expenseTitle:"expenseTitle",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1),_(2,At,2,4,"p-card",2)(3,jt,2,0,"p-card"),r(),a(4,"div",3),_(5,zt,2,4,"p-card",4)(6,It,2,0,"p-card"),r()()),e&2&&(p(2),f(i.isLoading()?3:2),p(3),f(i.isLoading()?6:5))},dependencies:[Q,E,S,D,P],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function Wt(n,c){if(n&1&&(a(0,"span"),k(1),r()),n&2){let t=c.$implicit;p(),ct(t)}}function Rt(n,c){if(n&1&&(a(0,"div",21),ot(1,Wt,2,1,"span",null,it),r()),n&2){let t=s(3);p(),at(t.tooltipExpense())}}function qt(n,c){if(n&1){let t=C();g(0,"input",10,1),a(2,"button",11),B("click",function(i){l(t);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",13)(5,"div",14),g(6,"i",15),r()(),a(7,"p-card",16,2),_(9,Rt,3,0,"ng-template",null,3,X),a(11,"div",17)(12,"div",18)(13,"span",19),k(14,"Expense"),r(),a(15,"p",20),k(16),J(17,"number"),r()()()()()()}if(n&2){let t=R(10),e=s(2);p(7),m("pTooltip",t)("fitContent",!1),p(9),U(" ",K(17,3,e.amounts.expense())," ")}}function Ht(n,c){n&1&&g(0,"p-skeleton",9)}function Nt(n,c){if(n&1&&(a(0,"div",17)(1,"div",18)(2,"span",19),k(3,"Cash and Bank"),r(),a(4,"p",20),k(5),J(6,"number"),r()()()),n&2){let t=s(3);p(5),U(" ",t.amounts.cashBank()===0?"-":K(6,1,t.amounts.cashBank())," ")}}function Qt(n,c){if(n&1){let t=C();g(0,"input",22,4),a(2,"button",11),B("click",function(i){l(t);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",23),g(5,"i",24),r(),a(6,"p-card",25,2),_(8,Nt,7,3,"ng-template",26),r()()()}if(n&2){let t=s(2);p(6),m("pTooltip",t.tooltip.cashBank())}}function Gt(n,c){n&1&&g(0,"p-skeleton",9)}function Ut(n,c){if(n&1){let t=C();a(0,"app-expense",27),B("amountExpense",function(i){l(t);let o=s(2);return d(o.onAmountExpense(i))})("expenseTitle",function(i){l(t);let o=s(2);return d(o.onExpenseTitle(i))})("tooltip",function(i){l(t);let o=s(2);return d(o.onExpenseTooltip(i))}),r()}}function Jt(n,c){if(n&1){let t=C();a(0,"app-cash-bank",28),B("cashBankTitle",function(i){l(t);let o=s(2);return d(o.onCashBankTitle(i))})("amountCashBank",function(i){l(t);let o=s(2);return d(o.onAmountCashBank(i))})("tooltip",function(i){l(t);let o=s(2);return d(o.onCashBankTooltip(i))}),r()}}function Kt(n,c){if(n&1&&(a(0,"p-panel")(1,"main",6)(2,"div",7)(3,"div",8),_(4,qt,18,5)(5,Ht,1,0,"p-skeleton",9),r(),a(6,"div",8),_(7,Qt,9,1)(8,Gt,1,0,"p-skeleton",9),r()(),_(9,Ut,1,0,"app-expense")(10,Jt,1,0,"app-cash-bank"),r()()),n&2){let t=s();p(4),f(t.isLoading()?5:4),p(3),f(t.isLoading()?8:7),p(2),f(t.activeIndex()===0?9:t.activeIndex()===1?10:-1)}}var Ge=(()=>{class n{constructor(){this.activeIndex=h(0),this.pageTitle=h("Dashboard"),this.isLoading=h(!0),this.tooltip={cashBank:h(""),expense:h("")},this.renderer=u(et),this.injector=u(W),this.tooltipExpense=dt(()=>this.tooltip.expense().match(/^(.*?)\s*(\[[^\]]+\])$/)?[RegExp.$1.trim(),RegExp.$2.trim()]:[this.tooltip.expense()]),this.amounts={cashBank:h(0),expense:h(0)}}ngAfterViewInit(){T(()=>{this.isLoading()||queueMicrotask(()=>this.runCardEffect())},{injector:this.injector}),T(()=>{this.activeIndex(),queueMicrotask(()=>this.runCardEffect())},{injector:this.injector})}runCardEffect(){let t=this.activeIndex(),e=this.cards?.toArray();if(!e||e.length===0)return;e.forEach(o=>{let x=o.nativeElement.querySelector(".p-card-body");x&&(this.renderer.setStyle(x,"height","90px"),this.renderer.removeStyle(x,"background-color"),this.renderer.removeStyle(x,"box-shadow"))});let i=e[t];if(i){let o=i.nativeElement.querySelector(".p-card-body");o&&(this.renderer.setStyle(o,"background-color","#F0F0F0"),this.renderer.setStyle(o,"overflow","hidden"))}}onTabChange(t){this.activeIndex.set(t)}handleLinkClick(t,e){t.stopPropagation(),e.checked=!e.checked,e.checked&&(console.log(e.value),this.onTabChange(Number(e.value)))}onCashBankTitle(t){this.pageTitle.set(t),this.isLoading.set(!1)}onExpenseTitle(t){this.pageTitle.set(t),this.isLoading.set(!1)}onAmountCashBank(t){console.log("Total Amount from CashBank:",t),this.amounts.cashBank.set(t)}onAmountExpense(t){console.log("Total Amount from Expense:",t),this.amounts.expense.set(t)}onExpenseTooltip(t){this.tooltip.expense.set(t)}onCashBankTooltip(t){this.tooltip.cashBank.set(t)}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&rt(P,5,$),e&2){let o;st(o=pt())&&(i.cards=o)}},decls:3,vars:5,consts:[["content",""],["expenseCheckbox",""],["card",""],["tooltipContent",""],["cashBankCheckbox",""],[3,"hasMainWrapperPadding","limitStrLength","overflowScroll","isLoading","pageTitle"],[1,"d-flex","flex-column","row-gap-10"],[1,"row","row-gap-24"],[1,"col-12","col-md-6","col-lg-4"],["width","100%","height","8rem"],["name","dashboardOption","type","radio","hidden","","value","0"],[1,"btn","p-0","border-none","btn-link","w-100",3,"click"],[1,"card-container"],[1,"box-icon",2,"background-color","#d73636"],[1,"d-flex","text-white","align-items-baseline"],[1,"fa-solid","fa-circle-dollar-to-slot"],["tooltipPosition","top",3,"pTooltip","fitContent"],[1,"d-flex","justify-content-end"],[1,"d-flex","flex-column","align-items-end"],[1,"fs-5"],[1,"box-number","fs-4"],[1,"d-flex","flex-column"],["name","dashboardOption","type","radio","hidden","","value","1"],[1,"box-icon"],[1,"fa-duotone","fa-solid","fa-wallet","text-white"],["tooltipPosition","top",3,"pTooltip"],["pTemplate","content"],[3,"amountExpense","expenseTitle","tooltip"],[3,"cashBankTitle","amountCashBank","tooltip"]],template:function(e,i){e&1&&(a(0,"app-main-panel",5),_(1,Kt,11,3,"ng-template",null,0,X),r()),e&2&&m("hasMainWrapperPadding",!0)("limitStrLength",50)("overflowScroll",!0)("isLoading",i.isLoading())("pageTitle",i.pageTitle())},dependencies:[xt,ft,Mt,D,P,bt,ht,mt,Pt,gt,Ot,Tt,Ct,vt,Et,Dt,E,S,yt,kt],styles:['@charset "UTF-8";.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}@media (max-width: 85rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media (min-width: 98rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:80px;width:80px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:40px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1.15rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}']})}}return n})();export{Ge as Dashboard1Component};
1
+ import{a as Q}from"./chunk-U4AN6IWJ.js";import{f as xt}from"./chunk-YR5KRTHR.js";import{b as vt}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as N}from"./chunk-BT7Y4ADP.js";import{b as Pt}from"./chunk-5U7KZJ3H.js";import{a as P,b as D}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{g as S,h as E,i as Mt}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as Tt,b as Ot}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import{c as ft}from"./chunk-BFEM6LX7.js";import{y as kt,z as yt}from"./chunk-O44DI62I.js";import{a as w,b as H}from"./chunk-DTYVTTET.js";import{Ma as bt,y as Ct}from"./chunk-MGIEURA2.js";import{l as gt}from"./chunk-DZCJWJUG.js";import{b as q}from"./chunk-H6JPNVHO.js";import{a as ut}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{d as _t}from"./chunk-KL3TPLRB.js";import{s as mt,u as ht}from"./chunk-DM2JLWKE.js";import{Da as b,Eb as _,Fa as $,Ha as h,L as z,Mb as m,Oc as J,Pc as K,Rb as f,Sb as it,Sc as X,Ta as tt,Ub as ot,Vb as at,Wb as a,Wc as lt,Xb as r,Yb as g,_ as I,ac as C,bd as dt,ca as Z,cd as T,fc as B,gc as s,ia as u,ib as p,mc as rt,nb as et,nc as st,oc as pt,qa as l,ra as d,rc as R,s as F,sc as k,t as A,tb as nt,tc as ct,u as j,uc as U,wa as W,xc as y,yb as O,yc as M,zc as v}from"./chunk-6QJHEOXN.js";import{a as L,b as V}from"./chunk-YQFG5XE2.js";var G=(()=>{class n{constructor(){this.httpService=u(ut)}createDashboardParams(t){return new _t().set("DashboardPeriod",t)}fetchDashboardLoader(){return this.httpService.get(void 0,"api/DashboardLoader")}fetchCashAndSplineData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/getcashandbank",{params:e})}fetchCashAndBankPieData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/getcashandbankpiechart",{params:e})}fetchExpenseSplineData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/GetExpense",{params:e})}fetchExpensePieData(t){let e=this.createDashboardParams(t);return this.httpService.get(void 0,"api/dashboard/GetExpensePieChart",{params:e})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Bt(n,c){if(n&1){let t=C();a(0,"p-card",2)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsSpline),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function Lt(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}function Vt(n,c){if(n&1){let t=C();a(0,"p-card",4)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsPie),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function Ft(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}var Et=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=u(G),this.cdr=u(lt),this.injector=u(W),this.params=h({dashboardPeriod:2}),this.cashBankTitle=b(),this.amountCashBank=b(),this.isLoading=nt(!0),this.tooltip=b(),this.cashAndBankSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:t})=>A([this.dashboardService.fetchCashAndSplineData(t),this.dashboardService.fetchCashAndBankPieData(t)])),N("Cash & Bank Dashboard Data"),I(([t])=>{this.isLoading.set(!1),this.amountCashBank.emit(t.data),this.tooltip.emit(t.toolTip)}),F(([t,e])=>({splineData:t,pieData:e}))),{initialValue:null}),T(()=>{let t=this.cashAndBankSource();if(!t)return;let{splineData:e,pieData:i}=t;this.cashBankTitle.emit(e.title),tt(()=>{this.chartOptionsSpline={chart:{height:300},title:{text:e.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...e.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},e.chart.series),{type:"spline",name:"Amount",data:[...e.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:e.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0,this.cdr.detectChanges()},{injector:this.injector})})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-cash-bank"]],inputs:{isLoading:[1,"isLoading"]},outputs:{cashBankTitle:"cashBankTitle",amountCashBank:"amountCashBank",isLoading:"isLoadingChange",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1),_(2,Bt,2,4,"p-card",2)(3,Lt,2,0,"p-card"),r(),a(4,"div",3),_(5,Vt,2,4,"p-card",4)(6,Ft,2,0,"p-card"),r()()),e&2&&(p(2),f(i.isLoading()?3:2),p(3),f(i.isLoading()?6:5))},dependencies:[Q,E,S,D,P],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function At(n,c){if(n&1){let t=C();a(0,"p-card",2)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsSpline),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function jt(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}function zt(n,c){if(n&1){let t=C();a(0,"p-card",4)(1,"highcharts-chart",5),v("updateChange",function(i){l(t);let o=s();return M(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let t=s();p(),m("constructorType",t.chartConstructor)("options",t.chartOptionsPie),y("update",t.updateFlag),m("oneToOne",t.oneToOneFlag)}}function It(n,c){n&1&&(a(0,"p-card"),g(1,"p-skeleton",6),r())}var Dt=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=u(G),this.isLoading=h(!0),this.amountExpense=b(),this.params=h({dashboardPeriod:2}),this.expenseTitle=b(),this.tooltip=b(),this.expenseSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:t})=>A([this.dashboardService.fetchExpenseSplineData(t),this.dashboardService.fetchExpensePieData(t)])),N("Expense Dashboard Data"),I(([t])=>{this.isLoading.set(!1),this.amountExpense.emit(t.data),this.expenseTitle.emit(t.title),this.tooltip.emit(t.toolTip)}),F(([t,e])=>({splineData:t,pieData:e}))),{initialValue:null}),T(()=>{let t=this.expenseSource();if(!t)return;let{splineData:e,pieData:i}=t;console.log("Spline Data:",e),console.log("Pie Data:",i),this.chartOptionsSpline={chart:{height:300},title:{text:e.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...e.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},e.chart.series),{type:"spline",name:"Amount",data:[...e.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:e.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0})}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-expense"]],outputs:{amountExpense:"amountExpense",expenseTitle:"expenseTitle",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1),_(2,At,2,4,"p-card",2)(3,jt,2,0,"p-card"),r(),a(4,"div",3),_(5,zt,2,4,"p-card",4)(6,It,2,0,"p-card"),r()()),e&2&&(p(2),f(i.isLoading()?3:2),p(3),f(i.isLoading()?6:5))},dependencies:[Q,E,S,D,P],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function Wt(n,c){if(n&1&&(a(0,"span"),k(1),r()),n&2){let t=c.$implicit;p(),ct(t)}}function Rt(n,c){if(n&1&&(a(0,"div",21),ot(1,Wt,2,1,"span",null,it),r()),n&2){let t=s(3);p(),at(t.tooltipExpense())}}function qt(n,c){if(n&1){let t=C();g(0,"input",10,1),a(2,"button",11),B("click",function(i){l(t);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",13)(5,"div",14),g(6,"i",15),r()(),a(7,"p-card",16,2),_(9,Rt,3,0,"ng-template",null,3,X),a(11,"div",17)(12,"div",18)(13,"span",19),k(14,"Expense"),r(),a(15,"p",20),k(16),J(17,"number"),r()()()()()()}if(n&2){let t=R(10),e=s(2);p(7),m("pTooltip",t)("fitContent",!1),p(9),U(" ",K(17,3,e.amounts.expense())," ")}}function Ht(n,c){n&1&&g(0,"p-skeleton",9)}function Nt(n,c){if(n&1&&(a(0,"div",17)(1,"div",18)(2,"span",19),k(3,"Cash and Bank"),r(),a(4,"p",20),k(5),J(6,"number"),r()()()),n&2){let t=s(3);p(5),U(" ",t.amounts.cashBank()===0?"-":K(6,1,t.amounts.cashBank())," ")}}function Qt(n,c){if(n&1){let t=C();g(0,"input",22,4),a(2,"button",11),B("click",function(i){l(t);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",23),g(5,"i",24),r(),a(6,"p-card",25,2),_(8,Nt,7,3,"ng-template",26),r()()()}if(n&2){let t=s(2);p(6),m("pTooltip",t.tooltip.cashBank())}}function Gt(n,c){n&1&&g(0,"p-skeleton",9)}function Ut(n,c){if(n&1){let t=C();a(0,"app-expense",27),B("amountExpense",function(i){l(t);let o=s(2);return d(o.onAmountExpense(i))})("expenseTitle",function(i){l(t);let o=s(2);return d(o.onExpenseTitle(i))})("tooltip",function(i){l(t);let o=s(2);return d(o.onExpenseTooltip(i))}),r()}}function Jt(n,c){if(n&1){let t=C();a(0,"app-cash-bank",28),B("cashBankTitle",function(i){l(t);let o=s(2);return d(o.onCashBankTitle(i))})("amountCashBank",function(i){l(t);let o=s(2);return d(o.onAmountCashBank(i))})("tooltip",function(i){l(t);let o=s(2);return d(o.onCashBankTooltip(i))}),r()}}function Kt(n,c){if(n&1&&(a(0,"p-panel")(1,"main",6)(2,"div",7)(3,"div",8),_(4,qt,18,5)(5,Ht,1,0,"p-skeleton",9),r(),a(6,"div",8),_(7,Qt,9,1)(8,Gt,1,0,"p-skeleton",9),r()(),_(9,Ut,1,0,"app-expense")(10,Jt,1,0,"app-cash-bank"),r()()),n&2){let t=s();p(4),f(t.isLoading()?5:4),p(3),f(t.isLoading()?8:7),p(2),f(t.activeIndex()===0?9:t.activeIndex()===1?10:-1)}}var Ge=(()=>{class n{constructor(){this.activeIndex=h(0),this.pageTitle=h("Dashboard"),this.isLoading=h(!0),this.tooltip={cashBank:h(""),expense:h("")},this.renderer=u(et),this.injector=u(W),this.tooltipExpense=dt(()=>this.tooltip.expense().match(/^(.*?)\s*(\[[^\]]+\])$/)?[RegExp.$1.trim(),RegExp.$2.trim()]:[this.tooltip.expense()]),this.amounts={cashBank:h(0),expense:h(0)}}ngAfterViewInit(){T(()=>{this.isLoading()||queueMicrotask(()=>this.runCardEffect())},{injector:this.injector}),T(()=>{this.activeIndex(),queueMicrotask(()=>this.runCardEffect())},{injector:this.injector})}runCardEffect(){let t=this.activeIndex(),e=this.cards?.toArray();if(!e||e.length===0)return;e.forEach(o=>{let x=o.nativeElement.querySelector(".p-card-body");x&&(this.renderer.setStyle(x,"height","90px"),this.renderer.removeStyle(x,"background-color"),this.renderer.removeStyle(x,"box-shadow"))});let i=e[t];if(i){let o=i.nativeElement.querySelector(".p-card-body");o&&(this.renderer.setStyle(o,"background-color","#F0F0F0"),this.renderer.setStyle(o,"overflow","hidden"))}}onTabChange(t){this.activeIndex.set(t)}handleLinkClick(t,e){t.stopPropagation(),e.checked=!e.checked,e.checked&&(console.log(e.value),this.onTabChange(Number(e.value)))}onCashBankTitle(t){this.pageTitle.set(t),this.isLoading.set(!1)}onExpenseTitle(t){this.pageTitle.set(t),this.isLoading.set(!1)}onAmountCashBank(t){console.log("Total Amount from CashBank:",t),this.amounts.cashBank.set(t)}onAmountExpense(t){console.log("Total Amount from Expense:",t),this.amounts.expense.set(t)}onExpenseTooltip(t){this.tooltip.expense.set(t)}onCashBankTooltip(t){this.tooltip.cashBank.set(t)}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=O({type:n,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&rt(P,5,$),e&2){let o;st(o=pt())&&(i.cards=o)}},decls:3,vars:5,consts:[["content",""],["expenseCheckbox",""],["card",""],["tooltipContent",""],["cashBankCheckbox",""],[3,"hasMainWrapperPadding","limitStrLength","overflowScroll","isLoading","pageTitle"],[1,"d-flex","flex-column","row-gap-10"],[1,"row","row-gap-24"],[1,"col-12","col-md-6","col-lg-4"],["width","100%","height","8rem"],["name","dashboardOption","type","radio","hidden","","value","0"],[1,"btn","p-0","border-none","btn-link","w-100",3,"click"],[1,"card-container"],[1,"box-icon",2,"background-color","#d73636"],[1,"d-flex","text-white","align-items-baseline"],[1,"fa-solid","fa-circle-dollar-to-slot"],["tooltipPosition","top",3,"pTooltip","fitContent"],[1,"d-flex","justify-content-end"],[1,"d-flex","flex-column","align-items-end"],[1,"fs-5"],[1,"box-number","fs-4"],[1,"d-flex","flex-column"],["name","dashboardOption","type","radio","hidden","","value","1"],[1,"box-icon"],[1,"fa-duotone","fa-solid","fa-wallet","text-white"],["tooltipPosition","top",3,"pTooltip"],["pTemplate","content"],[3,"amountExpense","expenseTitle","tooltip"],[3,"cashBankTitle","amountCashBank","tooltip"]],template:function(e,i){e&1&&(a(0,"app-main-panel",5),_(1,Kt,11,3,"ng-template",null,0,X),r()),e&2&&m("hasMainWrapperPadding",!0)("limitStrLength",50)("overflowScroll",!0)("isLoading",i.isLoading())("pageTitle",i.pageTitle())},dependencies:[xt,ft,Mt,D,P,bt,ht,mt,Pt,gt,Ot,Tt,Ct,vt,Et,Dt,E,S,yt,kt],styles:['@charset "UTF-8";.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}@media (max-width: 85rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media (min-width: 98rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:80px;width:80px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:40px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1.15rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}']})}}return n})();export{Ge as Dashboard1Component};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-WPHZJHC6.js";import{a as je}from"./chunk-SVGPDGYN.js";import{a as ze}from"./chunk-YHLRDTIS.js";import{a as Be,b as He}from"./chunk-LO4HJ77Y.js";import{a as oe}from"./chunk-GQ7SPEZH.js";import{b as D}from"./chunk-JPNJTPYJ.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as Je,g as Ne,h as ke,i as Me}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ve,b as De}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as Ae}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ee}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as xe,b as Ce}from"./chunk-ISIYG4D5.js";import{a as ve,b as y,c as ye,d as we,e as Re,f as Ie,g as Te}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as fe,o as _e,w as ge,x as he,y as be,z as Se}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as me,k as pe,m as se,p as ce,v as de,y as ue}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Y,l as Z,m as ee,p as te,r as ie,u as ne}from"./chunk-DM2JLWKE.js";import{Cb as K,Dc as Q,Eb as g,Fc as E,Ha as k,Mb as c,Oc as I,Pc as X,Qc as V,Sc as v,Wb as r,Xb as o,Y as N,Yb as b,_ as U,ac as w,bd as T,c as A,db as L,eb as O,fc as R,gc as _,ia as C,ib as m,qa as h,ra as x,s as J,sc as s,tc as S,uc as M,wc as W,xc as $,yb as G,yc as P,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var We={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},B=ye(Te(We),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(D);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(A(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(A(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),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}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Re(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function $e(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function qe(t,a){if(t&1&&g(0,$e,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Qe(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Xe(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),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,O),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(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 Ye(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ze(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function et(t,a){if(t&1){let e=w();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,Qe,18,0,"ng-template",null,3,v)(4,Xe,22,18,"ng-template",null,4,v)(6,Ye,1,3,"ng-template",null,5,v)(8,Ze,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function tt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function it(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function nt(t,a){if(t&1&&(r(0,"div"),g(1,it,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function mt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),g(5,tt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,nt,2,1,"div",30),b(13,"p-datepicker",31),g(14,rt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,lt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(16,H,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(18,H,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",X(19,14,e.customerSuggestions$)),m(5),c("ngClass",E(20,H,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var Yt=(()=>{class t extends Pe{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Oe,customerID:Ge,paymentState:Ke}=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),pageSize:this.fb.control(u,[ae.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Oe),customerID:this.fb.control(Ge),paymentState:this.fb.control(Ke)})}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]=ze);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=G({type:t,selectors:[["app-ar-journal"]],features:[Q([B]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[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 Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["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","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,qe,1,1,"ng-template",null,0,v)(3,et,10,5,"ng-template",null,1,v),s(5," <"),g(6,mt,25,22,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ee,ne,Y,Z,ee,te,ie,Me,Je,Ne,ke,he,ge,Ce,xe,ue,pe,re,le,me,se,ce,Ae,Fe,De,Ve,He,Be,_e,fe,ve,Se,be,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Yt as ARJournalComponent};
1
+ import{a as F}from"./chunk-ICDJTXVE.js";import{a as je}from"./chunk-SVGPDGYN.js";import{a as ze}from"./chunk-YHLRDTIS.js";import{a as Be,b as He}from"./chunk-LO4HJ77Y.js";import{a as oe}from"./chunk-6YXA7GFO.js";import{b as D}from"./chunk-ZVDGEDMP.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as Je,g as Ne,h as ke,i as Me}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ve,b as De}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as Ae}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ee}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as xe,b as Ce}from"./chunk-ISIYG4D5.js";import{a as ve,b as y,c as ye,d as we,e as Re,f as Ie,g as Te}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as fe,o as _e,w as ge,x as he,y as be,z as Se}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as me,k as pe,m as se,p as ce,v as de,y as ue}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Y,l as Z,m as ee,p as te,r as ie,u as ne}from"./chunk-DM2JLWKE.js";import{Cb as K,Dc as Q,Eb as g,Fc as E,Ha as k,Mb as c,Oc as I,Pc as X,Qc as V,Sc as v,Wb as r,Xb as o,Y as N,Yb as b,_ as U,ac as w,bd as T,c as A,db as L,eb as O,fc as R,gc as _,ia as C,ib as m,qa as h,ra as x,s as J,sc as s,tc as S,uc as M,wc as W,xc as $,yb as G,yc as P,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var We={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},B=ye(Te(We),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(D);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(A(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(A(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),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}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Re(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function $e(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function qe(t,a){if(t&1&&g(0,$e,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Qe(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Xe(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),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,O),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(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 Ye(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ze(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function et(t,a){if(t&1){let e=w();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,Qe,18,0,"ng-template",null,3,v)(4,Xe,22,18,"ng-template",null,4,v)(6,Ye,1,3,"ng-template",null,5,v)(8,Ze,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function tt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function it(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function nt(t,a){if(t&1&&(r(0,"div"),g(1,it,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function mt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),g(5,tt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,nt,2,1,"div",30),b(13,"p-datepicker",31),g(14,rt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,lt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(16,H,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(18,H,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",X(19,14,e.customerSuggestions$)),m(5),c("ngClass",E(20,H,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var Yt=(()=>{class t extends Pe{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Oe,customerID:Ge,paymentState:Ke}=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),pageSize:this.fb.control(u,[ae.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Oe),customerID:this.fb.control(Ge),paymentState:this.fb.control(Ke)})}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]=ze);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=G({type:t,selectors:[["app-ar-journal"]],features:[Q([B]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[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 Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["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","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,qe,1,1,"ng-template",null,0,v)(3,et,10,5,"ng-template",null,1,v),s(5," <"),g(6,mt,25,22,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ee,ne,Y,Z,ee,te,ie,Me,Je,Ne,ke,he,ge,Ce,xe,ue,pe,re,le,me,se,ce,Ae,Fe,De,Ve,He,Be,_e,fe,ve,Se,be,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Yt as ARJournalComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-WPHZJHC6.js";import{a as ze}from"./chunk-SVGPDGYN.js";import{a as je,b as Be}from"./chunk-LO4HJ77Y.js";import{a as oe}from"./chunk-GQ7SPEZH.js";import{b as A}from"./chunk-JPNJTPYJ.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as ke,g as Ne,h as Pe,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as De,b as Ae}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as Je}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ve}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as xe,b as Ce}from"./chunk-ISIYG4D5.js";import{a as ve,b as y,c as ye,d as we,e as Te,f as Ie,g as Ee}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as fe,o as _e,w as ge,x as he,y as Se,z as be}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as pe,k as me,m as se,p as ce,v as de,y as ue}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Y,l as Z,m as ee,p as te,r as ie,u as ne}from"./chunk-DM2JLWKE.js";import{Cb as K,Dc as Q,Eb as x,Fc as V,Ha as P,Mb as c,Oc as I,Pc as X,Qc as D,Sc as v,Wb as r,Xb as o,Y as N,Yb as S,_ as O,ac as w,bd as E,c as J,db as U,eb as L,fc as T,gc as _,ia as C,ib as l,qa as g,ra as h,s as k,sc as s,tc as b,uc as R,wc as W,xc as $,yb as G,yc as M,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var Ke={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}}},B=ye(Ee(Ke),we(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)),checkedAPCollection:E(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(A);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!0}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!1}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(m=>f(d({},m),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getAPLoader:z(J(N(()=>a.getAPJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:z(J(k(n=>Object.entries(n).reduce((i,[u,m])=>(m!=null&&(i[u]=m),i),{})),N(n=>a.getAPJournal(n).pipe(k(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}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Te(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function We(t,a){if(t&1){let e=w();r(0,"p-button",10),T("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function $e(t,a){if(t&1&&x(0,We,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function qe(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function Qe(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,L),l(),R(" ",e.number," "),l(2),b(e.customer),l(2),b(D(12,12,e.date,"d MMM y")),l(3),b(e.due?D(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,U),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function Ze(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),T("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,qe,18,0,"ng-template",null,3,v)(4,Qe,22,18,"ng-template",null,4,v)(6,Xe,1,3,"ng-template",null,5,v)(8,Ye,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();l(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function et(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),R(" ",D(2,2,e.name,30)," ")}}function tt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function it(t,a){if(t&1&&(r(0,"div"),x(1,tt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function nt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function ot(t,a){if(t&1&&(r(0,"div"),x(1,nt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function rt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function at(t,a){if(t&1&&(r(0,"div"),x(1,rt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function lt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),x(5,et,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),S(11,"p-datepicker",29),x(12,it,2,1,"div",30),S(13,"p-datepicker",31),x(14,ot,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Supplier"),o(),r(18,"p-autocomplete",32),I(19,"async"),T("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),S(23,"input",33),x(24,at,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(7),c("iconDisplay","input")("showIcon",!0)("ngClass",V(16,H,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(18,H,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",X(19,14,e.supplierSuggestions$)),l(5),c("ngClass",V(20,H,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var Qt=(()=>{class t extends Me{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=P(!1),this.isInitDialogFilterVisible=P(!1),this.fb=C(de),this.dayjsService=C(A)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:u,supplierID:m,pageNumber:He,pageSize:Oe,export:Ue,exportPageNumber:Le,exportPageSize:Ge}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),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),paymentState:this.fb.control(u),supplierID:this.fb.control(m),pageNumber:this.fb.control(He),pageSize:this.fb.control(Oe,[ae.required]),export:this.fb.control(Ue),exportPageNumber:this.fb.control(Le),exportPageSize:this.fb.control(Ge)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:p+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(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(O(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ap-journal"]],features:[Q([B]),K],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[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 Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["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","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["appMaskNumber","","type","text","pInputText","","formControlName","pageSize",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),T("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,$e,1,1,"ng-template",null,0,v)(3,Ze,10,5,"ng-template",null,1,v)(5,lt,25,22,"ng-template",null,2,v),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,Re,ke,Ne,Pe,ne,Y,Z,ee,te,ie,he,ge,Ce,xe,ue,me,re,le,pe,se,ce,Je,Fe,Ae,De,_e,fe,Be,je,be,Se,ve,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Qt as ApJournalComponent};
1
+ import{a as F}from"./chunk-ICDJTXVE.js";import{a as ze}from"./chunk-SVGPDGYN.js";import{a as je,b as Be}from"./chunk-LO4HJ77Y.js";import{a as oe}from"./chunk-6YXA7GFO.js";import{b as A}from"./chunk-ZVDGEDMP.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as ke,g as Ne,h as Pe,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as De,b as Ae}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as Je}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ve}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as xe,b as Ce}from"./chunk-ISIYG4D5.js";import{a as ve,b as y,c as ye,d as we,e as Te,f as Ie,g as Ee}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as fe,o as _e,w as ge,x as he,y as Se,z as be}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as pe,k as me,m as se,p as ce,v as de,y as ue}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Y,l as Z,m as ee,p as te,r as ie,u as ne}from"./chunk-DM2JLWKE.js";import{Cb as K,Dc as Q,Eb as x,Fc as V,Ha as P,Mb as c,Oc as I,Pc as X,Qc as D,Sc as v,Wb as r,Xb as o,Y as N,Yb as S,_ as O,ac as w,bd as E,c as J,db as U,eb as L,fc as T,gc as _,ia as C,ib as l,qa as g,ra as h,s as k,sc as s,tc as b,uc as R,wc as W,xc as $,yb as G,yc as M,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var Ke={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}}},B=ye(Ee(Ke),we(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)),checkedAPCollection:E(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(A);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!0}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!1}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(m=>f(d({},m),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getAPLoader:z(J(N(()=>a.getAPJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:z(J(k(n=>Object.entries(n).reduce((i,[u,m])=>(m!=null&&(i[u]=m),i),{})),N(n=>a.getAPJournal(n).pipe(k(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}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Te(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function We(t,a){if(t&1){let e=w();r(0,"p-button",10),T("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function $e(t,a){if(t&1&&x(0,We,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function qe(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function Qe(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,L),l(),R(" ",e.number," "),l(2),b(e.customer),l(2),b(D(12,12,e.date,"d MMM y")),l(3),b(e.due?D(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,U),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function Ze(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),T("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,qe,18,0,"ng-template",null,3,v)(4,Qe,22,18,"ng-template",null,4,v)(6,Xe,1,3,"ng-template",null,5,v)(8,Ye,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();l(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function et(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),R(" ",D(2,2,e.name,30)," ")}}function tt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function it(t,a){if(t&1&&(r(0,"div"),x(1,tt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function nt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function ot(t,a){if(t&1&&(r(0,"div"),x(1,nt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function rt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function at(t,a){if(t&1&&(r(0,"div"),x(1,rt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function lt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),x(5,et,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),S(11,"p-datepicker",29),x(12,it,2,1,"div",30),S(13,"p-datepicker",31),x(14,ot,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Supplier"),o(),r(18,"p-autocomplete",32),I(19,"async"),T("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),S(23,"input",33),x(24,at,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(7),c("iconDisplay","input")("showIcon",!0)("ngClass",V(16,H,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(18,H,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",X(19,14,e.supplierSuggestions$)),l(5),c("ngClass",V(20,H,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var Qt=(()=>{class t extends Me{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=P(!1),this.isInitDialogFilterVisible=P(!1),this.fb=C(de),this.dayjsService=C(A)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:u,supplierID:m,pageNumber:He,pageSize:Oe,export:Ue,exportPageNumber:Le,exportPageSize:Ge}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),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),paymentState:this.fb.control(u),supplierID:this.fb.control(m),pageNumber:this.fb.control(He),pageSize:this.fb.control(Oe,[ae.required]),export:this.fb.control(Ue),exportPageNumber:this.fb.control(Le),exportPageSize:this.fb.control(Ge)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:p+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(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(O(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ap-journal"]],features:[Q([B]),K],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[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 Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["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","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["appMaskNumber","","type","text","pInputText","","formControlName","pageSize",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),T("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,$e,1,1,"ng-template",null,0,v)(3,Ze,10,5,"ng-template",null,1,v)(5,lt,25,22,"ng-template",null,2,v),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,Re,ke,Ne,Pe,ne,Y,Z,ee,te,ie,he,ge,Ce,xe,ue,me,re,le,pe,se,ce,Je,Fe,Ae,De,_e,fe,Be,je,be,Se,ve,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Qt as ApJournalComponent};
@@ -0,0 +1 @@
1
+ import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-UPBPXKNV.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-W6SE4LJW.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-RK23P4VG.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-CNWZ52LV.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-YCOTHSE5.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-ITGMU5MB.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-TRH6BRRC.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-IVCIH4GN.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-M2RAH7HZ.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
@@ -1 +1 @@
1
- import{ca as m}from"./chunk-6QJHEOXN.js";import{a as n,b as l}from"./chunk-YQFG5XE2.js";var c={production:!0,version:"5.51.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var o=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(e,...t){for(let i=0;i<t.length;i++)e=e.replace(`{${i}}`,t[i]);return e}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(e){return e!=""&&!s.containsOnlySpaces(e)&&e!=s.GuidEmpty&&e!=null&&e!=null}static IsEmpty(e){return!!(e==""||s.containsOnlySpaces(e)||e==null||e==null||e==s.GuidEmpty)}static isGuid(e){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,i=!1;return e&&(i=t.test(e)),i}static containsOnlySpaces(e){return/^\s*$/.test(e)}static FilterByID(e,t){try{let i=e.filter(a=>a.ID==t);if(i.length>0)return i[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(e,t,i){let a=-1;(t==null||t==null)&&(t=11),(i==null||i==null||!i)&&(a=1);let r=[];for(let u=0;u<t;u++)r.push(e+u*a);return r}static DateOnly(e){return e?new Date(new Date(e).toDateString()):new Date(new Date().toDateString())}static differentInDays(e,t){let i=t.getTime()-e.getTime();return Math.floor(i/(1e3*3600*24))}static minutesDiff(e,t){let i=(t.getTime()-e.getTime())/6e4;return Math.ceil(i)}static hoursDiff(e,t){let a=(t.getTime()-e.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var a=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i=="x"?a:a&3|8).toString(16)})}static parseJwt(e){var t=e.split(".")[1],i=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(i).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(e){let t=e.which?e.which:e.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(e){let t="",i="",a=Math.abs(e);return a>999&&a<1e6?(i="K",t=(a/1e3).toFixed(0)):a>=1e6?(i="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),e<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+i}static isToDay(e){if(this.IsNotEmpty(e)){e=typeof e=="string"?new Date(e):e;let t=new Date;return t.setHours(0,0,0,0),e.setHours(0,0,0,0),t.getTime()==e.getTime()}return!1}static setToLatestTime(e){let t=new Date(e);return t.setHours(23,59,59),t}static setToFirstTime(e){let t=new Date(e);return t.setHours(0,0,0),t}static compare(e,t,i){return(e<t?-1:1)*(i?1:-1)}static generateSerialasNote(e=[]){let t="";return e&&e.length>0&&(t=`[${e.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(e,t){let i=new Date(e.getTime()),a=[];for(;i<=t;)a.push(new Date(i)),i.setDate(i.getDate()+1);return a}static getDaysBefore(e,t){return new Date(e.setDate(new Date().getDate()-t))}static getRangeDate(e,t){let i=new Date;i.setMonth(e),i.setFullYear(t);let a=new Date(i.getFullYear(),i.getMonth()-1,1),r=new Date(i.getFullYear(),i.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(e,t){let i=new Date;t&&(i=new Date(t));let a=e.split(":");return i.setHours(parseInt(a[0])),i.setMinutes(parseInt(a[1])),i}static isMaskingField(e=""){return e.includes("?")}static generateMaskingField(e=[]){let t={};return e.forEach((i,a)=>{i=i.split(" ")?.join(""),t=l(n({},t),{[i]:!0})}),t}static checkJSApiSupported(e){let t;return e in window?t=!0:t=!1,t}static cloneObject(e){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(e):t=JSON.parse(JSON.stringify(e)),t}static formatTitleFromDate(e,t){let i=null,a=new Date(e),r=new Date(t);return a.getDate()!=r.getDate()&&(i="d"),a.getMonth()!=r.getMonth()&&(i="d MMM"),a.getFullYear()!=r.getFullYear()&&(i="d MMM yyyy"),i}};var y=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();o.IsNotEmpty(t)&&window.Intercom("boot",{app_id:c.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",n({app_id:c.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",n({app_id:c.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return o.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{o as a,c as b,y as c};
1
+ import{ca as m}from"./chunk-6QJHEOXN.js";import{a as n,b as l}from"./chunk-YQFG5XE2.js";var c={production:!0,version:"5.51.2",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var o=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(e,...t){for(let i=0;i<t.length;i++)e=e.replace(`{${i}}`,t[i]);return e}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(e){return e!=""&&!s.containsOnlySpaces(e)&&e!=s.GuidEmpty&&e!=null&&e!=null}static IsEmpty(e){return!!(e==""||s.containsOnlySpaces(e)||e==null||e==null||e==s.GuidEmpty)}static isGuid(e){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,i=!1;return e&&(i=t.test(e)),i}static containsOnlySpaces(e){return/^\s*$/.test(e)}static FilterByID(e,t){try{let i=e.filter(a=>a.ID==t);if(i.length>0)return i[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(e,t,i){let a=-1;(t==null||t==null)&&(t=11),(i==null||i==null||!i)&&(a=1);let r=[];for(let u=0;u<t;u++)r.push(e+u*a);return r}static DateOnly(e){return e?new Date(new Date(e).toDateString()):new Date(new Date().toDateString())}static differentInDays(e,t){let i=t.getTime()-e.getTime();return Math.floor(i/(1e3*3600*24))}static minutesDiff(e,t){let i=(t.getTime()-e.getTime())/6e4;return Math.ceil(i)}static hoursDiff(e,t){let a=(t.getTime()-e.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var a=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i=="x"?a:a&3|8).toString(16)})}static parseJwt(e){var t=e.split(".")[1],i=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(i).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(e){let t=e.which?e.which:e.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(e){let t="",i="",a=Math.abs(e);return a>999&&a<1e6?(i="K",t=(a/1e3).toFixed(0)):a>=1e6?(i="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),e<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+i}static isToDay(e){if(this.IsNotEmpty(e)){e=typeof e=="string"?new Date(e):e;let t=new Date;return t.setHours(0,0,0,0),e.setHours(0,0,0,0),t.getTime()==e.getTime()}return!1}static setToLatestTime(e){let t=new Date(e);return t.setHours(23,59,59),t}static setToFirstTime(e){let t=new Date(e);return t.setHours(0,0,0),t}static compare(e,t,i){return(e<t?-1:1)*(i?1:-1)}static generateSerialasNote(e=[]){let t="";return e&&e.length>0&&(t=`[${e.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(e,t){let i=new Date(e.getTime()),a=[];for(;i<=t;)a.push(new Date(i)),i.setDate(i.getDate()+1);return a}static getDaysBefore(e,t){return new Date(e.setDate(new Date().getDate()-t))}static getRangeDate(e,t){let i=new Date;i.setMonth(e),i.setFullYear(t);let a=new Date(i.getFullYear(),i.getMonth()-1,1),r=new Date(i.getFullYear(),i.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(e,t){let i=new Date;t&&(i=new Date(t));let a=e.split(":");return i.setHours(parseInt(a[0])),i.setMinutes(parseInt(a[1])),i}static isMaskingField(e=""){return e.includes("?")}static generateMaskingField(e=[]){let t={};return e.forEach((i,a)=>{i=i.split(" ")?.join(""),t=l(n({},t),{[i]:!0})}),t}static checkJSApiSupported(e){let t;return e in window?t=!0:t=!1,t}static cloneObject(e){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(e):t=JSON.parse(JSON.stringify(e)),t}static formatTitleFromDate(e,t){let i=null,a=new Date(e),r=new Date(t);return a.getDate()!=r.getDate()&&(i="d"),a.getMonth()!=r.getMonth()&&(i="d MMM"),a.getFullYear()!=r.getFullYear()&&(i="d MMM yyyy"),i}};var y=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();o.IsNotEmpty(t)&&window.Intercom("boot",{app_id:c.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",n({app_id:c.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",n({app_id:c.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return o.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{o as a,c as b,y as c};