dealposbooks 5.46.1 → 5.46.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 (57) hide show
  1. package/{chunk-GKXIOXWW.js → chunk-45JI5H5L.js} +2 -2
  2. package/{chunk-HXXN64RL.js → chunk-4IHVNLEA.js} +1 -1
  3. package/{chunk-Z2ADGCWR.js → chunk-4ODQPLDW.js} +1 -1
  4. package/{chunk-PRW2K6L4.js → chunk-5GAJOO6O.js} +2 -2
  5. package/{chunk-Y3UB475V.js → chunk-5RW6MEBV.js} +1 -1
  6. package/{chunk-VBCL4G4V.js → chunk-6LW7PY2Z.js} +1 -1
  7. package/{chunk-ME7O3OZS.js → chunk-6VBTHQT3.js} +1 -1
  8. package/{chunk-6HNKPNHQ.js → chunk-7DJNG6VE.js} +1 -1
  9. package/{chunk-53W5RLOG.js → chunk-B2BDKUAE.js} +2 -2
  10. package/{chunk-DAUF3TQ2.js → chunk-BJBAWNDR.js} +1 -1
  11. package/{chunk-A3XYHEBB.js → chunk-BKLUYVDG.js} +1 -1
  12. package/{chunk-KYQ3HOYB.js → chunk-BVXYCUBY.js} +1 -1
  13. package/{chunk-XILZA7G5.js → chunk-C6TI7B2G.js} +1 -1
  14. package/{chunk-OKX4P7HR.js → chunk-CO2UYCZ2.js} +1 -1
  15. package/{chunk-JYEZYL2U.js → chunk-DFGIXWZK.js} +1 -1
  16. package/{chunk-56N6E5N3.js → chunk-EAEMBSUD.js} +1 -1
  17. package/{chunk-BPBHYTKN.js → chunk-ETHACYOI.js} +1 -1
  18. package/{chunk-7UGQCTEO.js → chunk-EXBBFIDN.js} +1 -1
  19. package/{chunk-MOUK63TZ.js → chunk-FMHGC2MA.js} +1 -1
  20. package/{chunk-KGTXHU4K.js → chunk-G6IPI7YM.js} +1 -1
  21. package/{chunk-PQB7CIVB.js → chunk-G7QPRYOR.js} +1 -1
  22. package/{chunk-QXZZJ543.js → chunk-GXJ3G456.js} +1 -1
  23. package/{chunk-SZUKKFRX.js → chunk-IV5AW2OY.js} +1 -1
  24. package/{chunk-MYE27TEJ.js → chunk-IWF5R5FH.js} +1 -1
  25. package/{chunk-C2KFSD3V.js → chunk-KS2JAY2L.js} +1 -1
  26. package/{chunk-YUNKEY4N.js → chunk-MJSJBCDR.js} +1 -1
  27. package/{chunk-TYVIEINK.js → chunk-N4RQTE4T.js} +1 -1
  28. package/{chunk-IZCYMXSH.js → chunk-NHIAQTUJ.js} +1 -1
  29. package/{chunk-ZYDAEVQY.js → chunk-NPAM3NOH.js} +1 -1
  30. package/{chunk-SBAIX6FL.js → chunk-NQXDAWEZ.js} +1 -1
  31. package/{chunk-R7TX5W65.js → chunk-OR5FLZPY.js} +1 -1
  32. package/{chunk-FXWKWGGZ.js → chunk-PEOJDDJN.js} +1 -1
  33. package/{chunk-W4HYYYPX.js → chunk-PFWNBHNC.js} +1 -1
  34. package/{chunk-SLUPHKW6.js → chunk-PNWKCLWA.js} +1 -1
  35. package/{chunk-SPFVPLUI.js → chunk-Q34IDOYA.js} +1 -1
  36. package/{chunk-LLPR22QN.js → chunk-QUUGFWG3.js} +1 -1
  37. package/{chunk-ICH2UTRM.js → chunk-RZHWMBFY.js} +1 -1
  38. package/chunk-S7AFTSCW.js +1 -0
  39. package/{chunk-LWIIL6RI.js → chunk-T6OMUVQY.js} +1 -1
  40. package/{chunk-BPZ7LLVJ.js → chunk-UCDJJGO5.js} +1 -1
  41. package/{chunk-325YO3CB.js → chunk-UH5YUPBR.js} +1 -1
  42. package/{chunk-G25NFEKL.js → chunk-VKKAJODP.js} +1 -1
  43. package/{chunk-CRRQQY3W.js → chunk-WFQQUFSS.js} +1 -1
  44. package/{chunk-Y2PXP5OT.js → chunk-WKE2HPSD.js} +1 -1
  45. package/{chunk-NID2PW3N.js → chunk-WY2JNDES.js} +1 -1
  46. package/{chunk-TOSO7HJJ.js → chunk-X46QKMJY.js} +1 -1
  47. package/{chunk-O4TXGGHF.js → chunk-XFOCD2H7.js} +1 -1
  48. package/{chunk-JGRTH5OW.js → chunk-XFVMOYX7.js} +1 -1
  49. package/{chunk-OBX4APL6.js → chunk-XXNDXSPP.js} +1 -1
  50. package/{chunk-FYFSBGP3.js → chunk-Y3URGAXL.js} +1 -1
  51. package/{chunk-AS6FT6H3.js → chunk-YTZ3JIC5.js} +1 -1
  52. package/{chunk-QKRPHDSG.js → chunk-YZH7Y43Y.js} +1 -1
  53. package/{chunk-NLRLM4WP.js → chunk-ZWR2YCUC.js} +1 -1
  54. package/index.html +2 -2
  55. package/{main-7RGHX2IL.js → main-ON5LJQLR.js} +1 -1
  56. package/package.json +1 -1
  57. package/chunk-YM5BXLAN.js +0 -1
@@ -1 +1 @@
1
- import{a as ue}from"./chunk-FYFSBGP3.js";import{b as be}from"./chunk-HG5MKVNR.js";import"./chunk-IGWIRCAS.js";import{a as Q,b as W}from"./chunk-3A4BFUGD.js";import{d as X,i as he,j as xe,k as Y}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Ce}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as ge}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as q}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as A,b as j}from"./chunk-2XUSZCQL.js";import{a as b,b as H,c as L,d as G,e as $,f as K}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as _e,w as V,x as F}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{x as fe}from"./chunk-OIBDX2CA.js";import{e as z,l as me}from"./chunk-AOOG6YOT.js";import{a as se}from"./chunk-R7TX5W65.js";import{a as de}from"./chunk-2MKKFLNJ.js";import{k as le,p as pe,q as D,s as N,z as ce}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as E,Cc as O,Db as T,Dc as P,Ec as ie,Lb as g,Nc as S,Ob as I,Oc as U,Pc as re,Rc as _,Vb as o,Wb as i,Xb as J,Y as R,_ as ne,bd as v,c as k,ca as ae,db as oe,ec as y,fc as s,hb as m,ia as u,qa as x,ra as C,rc as r,s as te,sc as f,vc as B,xb as M}from"./chunk-NMCKMUY4.js";import{a as l,b as d}from"./chunk-YQFG5XE2.js";var w=(()=>{class e{constructor(){this.httpService=u(se)}getGenerateCoa(t){let n={params:new ce().set("PageNumber",t.PageNumber).set("PageSize",t.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(t={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,t)}getUnbalanceJournal(t){return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal/"+t.PageNumber+"/"+t.PageSize)}updateUnbalanceJournal(t){let a={ListID:t};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",a)}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275prov=ae({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Te={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},Z=H(K(Te),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count))})),$(e=>{let p=u(w);return{updateFilter:a=>{b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},getUpdateCOA:Q(k(R(a=>p.getGenerateCoa(a).pipe(W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error(n)}})))))}}),G({onInit(e){e.getUpdateCOA(e.filter)}}));var ke=()=>({height:"calc(100vh - 70px)"}),Re=()=>({"min-width":"50rem"});function Me(e,p){if(e&1){let t=E();o(0,"p-button",7),y("onClick",function(){x(t);let n=s();return C(n.updateCoaBalance())}),i()}}function Ie(e,p){e&1&&(o(0,"tr")(1,"th"),r(2,"Code"),i(),o(3,"th"),r(4,"Name"),i(),o(5,"th"),r(6,"Outlet"),i(),o(7,"th"),r(8,"COA Balance"),i(),o(9,"th"),r(10,"Correct Balance"),i()())}function Je(e,p){if(e&1&&(o(0,"tr")(1,"td"),r(2),i(),o(3,"td")(4,"a",9),r(5),i()(),o(6,"td"),r(7),i(),o(8,"td"),r(9),S(10,"number"),i(),o(11,"td"),r(12),S(13,"number"),i()()),e&2){let t=p.$implicit;m(2),f(t.Code),m(2),g("routerLink","/pages/chart-of-account/account/"+t.ID),m(),f(t.Name),m(2),f(t.OutletName),m(2),f(U(10,6,t.Balance)),m(3),f(U(13,8,t.CorrectBalance))}}function Be(e,p){if(e&1&&(o(0,"div",10)(1,"p",11),r(2),i()()),e&2){let t=s(2);m(2),B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Oe(e,p){e&1&&(o(0,"tr")(1,"td",12)(2,"span"),r(3,"No records found."),i()()())}function De(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",8),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))}),T(2,Ie,11,0,"ng-template",null,2,_)(4,Je,14,10,"ng-template",null,3,_)(6,Be,3,3,"ng-template",null,4,_)(8,Oe,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(8,ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",t.store.data().count)("rows",t.store.filter().PageSize)("value",t.store.data().data)("tableStyle",P(9,Re))}}var ve=(()=>{class e{constructor(){this.store=u(Z),this.coaService=u(w),this.toastrService=u(de)}onPageChange(t){this.store.updateFilter(d(l({},this.store.filter()),{PageNumber:Math.floor(t.first/t.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ce("Update COA Balance"),ne(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-tools-update-coa"]],features:[O([Z])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Me,1,0,"ng-template",null,0,_)(3,De,10,10,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,ge,N,D,F,V,j,A,z],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return e})();var Ne={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20}},ee=H(K(Ne),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count)),selectedItems:v(()=>e.data().data.filter(p=>p.checked)),hasCheckedRows:v(()=>e.data().data.some(p=>p.checked))})),$(e=>{let p=u(w);return{updateFilter(a){b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},onRowSelect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!0}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onRowUnselect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!1}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onHeaderCheckboxToggle(a){b(e,n=>{let c=n.data.data.map(h=>d(l({},h),{checked:a}));return d(l({},n),{data:d(l({},n.data),{data:c})})})},loadData:Q(k(R(a=>p.getUnbalanceJournal(a).pipe(te(n=>d(l({},n),{data:n.data.map(c=>d(l({},c),{checked:!1}))})),W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}),G(e=>({onInit:()=>{e.loadData(e.filter)}})));var ze=()=>({height:"calc(100vh - 70px)"}),Ve=e=>["/pages/journal/journal-entry",e];function Fe(e,p){if(e&1){let t=E();o(0,"div",8),J(1,"p-button",9),o(2,"p-button",10),y("onClick",function(){x(t);let n=s(2);return C(n.regenerateUnbalanceJournal())}),r(3,"Regenerate"),i()()}}function Ae(e,p){if(e&1&&T(0,Fe,4,0,"div",7),e&2){let t=s();g("ngIf",t.store.hasCheckedRows())}}function je(e,p){e&1&&(o(0,"tr")(1,"th",12),J(2,"p-tableHeaderCheckbox"),i(),o(3,"th"),r(4,"Date"),i(),o(5,"th"),r(6,"Number"),i(),o(7,"th",13),r(8,"Debit SUM"),i(),o(9,"th",13),r(10,"Credit SUM"),i(),o(11,"th",13),r(12,"Difference"),i(),o(13,"th"),r(14,"Reference"),i(),o(15,"th"),r(16,"Outlet"),i()())}function He(e,p){if(e&1&&(o(0,"tr")(1,"td"),J(2,"p-tableCheckbox",14),i(),o(3,"td"),r(4),S(5,"date"),i(),o(6,"td")(7,"a",15),r(8),i()(),o(9,"td",13),r(10),S(11,"number"),i(),o(12,"td",13),r(13),S(14,"number"),i(),o(15,"td",13),r(16),S(17,"number"),i(),o(18,"td")(19,"a",16),r(20),i()(),o(21,"td"),r(22),i()()),e&2){let t=p.$implicit,a=s(2);m(2),g("value",t),m(2),f(re(5,10,t.date,"dd MMM yyyy")),m(3),g("routerLink",ie(19,Ve,t.id)),m(),f(t.number),m(2),f(U(11,13,t.debitSum)),m(3),f(U(14,15,t.creditSum)),m(3),f(U(17,17,t.differences)),m(3),g("href",a.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+t.id,oe),m(),f(t.referenceText),m(2),f(t.outletName)}}function Le(e,p){if(e&1&&r(0),e&2){let t=s(2);B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Ge(e,p){e&1&&(o(0,"tr")(1,"td",17)(2,"span"),r(3,"No records found."),i()()())}function $e(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",11),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))})("onRowSelect",function(n){x(t);let c=s();return C(c.onRowSelect(n))})("onRowUnselect",function(n){x(t);let c=s();return C(c.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){x(t);let c=s();return C(c.onHeaderCheckboxToggle(n))}),T(2,je,17,0,"ng-template",null,2,_)(4,He,23,21,"ng-template",null,3,_)(6,Le,1,3,"ng-template",null,4,_)(8,Ge,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(7,ze)),m(),g("value",t.store.data().data)("lazy",!0)("paginator",!0)("rows",t.store.filter().PageSize)("totalRecords",t.store.data().count)}}var we=(()=>{class e{constructor(){this.store=u(ee),this.toolsService=u(w),this.authService=u(ue)}onPageChange(t){console.log("Page changed:",t);let a=t.first/t.rows;this.store.updateFilter({PageNumber:a+1})}onRowSelect(t){this.store.onRowSelect(t.data)}onRowUnselect(t){if(Array.isArray(t.data)){t.data.forEach(a=>{this.store.onRowUnselect(a)});return}else this.store.onRowUnselect(t.data)}onHeaderCheckboxToggle(t){this.store.onHeaderCheckboxToggle(t.checked)}regenerateUnbalanceJournal(){let a=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(a).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-unbalance-journal"]],features:[O([ee])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Unbalance Journal",3,"scrollable"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["paginatorStyleClass","d-flex justify-content-end","dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","6"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Ae,1,1,"ng-template",null,0,_)(3,$e,10,8,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,he,xe,be,_e,N,le,D,pe,fe,F,V,j,A,me,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Wt=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:ve},{path:"unbalance-journal",component:we}];export{Wt as TOOLS_ROUTES};
1
+ import{a as ue}from"./chunk-Y3URGAXL.js";import{b as be}from"./chunk-HG5MKVNR.js";import"./chunk-IGWIRCAS.js";import{a as Q,b as W}from"./chunk-3A4BFUGD.js";import{d as X,i as he,j as xe,k as Y}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Ce}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as ge}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as q}from"./chunk-WKE2HPSD.js";import"./chunk-VGNJD35F.js";import{a as A,b as j}from"./chunk-2XUSZCQL.js";import{a as b,b as H,c as L,d as G,e as $,f as K}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as _e,w as V,x as F}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{x as fe}from"./chunk-OIBDX2CA.js";import{e as z,l as me}from"./chunk-AOOG6YOT.js";import{a as se}from"./chunk-OR5FLZPY.js";import{a as de}from"./chunk-2MKKFLNJ.js";import{k as le,p as pe,q as D,s as N,z as ce}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as E,Cc as O,Db as T,Dc as P,Ec as ie,Lb as g,Nc as S,Ob as I,Oc as U,Pc as re,Rc as _,Vb as o,Wb as i,Xb as J,Y as R,_ as ne,bd as v,c as k,ca as ae,db as oe,ec as y,fc as s,hb as m,ia as u,qa as x,ra as C,rc as r,s as te,sc as f,vc as B,xb as M}from"./chunk-NMCKMUY4.js";import{a as l,b as d}from"./chunk-YQFG5XE2.js";var w=(()=>{class e{constructor(){this.httpService=u(se)}getGenerateCoa(t){let n={params:new ce().set("PageNumber",t.PageNumber).set("PageSize",t.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(t={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,t)}getUnbalanceJournal(t){return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal/"+t.PageNumber+"/"+t.PageSize)}updateUnbalanceJournal(t){let a={ListID:t};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",a)}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275prov=ae({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Te={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},Z=H(K(Te),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count))})),$(e=>{let p=u(w);return{updateFilter:a=>{b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},getUpdateCOA:Q(k(R(a=>p.getGenerateCoa(a).pipe(W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error(n)}})))))}}),G({onInit(e){e.getUpdateCOA(e.filter)}}));var ke=()=>({height:"calc(100vh - 70px)"}),Re=()=>({"min-width":"50rem"});function Me(e,p){if(e&1){let t=E();o(0,"p-button",7),y("onClick",function(){x(t);let n=s();return C(n.updateCoaBalance())}),i()}}function Ie(e,p){e&1&&(o(0,"tr")(1,"th"),r(2,"Code"),i(),o(3,"th"),r(4,"Name"),i(),o(5,"th"),r(6,"Outlet"),i(),o(7,"th"),r(8,"COA Balance"),i(),o(9,"th"),r(10,"Correct Balance"),i()())}function Je(e,p){if(e&1&&(o(0,"tr")(1,"td"),r(2),i(),o(3,"td")(4,"a",9),r(5),i()(),o(6,"td"),r(7),i(),o(8,"td"),r(9),S(10,"number"),i(),o(11,"td"),r(12),S(13,"number"),i()()),e&2){let t=p.$implicit;m(2),f(t.Code),m(2),g("routerLink","/pages/chart-of-account/account/"+t.ID),m(),f(t.Name),m(2),f(t.OutletName),m(2),f(U(10,6,t.Balance)),m(3),f(U(13,8,t.CorrectBalance))}}function Be(e,p){if(e&1&&(o(0,"div",10)(1,"p",11),r(2),i()()),e&2){let t=s(2);m(2),B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Oe(e,p){e&1&&(o(0,"tr")(1,"td",12)(2,"span"),r(3,"No records found."),i()()())}function De(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",8),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))}),T(2,Ie,11,0,"ng-template",null,2,_)(4,Je,14,10,"ng-template",null,3,_)(6,Be,3,3,"ng-template",null,4,_)(8,Oe,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(8,ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",t.store.data().count)("rows",t.store.filter().PageSize)("value",t.store.data().data)("tableStyle",P(9,Re))}}var ve=(()=>{class e{constructor(){this.store=u(Z),this.coaService=u(w),this.toastrService=u(de)}onPageChange(t){this.store.updateFilter(d(l({},this.store.filter()),{PageNumber:Math.floor(t.first/t.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ce("Update COA Balance"),ne(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-tools-update-coa"]],features:[O([Z])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Me,1,0,"ng-template",null,0,_)(3,De,10,10,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,ge,N,D,F,V,j,A,z],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return e})();var Ne={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20}},ee=H(K(Ne),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count)),selectedItems:v(()=>e.data().data.filter(p=>p.checked)),hasCheckedRows:v(()=>e.data().data.some(p=>p.checked))})),$(e=>{let p=u(w);return{updateFilter(a){b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},onRowSelect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!0}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onRowUnselect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!1}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onHeaderCheckboxToggle(a){b(e,n=>{let c=n.data.data.map(h=>d(l({},h),{checked:a}));return d(l({},n),{data:d(l({},n.data),{data:c})})})},loadData:Q(k(R(a=>p.getUnbalanceJournal(a).pipe(te(n=>d(l({},n),{data:n.data.map(c=>d(l({},c),{checked:!1}))})),W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}),G(e=>({onInit:()=>{e.loadData(e.filter)}})));var ze=()=>({height:"calc(100vh - 70px)"}),Ve=e=>["/pages/journal/journal-entry",e];function Fe(e,p){if(e&1){let t=E();o(0,"div",8),J(1,"p-button",9),o(2,"p-button",10),y("onClick",function(){x(t);let n=s(2);return C(n.regenerateUnbalanceJournal())}),r(3,"Regenerate"),i()()}}function Ae(e,p){if(e&1&&T(0,Fe,4,0,"div",7),e&2){let t=s();g("ngIf",t.store.hasCheckedRows())}}function je(e,p){e&1&&(o(0,"tr")(1,"th",12),J(2,"p-tableHeaderCheckbox"),i(),o(3,"th"),r(4,"Date"),i(),o(5,"th"),r(6,"Number"),i(),o(7,"th",13),r(8,"Debit SUM"),i(),o(9,"th",13),r(10,"Credit SUM"),i(),o(11,"th",13),r(12,"Difference"),i(),o(13,"th"),r(14,"Reference"),i(),o(15,"th"),r(16,"Outlet"),i()())}function He(e,p){if(e&1&&(o(0,"tr")(1,"td"),J(2,"p-tableCheckbox",14),i(),o(3,"td"),r(4),S(5,"date"),i(),o(6,"td")(7,"a",15),r(8),i()(),o(9,"td",13),r(10),S(11,"number"),i(),o(12,"td",13),r(13),S(14,"number"),i(),o(15,"td",13),r(16),S(17,"number"),i(),o(18,"td")(19,"a",16),r(20),i()(),o(21,"td"),r(22),i()()),e&2){let t=p.$implicit,a=s(2);m(2),g("value",t),m(2),f(re(5,10,t.date,"dd MMM yyyy")),m(3),g("routerLink",ie(19,Ve,t.id)),m(),f(t.number),m(2),f(U(11,13,t.debitSum)),m(3),f(U(14,15,t.creditSum)),m(3),f(U(17,17,t.differences)),m(3),g("href",a.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+t.id,oe),m(),f(t.referenceText),m(2),f(t.outletName)}}function Le(e,p){if(e&1&&r(0),e&2){let t=s(2);B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Ge(e,p){e&1&&(o(0,"tr")(1,"td",17)(2,"span"),r(3,"No records found."),i()()())}function $e(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",11),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))})("onRowSelect",function(n){x(t);let c=s();return C(c.onRowSelect(n))})("onRowUnselect",function(n){x(t);let c=s();return C(c.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){x(t);let c=s();return C(c.onHeaderCheckboxToggle(n))}),T(2,je,17,0,"ng-template",null,2,_)(4,He,23,21,"ng-template",null,3,_)(6,Le,1,3,"ng-template",null,4,_)(8,Ge,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(7,ze)),m(),g("value",t.store.data().data)("lazy",!0)("paginator",!0)("rows",t.store.filter().PageSize)("totalRecords",t.store.data().count)}}var we=(()=>{class e{constructor(){this.store=u(ee),this.toolsService=u(w),this.authService=u(ue)}onPageChange(t){console.log("Page changed:",t);let a=t.first/t.rows;this.store.updateFilter({PageNumber:a+1})}onRowSelect(t){this.store.onRowSelect(t.data)}onRowUnselect(t){if(Array.isArray(t.data)){t.data.forEach(a=>{this.store.onRowUnselect(a)});return}else this.store.onRowUnselect(t.data)}onHeaderCheckboxToggle(t){this.store.onHeaderCheckboxToggle(t.checked)}regenerateUnbalanceJournal(){let a=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(a).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-unbalance-journal"]],features:[O([ee])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Unbalance Journal",3,"scrollable"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["paginatorStyleClass","d-flex justify-content-end","dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","6"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Ae,1,1,"ng-template",null,0,_)(3,$e,10,8,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,he,xe,be,_e,N,le,D,pe,fe,F,V,j,A,me,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Wt=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:ve},{path:"unbalance-journal",component:we}];export{Wt as TOOLS_ROUTES};
@@ -1,4 +1,4 @@
1
- import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-IHZ55QSI.js";import{a as Zt,b as gi,c as ni}from"./chunk-HAQ36ZI6.js";import{a as kt,b as zt}from"./chunk-OVAQBQEJ.js";import{a as Xt}from"./chunk-A3XYHEBB.js";import{a as qe}from"./chunk-QF4D5YPK.js";import{a as Ot}from"./chunk-VJ3IBUVO.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{c as je}from"./chunk-Q5CVMJZC.js";import{a as Vt}from"./chunk-3GGXPPQT.js";import{a as Lt}from"./chunk-MFK5RQPJ.js";import{a as qt,b as Wt}from"./chunk-KJ2WX3FC.js";import{a as $e}from"./chunk-6GN3MGBY.js";import{a as Qe}from"./chunk-Q24GCSGD.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-Y2PXP5OT.js";import{c as Qt}from"./chunk-VGNJD35F.js";import{a as At,b as Bt}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import{i as Mt}from"./chunk-ARH3WEEF.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-OIBDX2CA.js";import{d as Tt}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as re,j as yt,k as G,l as Le,m as ae,s as me,t as ge}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,$c as Q,Aa as S,Ba as le,Bb as xe,Cc as pt,Db as p,Dc as ee,Ec as P,Fa as Se,Fc as te,Gc as ht,Ha as X,Hc as ut,I as Ye,Jc as mt,Kb as ne,La as it,Lb as a,Mb as at,Nc as gt,Ob as Z,Pb as j,Pc as ft,Qb as Ie,Rb as Ee,Rc as x,Tb as ke,Ub as ze,Vb as d,Vc as bt,Wb as h,Xb as I,Yb as q,Zb as W,_ as Ce,_b as T,_c as w,ca as we,cd as _t,da as et,ec as k,fb as ot,fc as m,g as J,hb as s,ia as B,kc as _,lc as E,m as Ze,mb as lt,mc as g,nb as N,nc as f,pa as tt,qa as L,qc as Y,ra as M,rc as b,sc as A,tc as ue,ua as ve,wc as st,xb as U,xc as ct,yb as nt,yc as dt,zb as rt}from"./chunk-NMCKMUY4.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
1
+ import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-IHZ55QSI.js";import{a as Zt,b as gi,c as ni}from"./chunk-HAQ36ZI6.js";import{a as kt,b as zt}from"./chunk-OVAQBQEJ.js";import{a as Xt}from"./chunk-BKLUYVDG.js";import{a as qe}from"./chunk-QF4D5YPK.js";import{a as Ot}from"./chunk-VJ3IBUVO.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{c as je}from"./chunk-Q5CVMJZC.js";import{a as Vt}from"./chunk-3GGXPPQT.js";import{a as Lt}from"./chunk-MFK5RQPJ.js";import{a as qt,b as Wt}from"./chunk-KJ2WX3FC.js";import{a as $e}from"./chunk-6GN3MGBY.js";import{a as Qe}from"./chunk-Q24GCSGD.js";import{e as Kt,f as $t,g as Ut,h as jt}from"./chunk-WKE2HPSD.js";import{c as Qt}from"./chunk-VGNJD35F.js";import{a as At,b as Bt}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import{i as Mt}from"./chunk-ARH3WEEF.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{B as De,Ca as It,Ga as be,L as wt,La as _e,M as Pe,Ma as Fe,P as ie,Q as z,R as fe,S as Ve,Ua as Et,W as vt,X as St,Y as se,_ as ce,na as Ne,qa as xt,ra as V,sa as Oe,w as Ct,y as Me,z as Re}from"./chunk-OIBDX2CA.js";import{d as Tt}from"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{h as re,j as yt,k as G,l as Le,m as ae,s as me,t as ge}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,$c as Q,Aa as S,Ba as le,Bb as xe,Cc as pt,Db as p,Dc as ee,Ec as P,Fa as Se,Fc as te,Gc as ht,Ha as X,Hc as ut,I as Ye,Jc as mt,Kb as ne,La as it,Lb as a,Mb as at,Nc as gt,Ob as Z,Pb as j,Pc as ft,Qb as Ie,Rb as Ee,Rc as x,Tb as ke,Ub as ze,Vb as d,Vc as bt,Wb as h,Xb as I,Yb as q,Zb as W,_ as Ce,_b as T,_c as w,ca as we,cd as _t,da as et,ec as k,fb as ot,fc as m,g as J,hb as s,ia as B,kc as _,lc as E,m as Ze,mb as lt,mc as g,nb as N,nc as f,pa as tt,qa as L,qc as Y,ra as M,rc as b,sc as A,tc as ue,ua as ve,wc as st,xb as U,xc as ct,yb as nt,yc as dt,zb as rt}from"./chunk-NMCKMUY4.js";import{a as $,b as he,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
2
2
  /* For PrimeNG */
3
3
  .p-treetable {
4
4
  position: relative;
@@ -1 +1 @@
1
- import{a as X}from"./chunk-IZCYMXSH.js";import{d as W,i as q,j as K,k as G}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Q}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as O}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as B}from"./chunk-H6HNANYB.js";import{a as N,b as U}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{k as I}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as T,Db as h,Ec as A,Ha as b,L as R,Lb as d,Qb as v,Rc as _,Vb as i,Wb as o,Xb as w,Y as J,_ as k,bd as S,cd as H,ec as x,fc as r,hb as f,ia as D,qa as m,ra as c,rc as u,s as j,sc as V,vc as F,wc as M,xb as E,xc as z,yc as P}from"./chunk-NMCKMUY4.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0)}}function re(t,p){if(t&1&&h(0,le,9,6,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(Q("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows","scrollable"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,G,W,q,K,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
1
+ import{a as X}from"./chunk-NHIAQTUJ.js";import{d as W,i as q,j as K,k as G}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Q}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as O}from"./chunk-WKE2HPSD.js";import"./chunk-VGNJD35F.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as B}from"./chunk-H6HNANYB.js";import{a as N,b as U}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{k as I}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as T,Db as h,Ec as A,Ha as b,L as R,Lb as d,Qb as v,Rc as _,Vb as i,Wb as o,Xb as w,Y as J,_ as k,bd as S,cd as H,ec as x,fc as r,hb as f,ia as D,qa as m,ra as c,rc as u,s as j,sc as V,vc as F,wc as M,xb as E,xc as z,yc as P}from"./chunk-NMCKMUY4.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0)}}function re(t,p){if(t&1&&h(0,le,9,6,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(Q("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows","scrollable"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,G,W,q,K,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-BPBHYTKN.js";import{a as ze}from"./chunk-MOUK63TZ.js";import{a as je,b as Be}from"./chunk-BLR3HBYP.js";import{a as oe}from"./chunk-FYFSBGP3.js";import{b as A}from"./chunk-JYEZYL2U.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import"./chunk-IGWIRCAS.js";import{a as z,b as j}from"./chunk-3A4BFUGD.js";import{d as ke,i as Ne,j as Pe,k as Re}from"./chunk-EL5BUFMO.js";import{a as De,b as Ae}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import{a as Fe,b as Je}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as Ee,h as Ve}from"./chunk-Y2PXP5OT.js";import{b as Ie,c as Te}from"./chunk-VGNJD35F.js";import{a as xe,b as Ce}from"./chunk-2XUSZCQL.js";import{a as y,b as Se,c as be,d as ve,e as ye,f as we}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as fe,o as _e,w as ge,x as he}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as re,c as ae,e as le,f as pe,k as me,l as se,o as ce,u as de,x as ue}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as Y,j as Z,k as ee,n as te,p as ie,s as ne}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as w,Bb as K,Cc as Q,Db as x,Ec as V,Ha as P,Lb as c,Nc as T,Oc as X,Pc as D,Rc as v,Vb as r,Wb as o,Xb as S,Y as N,_ as H,bd as E,c as J,cb as U,db as L,ec as I,fc as _,hb as l,ia as C,qa as g,ra as h,rc as s,s as k,sc as b,tc as R,vc as W,wc as $,xb as G,xc as M,yc as q}from"./chunk-NMCKMUY4.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=Se(we(Ke),be(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))})),ye(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)}})))))}}),ve(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function We(t,a){if(t&1){let e=w();r(0,"p-button",10),I("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,"Outlet"),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),T(12,"date"),o(),r(13,"td"),s(14),T(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),I("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),T(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,"Outlet"),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),T(19,"async"),I("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,O,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(18,O,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",X(19,14,e.supplierSuggestions$)),l(5),c("ngClass",V(20,O,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:Oe,pageSize:He,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(Oe),pageSize:this.fb.control(He,[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(H(()=>{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","AP Collection",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 Outlet",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)}),I("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,Te,Ie,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Qt as ApJournalComponent};
1
+ import{a as F}from"./chunk-ETHACYOI.js";import{a as ze}from"./chunk-FMHGC2MA.js";import{a as je,b as Be}from"./chunk-BLR3HBYP.js";import{a as oe}from"./chunk-Y3URGAXL.js";import{b as A}from"./chunk-DFGIXWZK.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import"./chunk-IGWIRCAS.js";import{a as z,b as j}from"./chunk-3A4BFUGD.js";import{d as ke,i as Ne,j as Pe,k as Re}from"./chunk-EL5BUFMO.js";import{a as De,b as Ae}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import{a as Fe,b as Je}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as Ee,h as Ve}from"./chunk-WKE2HPSD.js";import{b as Ie,c as Te}from"./chunk-VGNJD35F.js";import{a as xe,b as Ce}from"./chunk-2XUSZCQL.js";import{a as y,b as Se,c as be,d as ve,e as ye,f as we}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as fe,o as _e,w as ge,x as he}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as re,c as ae,e as le,f as pe,k as me,l as se,o as ce,u as de,x as ue}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{h as Y,j as Z,k as ee,n as te,p as ie,s as ne}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as w,Bb as K,Cc as Q,Db as x,Ec as V,Ha as P,Lb as c,Nc as T,Oc as X,Pc as D,Rc as v,Vb as r,Wb as o,Xb as S,Y as N,_ as H,bd as E,c as J,cb as U,db as L,ec as I,fc as _,hb as l,ia as C,qa as g,ra as h,rc as s,s as k,sc as b,tc as R,vc as W,wc as $,xb as G,xc as M,yc as q}from"./chunk-NMCKMUY4.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=Se(we(Ke),be(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))})),ye(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)}})))))}}),ve(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function We(t,a){if(t&1){let e=w();r(0,"p-button",10),I("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,"Outlet"),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),T(12,"date"),o(),r(13,"td"),s(14),T(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),I("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),T(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,"Outlet"),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),T(19,"async"),I("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,O,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(18,O,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",X(19,14,e.supplierSuggestions$)),l(5),c("ngClass",V(20,O,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:Oe,pageSize:He,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(Oe),pageSize:this.fb.control(He,[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(H(()=>{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","AP Collection",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 Outlet",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)}),I("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,Te,Ie,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Qt as ApJournalComponent};
@@ -1 +1 @@
1
- import{a as i,b as T}from"./chunk-IGWIRCAS.js";import{d as s}from"./chunk-AOOG6YOT.js";import{a as l,d as m}from"./chunk-R7TX5W65.js";import{_ as a,ca as c,ia as r}from"./chunk-NMCKMUY4.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
1
+ import{a as i,b as T}from"./chunk-IGWIRCAS.js";import{d as s}from"./chunk-AOOG6YOT.js";import{a as l,d as m}from"./chunk-OR5FLZPY.js";import{_ as a,ca as c,ia as r}from"./chunk-NMCKMUY4.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
@@ -1 +1 @@
1
- import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-XD7VHCRC.js";import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as de,b as fe}from"./chunk-3A4BFUGD.js";import{d as le,e as Je,i as Ke,j as qe,k as ne}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Le}from"./chunk-QF4D5YPK.js";import{a as re,b as pe}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as W,b as j}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as Ae,b as J}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as M}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as Y,b as $}from"./chunk-2XUSZCQL.js";import{a as Q,b as Fe,c as Te,d as we,e as Me,f as De,g as Ye}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as He,w as N,x as G}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as V,f as ye,j as te,k as Pe,l as be,m as Oe,n as ze,o as Ie,u as Ee,w as H,x as ae}from"./chunk-OIBDX2CA.js";import{b as ie,d as Ue,e as D,l as A}from"./chunk-AOOG6YOT.js";import{a as ve}from"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{k as B,o as je,s as w}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as v,Cc as Se,Db as x,Dc as z,Ec as oe,Ha as I,Lb as c,Nc as Ve,Ob as q,Oc as $e,Qb as Ce,Rb as P,Rc as u,Tb as b,Ub as O,Vb as r,Wb as a,Xb as Z,Y as U,_ as F,bd as ee,c as ue,ca as he,cd as We,ec as y,fc as s,hb as p,ia as h,qa as C,ra as S,rc as m,s as X,sc as _,tc as E,vc as Be,xb as T}from"./chunk-NMCKMUY4.js";import{a as f,b as g}from"./chunk-YQFG5XE2.js";var k=(()=>{class t{constructor(){this.httpService=h(ve)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(R||{});var it={[R.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[R.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[R.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[R.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[R.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[R.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[R.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[R.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[R.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function _t(t,i){if(t&1){let e=v();r(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.onSubmit())}),a()()}}function gt(t,i){if(t&1&&(r(0,"p-tab",10),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),_(e.label)}}function xt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function ht(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ct(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",17),m(6),a()(),r(7,"p-select",18),x(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function St(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function yt(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",20),m(6),a()(),r(7,"p-select",18),x(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Pt(t,i){if(t&1&&(r(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,Ct,12,4,"div",14,P),a()(),r(6,"div",12)(7,"div",13),b(8,yt,12,4,"div",14,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function bt(t,i){if(t&1){let e=v();r(0,"form",8),y("ngSubmit",function(){C(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",9)(2,"p-tablist"),b(3,gt,2,2,"p-tab",10,P),a(),r(5,"p-tabpanels"),b(6,Pt,10,2,"p-tabpanel",10,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,i){if(t&1&&x(0,bt,8,3,"form",7),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(k),this.fb=h(Ee),this.tab=I(R.POSGLOBAL_SELL),this.tabs=I(Object.values(R).map(e=>({label:e,value:e}))),this.posIntegration=I(null),this.form=I([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=R}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let ce=`${d}_${L}`;o.has(ce)||(o.add(ce),n.push({typeID:d,accountID:L||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),a())},dependencies:[M,ot,nt,tt,et,Xe,Ze,He,j,W,H,Pe,V,ye,w,B,A,G,N,ae,be,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),_(e.name.slice(0,10))}}function Ft(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Et,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Tt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.accountName)}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Tt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,It,e.id)),p(),_(e.name),p(),O(e.accounts)}}function Mt(t,i){if(t&1&&(r(0,"p-table",5),x(1,Ft,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Dt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){C(e);let l=s();return S(l.onSearch(o))}),x(1,Mt,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var pt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.paymentConfiguration=I(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&x(0,Dt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ne,le,Je,w,B,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var At={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ne=Fe(De(At),Te(t=>({first:ee(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ee(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Me(t=>{let i=h(k);return{updateFilter:n=>{Q(t,o=>g(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:de(ue(U(n=>i.fetchPOSOutletConfiguration(n).pipe(fe({next:o=>{Q(t,l=>g(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),we(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function Rt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.value)}}function Lt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Rt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Nt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Nt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,kt,e.OutletID)),p(),E(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,i){if(t&1&&m(0),t&2){let e=s(2);Be(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function $t(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=s();return S(l.onPage(o))}),x(2,Lt,5,0,"ng-template",null,1,u)(4,Gt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var lt=(()=>{class t{constructor(){this.store=h(Ne)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(g(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[Se([Ne])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return C(l),S(o.onSearch(L))}),x(1,$t,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,J,ne,le,A,D,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),jt=()=>({height:"calc(100vh - 150px)"});function Ut(t,i){if(t&1){let e=v();r(0,"a",5),m(1,"Cancel"),a(),r(2,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.updatePOsOutletConfiguration())}),a()}}function zt(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ht(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Yt(t,i){if(t&1&&(r(0,"div",12)(1,"span",14),m(2),a(),r(3,"p-select",15),x(4,zt,7,2,"ng-template",null,2,u)(6,Ht,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),_((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Jt(t,i){t&1&&Z(0,"hr")}function Kt(t,i){if(t&1&&(r(0,"div",9)(1,"h3",10),m(2),Ve(3,"titlecase"),a(),r(4,"div",11),b(5,Yt,8,3,"div",12,P),a()(),x(7,Jt,1,0,"hr",13)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),E(" ",$e(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function qt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Kt,8,5,null,null,P),a()()()()),t&2){let e=s();q(z(5,Wt)),p(),q(z(6,jt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.outletForm=I(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Ee)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,Ut,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),a()),n&2&&c("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,B,je,J,ae,Pe,V,ye,be,Ie,Oe,ze,j,W,$,Y,re,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,i){if(t&1){let e=v();r(0,"a",6),m(1,"Cancel"),a(),r(2,"p-button",7),y("onClick",function(){C(e);let o=s(3);return S(o.updatePOSOutletConfiguration())}),a()}}function on(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function an(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function rn(t,i){if(t&1){let e=v();r(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),a()(),Z(5,"div",13),r(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),x(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),_(e.outletName.slice(0,15)),p(3),q(z(7,tn)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,rn,12,8,"div",9,P),a()()()),t&2){let e=s(3);q(z(4,Zt)),p(),q(z(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,i){if(t&1&&(r(0,"app-main-panel",4),x(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,i){if(t&1&&x(0,ln,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var st=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.paymentForm=I(null),this.router=h(Ue)}ngOnInit(){this.route.paramMap.pipe(X(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Le("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=g(f({},this.paymentForm()),{form:g(f({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Le("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&x(0,mn,1,1,"app-main-panel",4),n&2&&Ce(o.paymentForm()?0:-1)},dependencies:[J,Ae,M,w,B,pe,re,j,W,H,V,te,A,D,G,N,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function sn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSTaxConfiguration())}),a()()}}function cn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",15)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function un(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function dn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),x(5,cn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),_(e.name),p(),c("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),b(4,dn,9,3,"div",11,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(k),this.taxForm=I(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=g(f({},this.taxForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,sn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,J,w,j,W,pe,H,V,te,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,i){t&1&&Z(0,"p-button",6)}function hn(t,i){if(t&1&&x(0,xn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function Cn(t,i){t&1&&(r(0,"tr")(1,"th",8),Z(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function Sn(t,i){if(t&1&&(r(0,"tr")(1,"td"),Z(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",oe(4,gn,e.id)),p(),_(e.name),p(2),_(e.description)}}function vn(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=s();return S(l.onSelectAll(o))}),x(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",z(2,_n))}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(k),this.writeoffList=I(null),this.hasCheckedItems=ee(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(X(e=>g(f({},e),{data:e.data.map(n=>g(f({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=g(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(g(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>g(f({},l),{checked:e.checked}));this.writeoffList.set(g(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,B,ne,le,Ke,qe,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Pn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){C(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function bn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function On(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function In(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),x(5,bn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),_(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,In,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),q(z(2,yn)),p(4),O(e.writeOffForm().form)}}function Fn(t,i){if(t&1&&(r(0,"app-main-panel",5),x(1,Pn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.route=h(ie),this.writeOffForm=I(null)}ngOnInit(){this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=g(f({},this.writeOffForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&x(0,Fn,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,B,J,Ae,pe,re,j,W,H,V,te,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=h(ve)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Ge=Fe(De(Tn),Ye("POSExpenseOptionStore"),Te(t=>({hasCheckedRows:ee(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ee(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),Me(t=>{let i=h(Re);return{onRowSelect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!0}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!1}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>g(f({},d),{checked:n}));return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:de(ue(U(()=>i.getExpenseOptions().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>g(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:de(ue(U(()=>i.getExpenseOptionsLoader().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),we({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function wn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSExpenseOptionConfiguration())}),a()()}}function Mn(t,i){if(t&1&&(r(0,"div",5)(1,"div",14)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function Dn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function An(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"label",12),m(3),a(),r(4,"p-select",13),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateData(o,l))}),x(5,Mn,4,1,"ng-template",null,2,u)(7,Dn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),_(n.name),p(),c("options",l.store.data().options.chartOfAccountOptions)("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")}}function kn(t,i){if(t&1&&b(0,An,9,3,"div",10,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function Rn(t,i){t&1&&(r(0,"div",9)(1,"p"),m(2,"No expense options available."),a()())}function Ln(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",8),x(4,kn,2,0)(5,Rn,3,0,"div",9),a()()()()),t&2){let e=s();p(4),Ce(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=h(Ge),this.expenseOptService=h(Re),this.expenseOptForm=I({ListData:[]}),this.originalData=I([]),We(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let ce=n[L];return ce&&d.AccountID!==ce.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=g(f({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[Se([Ge])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,wn,4,0,"ng-template",null,0,u)(3,Ln,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ne,$,Y,G,N,w,D,j,W,ae,V,H,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var za=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:lt},{path:"outlets/:id",component:mt},{path:"payments",component:pt},{path:"payments/:id",component:st},{path:"taxs",component:ct},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:ft}]}];export{za as POS_SETUP_ROUTES};
1
+ import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-XD7VHCRC.js";import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as de,b as fe}from"./chunk-3A4BFUGD.js";import{d as le,e as Je,i as Ke,j as qe,k as ne}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Le}from"./chunk-QF4D5YPK.js";import{a as re,b as pe}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as W,b as j}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as Ae,b as J}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as M}from"./chunk-WKE2HPSD.js";import"./chunk-VGNJD35F.js";import{a as Y,b as $}from"./chunk-2XUSZCQL.js";import{a as Q,b as Fe,c as Te,d as we,e as Me,f as De,g as Ye}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as He,w as N,x as G}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as V,f as ye,j as te,k as Pe,l as be,m as Oe,n as ze,o as Ie,u as Ee,w as H,x as ae}from"./chunk-OIBDX2CA.js";import{b as ie,d as Ue,e as D,l as A}from"./chunk-AOOG6YOT.js";import{a as ve}from"./chunk-OR5FLZPY.js";import"./chunk-2MKKFLNJ.js";import{k as B,o as je,s as w}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as v,Cc as Se,Db as x,Dc as z,Ec as oe,Ha as I,Lb as c,Nc as Ve,Ob as q,Oc as $e,Qb as Ce,Rb as P,Rc as u,Tb as b,Ub as O,Vb as r,Wb as a,Xb as Z,Y as U,_ as F,bd as ee,c as ue,ca as he,cd as We,ec as y,fc as s,hb as p,ia as h,qa as C,ra as S,rc as m,s as X,sc as _,tc as E,vc as Be,xb as T}from"./chunk-NMCKMUY4.js";import{a as f,b as g}from"./chunk-YQFG5XE2.js";var k=(()=>{class t{constructor(){this.httpService=h(ve)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(R||{});var it={[R.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[R.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[R.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[R.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[R.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[R.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[R.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[R.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[R.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function _t(t,i){if(t&1){let e=v();r(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.onSubmit())}),a()()}}function gt(t,i){if(t&1&&(r(0,"p-tab",10),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),_(e.label)}}function xt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function ht(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ct(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",17),m(6),a()(),r(7,"p-select",18),x(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function St(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",19)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function yt(t,i){if(t&1&&(r(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),a(),r(5,"span",20),m(6),a()(),r(7,"p-select",18),x(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),_(e.entry.value.label),p(2),_(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Pt(t,i){if(t&1&&(r(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,Ct,12,4,"div",14,P),a()(),r(6,"div",12)(7,"div",13),b(8,yt,12,4,"div",14,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function bt(t,i){if(t&1){let e=v();r(0,"form",8),y("ngSubmit",function(){C(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",9)(2,"p-tablist"),b(3,gt,2,2,"p-tab",10,P),a(),r(5,"p-tabpanels"),b(6,Pt,10,2,"p-tabpanel",10,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,i){if(t&1&&x(0,bt,8,3,"form",7),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(k),this.fb=h(Ee),this.tab=I(R.POSGLOBAL_SELL),this.tabs=I(Object.values(R).map(e=>({label:e,value:e}))),this.posIntegration=I(null),this.form=I([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=R}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let ce=`${d}_${L}`;o.has(ce)||(o.add(ce),n.push({typeID:d,accountID:L||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),a())},dependencies:[M,ot,nt,tt,et,Xe,Ze,He,j,W,H,Pe,V,ye,w,B,A,G,N,ae,be,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),_(e.name.slice(0,10))}}function Ft(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Et,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Tt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.accountName)}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Tt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,It,e.id)),p(),_(e.name),p(),O(e.accounts)}}function Mt(t,i){if(t&1&&(r(0,"p-table",5),x(1,Ft,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Dt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){C(e);let l=s();return S(l.onSearch(o))}),x(1,Mt,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var pt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.paymentConfiguration=I(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&x(0,Dt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ne,le,Je,w,B,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var At={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ne=Fe(De(At),Te(t=>({first:ee(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ee(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Me(t=>{let i=h(k);return{updateFilter:n=>{Q(t,o=>g(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:de(ue(U(n=>i.fetchPOSOutletConfiguration(n).pipe(fe({next:o=>{Q(t,l=>g(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),we(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function Rt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),_(e.value)}}function Lt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Rt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Nt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),_(e)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Nt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",oe(2,kt,e.OutletID)),p(),E(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,i){if(t&1&&m(0),t&2){let e=s(2);Be(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function $t(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=s();return S(l.onPage(o))}),x(2,Lt,5,0,"ng-template",null,1,u)(4,Gt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var lt=(()=>{class t{constructor(){this.store=h(Ne)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(g(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[Se([Ne])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return C(l),S(o.onSearch(L))}),x(1,$t,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,J,ne,le,A,D,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),jt=()=>({height:"calc(100vh - 150px)"});function Ut(t,i){if(t&1){let e=v();r(0,"a",5),m(1,"Cancel"),a(),r(2,"p-button",6),y("onClick",function(){C(e);let o=s();return S(o.updatePOsOutletConfiguration())}),a()}}function zt(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Ht(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function Yt(t,i){if(t&1&&(r(0,"div",12)(1,"span",14),m(2),a(),r(3,"p-select",15),x(4,zt,7,2,"ng-template",null,2,u)(6,Ht,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),_((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Jt(t,i){t&1&&Z(0,"hr")}function Kt(t,i){if(t&1&&(r(0,"div",9)(1,"h3",10),m(2),Ve(3,"titlecase"),a(),r(4,"div",11),b(5,Yt,8,3,"div",12,P),a()(),x(7,Jt,1,0,"hr",13)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),E(" ",$e(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function qt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Kt,8,5,null,null,P),a()()()()),t&2){let e=s();q(z(5,Wt)),p(),q(z(6,jt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.outletForm=I(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Ee)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,Ut,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),a()),n&2&&c("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,B,je,J,ae,Pe,V,ye,be,Ie,Oe,ze,j,W,$,Y,re,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,i){if(t&1){let e=v();r(0,"a",6),m(1,"Cancel"),a(),r(2,"p-button",7),y("onClick",function(){C(e);let o=s(3);return S(o.updatePOSOutletConfiguration())}),a()}}function on(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function an(t,i){if(t&1&&(r(0,"div",16)(1,"div",17)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",17),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function rn(t,i){if(t&1){let e=v();r(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),a()(),Z(5,"div",13),r(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),x(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),_(e.outletName.slice(0,15)),p(3),q(z(7,tn)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,rn,12,8,"div",9,P),a()()()),t&2){let e=s(3);q(z(4,Zt)),p(),q(z(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,i){if(t&1&&(r(0,"app-main-panel",4),x(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,i){if(t&1&&x(0,ln,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var st=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(k),this.paymentForm=I(null),this.router=h(Ue)}ngOnInit(){this.route.paramMap.pipe(X(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Le("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=g(f({},this.paymentForm()),{form:g(f({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Le("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&x(0,mn,1,1,"app-main-panel",4),n&2&&Ce(o.paymentForm()?0:-1)},dependencies:[J,Ae,M,w,B,pe,re,j,W,H,V,te,A,D,G,N,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function sn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSTaxConfiguration())}),a()()}}function cn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",15)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function un(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",15),m(6),a()()()),t&2){let e=i.$implicit;p(3),E("(",e.code,")"),p(3),_(e.name)}}function dn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),x(5,cn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),_(e.name),p(),c("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),b(4,dn,9,3,"div",11,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(k),this.taxForm=I(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=g(f({},this.taxForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,sn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,J,w,j,W,pe,H,V,te,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,i){t&1&&Z(0,"p-button",6)}function hn(t,i){if(t&1&&x(0,xn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function Cn(t,i){t&1&&(r(0,"tr")(1,"th",8),Z(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function Sn(t,i){if(t&1&&(r(0,"tr")(1,"td"),Z(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",oe(4,gn,e.id)),p(),_(e.name),p(2),_(e.description)}}function vn(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=s();return S(l.onSelectAll(o))}),x(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",z(2,_n))}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(k),this.writeoffList=I(null),this.hasCheckedItems=ee(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(X(e=>g(f({},e),{data:e.data.map(n=>g(f({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=g(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(g(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>g(f({},l),{checked:e.checked}));this.writeoffList.set(g(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,B,ne,le,Ke,qe,A,D,G,N,$,Y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Pn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){C(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function bn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function On(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),E("(",e.code,")"),p(2),_(e.name)}}function In(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),x(5,bn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),_(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,In,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),q(z(2,yn)),p(4),O(e.writeOffForm().form)}}function Fn(t,i){if(t&1&&(r(0,"app-main-panel",5),x(1,Pn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(k),this.route=h(ie),this.writeOffForm=I(null)}ngOnInit(){this.route.paramMap.pipe(X(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=g(f({},this.writeOffForm()),{form:o.map((d,L)=>L===n?g(f({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&x(0,Fn,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,B,J,Ae,pe,re,j,W,H,V,te,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=h(ve)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Ge=Fe(De(Tn),Ye("POSExpenseOptionStore"),Te(t=>({hasCheckedRows:ee(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ee(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),Me(t=>{let i=h(Re);return{onRowSelect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!0}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?g(f({},d),{checked:!1}):d);return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Q(t,o=>{let l=o.data.expenseOptions.map(d=>g(f({},d),{checked:n}));return g(f({},o),{data:g(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:de(ue(U(()=>i.getExpenseOptions().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>g(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:de(ue(U(()=>i.getExpenseOptionsLoader().pipe(fe({next:n=>{Q(t,o=>g(f({},o),{data:g(f({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),we({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function wn(t,i){if(t&1){let e=v();r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),r(3,"p-button",7),y("onClick",function(){C(e);let o=s();return S(o.updatePOSExpenseOptionConfiguration())}),a()()}}function Mn(t,i){if(t&1&&(r(0,"div",5)(1,"div",14)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function Dn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",14),m(3),a()()()),t&2){let e=i.$implicit;p(3),_(e.value)}}function An(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"label",12),m(3),a(),r(4,"p-select",13),y("ngModelChange",function(o){let l=C(e).$index,d=s(3);return S(d.updateData(o,l))}),x(5,Mn,4,1,"ng-template",null,2,u)(7,Dn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),_(n.name),p(),c("options",l.store.data().options.chartOfAccountOptions)("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")}}function kn(t,i){if(t&1&&b(0,An,9,3,"div",10,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function Rn(t,i){t&1&&(r(0,"div",9)(1,"p"),m(2,"No expense options available."),a()())}function Ln(t,i){if(t&1&&(r(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",8),x(4,kn,2,0)(5,Rn,3,0,"div",9),a()()()()),t&2){let e=s();p(4),Ce(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=h(Ge),this.expenseOptService=h(Re),this.expenseOptForm=I({ListData:[]}),this.originalData=I([]),We(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let ce=n[L];return ce&&d.AccountID!==ce.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=g(f({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[Se([Ge])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),x(1,wn,4,0,"ng-template",null,0,u)(3,Ln,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ne,$,Y,G,N,w,D,j,W,ae,V,H,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var za=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:lt},{path:"outlets/:id",component:mt},{path:"payments",component:pt},{path:"payments/:id",component:st},{path:"taxs",component:ct},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:ft}]}];export{za as POS_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{b as E}from"./chunk-JYEZYL2U.js";import{b as w}from"./chunk-VJ3IBUVO.js";import{a as T,b as j}from"./chunk-KJ2WX3FC.js";import{b as P}from"./chunk-2XUSZCQL.js";import{x as b}from"./chunk-H6HNANYB.js";import{a as y}from"./chunk-R7TX5W65.js";import{q as O,s as A,z as _}from"./chunk-VZ5CMS5O.js";import{Db as C,Ea as c,Nc as M,Pc as S,Rc as a,Vb as i,Wb as r,Xb as x,ca as s,fc as m,hb as u,ia as g,rc as p,sc as v,tc as l,xb as h}from"./chunk-NMCKMUY4.js";var N=(()=>{class t{constructor(){this.httpService=g(y),this.dayjs=g(E)}migrateTaxAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/tax",{})}getManualJournalCount(){return this.httpService.get(void 0,"api/migrate/accounting/journalheader-count",{})}getCOACount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountcount",{})}getCOAConfigurationCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountConfigcount",{})}getCOACategoryCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountCategorycount",{})}getOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/outletaccount-count",{})}getPaymentMethodAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/paymentmethodaccountcount",{})}getWriteOffOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/writeoffoutletaccountCount",{})}getTaxAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/taxcount",{})}getExpenseAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/expenseaccountcount",{})}migrateCoaAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccount",{})}migrateCoaConfig(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountConfig",{})}migrateCoaCategory(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountCategory",{})}migrateOutletAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/outletaccount",{})}migrateManualJournal(e){let n={From:e.From?this.dayjs.from(e.From).format():null,To:e.To?this.dayjs.from(e.To).format():null,PageNumber:e.PageNumber||1,PageSize:e.PageSize||50},o=new _;return Object.keys(n).forEach(f=>{o=o.append(f,n[f])}),this.httpService.get(void 0,"api/migrate/accounting/journalheader",{params:o})}formatManualCOA(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa",{})}formatExpenseAccount(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-expenseaccount",{})}formatWriteOff(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-writeoff",{})}formatManualCOAConfig(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa-config",{})}formatOutletAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-outlet-account",{})}formatPaymentAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-paymentmethod",{})}formatTaxAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-tax",{})}formatManualJournal(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-journal",{})}formatManualCOACategory(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-coag",{})}migratePaymentMethod(){return this.httpService.post(void 0,"api/Migrate/accounting/paymentmethodaccount",{})}migrateWriteOffOutlet(){return this.httpService.post(void 0,"api/Migrate/accounting/writeoffoutletaccount",{})}migrateExpenseAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/expenseaccount",{})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=s({token:t,factory:t.\u0275fac})}}return t})();function F(t,d){t&1&&(i(0,"div",5)(1,"div",6),x(2,"i",7),r()())}function I(t,d){if(t&1&&(i(0,"div",8),p(1),M(2,"number"),r()),t&2){let e=m();u(),l(" ",S(2,1,e.migrationCount(),"1.0-0")," ")}}function D(t,d){if(t&1&&(i(0,"div",9),p(1),r()),t&2){let e=m();u(),l(" ",e.migrationTitle()," ")}}function R(t,d){if(t&1&&(i(0,"div",10)(1,"div",11),p(2),r()()),t&2){let e=m();u(2),v(e.migrationPlace())}}var q=(()=>{class t{constructor(){this.migrationTitle=c(),this.migrationCount=c(),this.migrationPlace=c()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["app-migration-cards"]],inputs:{migrationTitle:[1,"migrationTitle"],migrationCount:[1,"migrationCount"],migrationPlace:[1,"migrationPlace"]},decls:9,vars:0,consts:[["header",""],["title",""],["subtitle",""],["footer",""],[1,"text-center","flex","flex-column","justify-content-center","align-items-center","card-shadow","responsive-card"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center","align-items-center","mt-4",2,"width","60px","height","60px","background-color","#e0f0ff","border-radius","50%"],[1,"icon","fa-file-lines","fa-light",2,"font-size","25px","color","#007bff"],[1,"bigscale","fw-bold"],[1,"text-sm","text-secondary"],[1,"flex","mt-5"],[1,"p-6","fs-7","fw-bold"]],template:function(n,o){n&1&&(i(0,"p-card",4),C(1,F,3,0,"ng-template",null,0,a)(3,I,3,4,"ng-template",null,1,a)(5,D,2,1,"ng-template",null,2,a)(7,R,3,1,"ng-template",null,3,a),r())},dependencies:[A,O,j,T,b,w,P],styles:["[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}[_nghost-%COMP%] .p-card{box-shadow:0 .25rem 1.25rem #0000001a!important;width:21.875rem!important;height:25rem!important}@media (max-width: 85rem){[_nghost-%COMP%] .p-card{width:18.875rem!important;height:21rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:2rem!important;margin-top:1rem!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){[_nghost-%COMP%] .p-card{width:21rem!important;height:25rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}}@media (min-width: 98rem){[_nghost-%COMP%] .p-card{width:25rem!important;height:28rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:5rem!important;margin-top:2rem!important}}"]})}}return t})();export{N as a,q as b};
1
+ import{b as E}from"./chunk-DFGIXWZK.js";import{b as w}from"./chunk-VJ3IBUVO.js";import{a as T,b as j}from"./chunk-KJ2WX3FC.js";import{b as P}from"./chunk-2XUSZCQL.js";import{x as b}from"./chunk-H6HNANYB.js";import{a as y}from"./chunk-OR5FLZPY.js";import{q as O,s as A,z as _}from"./chunk-VZ5CMS5O.js";import{Db as C,Ea as c,Nc as M,Pc as S,Rc as a,Vb as i,Wb as r,Xb as x,ca as s,fc as m,hb as u,ia as g,rc as p,sc as v,tc as l,xb as h}from"./chunk-NMCKMUY4.js";var N=(()=>{class t{constructor(){this.httpService=g(y),this.dayjs=g(E)}migrateTaxAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/tax",{})}getManualJournalCount(){return this.httpService.get(void 0,"api/migrate/accounting/journalheader-count",{})}getCOACount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountcount",{})}getCOAConfigurationCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountConfigcount",{})}getCOACategoryCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountCategorycount",{})}getOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/outletaccount-count",{})}getPaymentMethodAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/paymentmethodaccountcount",{})}getWriteOffOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/writeoffoutletaccountCount",{})}getTaxAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/taxcount",{})}getExpenseAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/expenseaccountcount",{})}migrateCoaAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccount",{})}migrateCoaConfig(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountConfig",{})}migrateCoaCategory(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountCategory",{})}migrateOutletAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/outletaccount",{})}migrateManualJournal(e){let n={From:e.From?this.dayjs.from(e.From).format():null,To:e.To?this.dayjs.from(e.To).format():null,PageNumber:e.PageNumber||1,PageSize:e.PageSize||50},o=new _;return Object.keys(n).forEach(f=>{o=o.append(f,n[f])}),this.httpService.get(void 0,"api/migrate/accounting/journalheader",{params:o})}formatManualCOA(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa",{})}formatExpenseAccount(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-expenseaccount",{})}formatWriteOff(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-writeoff",{})}formatManualCOAConfig(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa-config",{})}formatOutletAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-outlet-account",{})}formatPaymentAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-paymentmethod",{})}formatTaxAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-tax",{})}formatManualJournal(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-journal",{})}formatManualCOACategory(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-coag",{})}migratePaymentMethod(){return this.httpService.post(void 0,"api/Migrate/accounting/paymentmethodaccount",{})}migrateWriteOffOutlet(){return this.httpService.post(void 0,"api/Migrate/accounting/writeoffoutletaccount",{})}migrateExpenseAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/expenseaccount",{})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=s({token:t,factory:t.\u0275fac})}}return t})();function F(t,d){t&1&&(i(0,"div",5)(1,"div",6),x(2,"i",7),r()())}function I(t,d){if(t&1&&(i(0,"div",8),p(1),M(2,"number"),r()),t&2){let e=m();u(),l(" ",S(2,1,e.migrationCount(),"1.0-0")," ")}}function D(t,d){if(t&1&&(i(0,"div",9),p(1),r()),t&2){let e=m();u(),l(" ",e.migrationTitle()," ")}}function R(t,d){if(t&1&&(i(0,"div",10)(1,"div",11),p(2),r()()),t&2){let e=m();u(2),v(e.migrationPlace())}}var q=(()=>{class t{constructor(){this.migrationTitle=c(),this.migrationCount=c(),this.migrationPlace=c()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["app-migration-cards"]],inputs:{migrationTitle:[1,"migrationTitle"],migrationCount:[1,"migrationCount"],migrationPlace:[1,"migrationPlace"]},decls:9,vars:0,consts:[["header",""],["title",""],["subtitle",""],["footer",""],[1,"text-center","flex","flex-column","justify-content-center","align-items-center","card-shadow","responsive-card"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center","align-items-center","mt-4",2,"width","60px","height","60px","background-color","#e0f0ff","border-radius","50%"],[1,"icon","fa-file-lines","fa-light",2,"font-size","25px","color","#007bff"],[1,"bigscale","fw-bold"],[1,"text-sm","text-secondary"],[1,"flex","mt-5"],[1,"p-6","fs-7","fw-bold"]],template:function(n,o){n&1&&(i(0,"p-card",4),C(1,F,3,0,"ng-template",null,0,a)(3,I,3,4,"ng-template",null,1,a)(5,D,2,1,"ng-template",null,2,a)(7,R,3,1,"ng-template",null,3,a),r())},dependencies:[A,O,j,T,b,w,P],styles:["[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}[_nghost-%COMP%] .p-card{box-shadow:0 .25rem 1.25rem #0000001a!important;width:21.875rem!important;height:25rem!important}@media (max-width: 85rem){[_nghost-%COMP%] .p-card{width:18.875rem!important;height:21rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:2rem!important;margin-top:1rem!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){[_nghost-%COMP%] .p-card{width:21rem!important;height:25rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}}@media (min-width: 98rem){[_nghost-%COMP%] .p-card{width:25rem!important;height:28rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:5rem!important;margin-top:2rem!important}}"]})}}return t})();export{N as a,q as b};