dealposbooks 5.32.2 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/assets/scss/layouts/_sidebar.scss +1 -1
  2. package/assets/scss/style.scss +52 -6
  3. package/{chunk-ZM5TVQUU.js → chunk-6ATDYFCA.js} +1 -1
  4. package/chunk-6VZGWVBI.js +1 -0
  5. package/{chunk-CR2R5F5T.js → chunk-76K2CYGK.js} +1 -1
  6. package/{chunk-VJBDOS6M.js → chunk-7Q7GUZQB.js} +1 -1
  7. package/chunk-AWXT2WGR.js +180 -0
  8. package/{chunk-V5OZ47U6.js → chunk-BPAXVUBR.js} +1 -1
  9. package/{chunk-VVGZUJP6.js → chunk-BU5IXVPY.js} +1 -1
  10. package/{chunk-ICOTZOJJ.js → chunk-CM2QLSCG.js} +5 -5
  11. package/{chunk-QTALSVSB.js → chunk-FFGCE3TK.js} +1 -1
  12. package/{chunk-BJ7FEOET.js → chunk-GQWMJTTS.js} +1 -1
  13. package/{chunk-GK2S4TYF.js → chunk-H4PZGISP.js} +1 -1
  14. package/{chunk-CJ6UGNBN.js → chunk-JB4UBWDT.js} +1 -1
  15. package/{chunk-UVXRATHG.js → chunk-JL2CN3ZY.js} +1 -1
  16. package/{chunk-OQ52MPGS.js → chunk-KBT2GX7L.js} +1 -1
  17. package/{chunk-ALYAGR32.js → chunk-KINBDQRV.js} +1 -1
  18. package/{chunk-Y5FQDBGQ.js → chunk-LMNTEWLI.js} +1 -1
  19. package/{chunk-W4GXLPRM.js → chunk-MNFWDRDS.js} +1 -1
  20. package/{chunk-ERFXO32T.js → chunk-MPFBVM6S.js} +1 -1
  21. package/{chunk-MEXKKLEE.js → chunk-MZGANYF3.js} +1 -1
  22. package/{chunk-NCY25JG4.js → chunk-OD62LD7H.js} +4 -4
  23. package/{chunk-FSEW3LUP.js → chunk-OFLZMVEN.js} +1 -1
  24. package/{chunk-FP5LIX5S.js → chunk-P37DL4A6.js} +1 -1
  25. package/{chunk-MDH73MG3.js → chunk-P7Z64VPC.js} +1 -1
  26. package/{chunk-5OYK64TO.js → chunk-PBN5IYNX.js} +1 -1
  27. package/{chunk-SZ3LQIKH.js → chunk-PDFK6YU3.js} +1 -1
  28. package/{chunk-SASCD5HU.js → chunk-PI5RBOCG.js} +1 -1
  29. package/{chunk-CMRVHYI7.js → chunk-QAQ2CXF3.js} +2 -2
  30. package/chunk-QVKOUG4C.js +7 -0
  31. package/{chunk-RQ4G322O.js → chunk-R2SYW2WU.js} +1 -1
  32. package/{chunk-7I5R2CUM.js → chunk-SMXZZ5T3.js} +1 -1
  33. package/{chunk-ZSVULSVG.js → chunk-TB3PSBKG.js} +1 -1
  34. package/{chunk-B4HCPA6E.js → chunk-TBT7EWUJ.js} +1 -1
  35. package/{chunk-6UIJBWT6.js → chunk-UP43K7DD.js} +1 -1
  36. package/{chunk-ZA5U4RYI.js → chunk-UPYOERLM.js} +1 -1
  37. package/chunk-V3F7SFWL.js +1 -0
  38. package/{chunk-2QWFLAG5.js → chunk-VLC4IRPH.js} +1 -1
  39. package/{chunk-JZU6YAPX.js → chunk-W5IDHDT2.js} +1 -1
  40. package/{chunk-HKQCPLSX.js → chunk-WBPKGJTU.js} +1 -1
  41. package/{chunk-4EUKDALJ.js → chunk-WJNROQNY.js} +1 -1
  42. package/{chunk-CACGTOSZ.js → chunk-ZXCNQW44.js} +1 -1
  43. package/index.html +2 -2
  44. package/main-RFYAOUOX.js +1 -0
  45. package/package.json +1 -1
  46. package/{styles-TTHIY3OR.css → styles-ERZ5377A.css} +1 -1
  47. package/chunk-B7A5CWPE.js +0 -1
  48. package/chunk-UYC454VQ.js +0 -180
  49. package/chunk-YBZSBC7H.js +0 -7
  50. package/chunk-YGEMHXDD.js +0 -1
  51. package/main-RAHFUIZB.js +0 -1
@@ -1 +1 @@
1
- import{a as Me,b as Fe}from"./chunk-HHDFSN55.js";import{b as Te}from"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as ke,b as ye}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{a as Ie}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import{a as j,b as V}from"./chunk-O4QM64EH.js";import{d as Ce,i as Pe,j as we,k as De}from"./chunk-EW3R2HAB.js";import{a as Se,b as ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as C}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{h as be}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as ue,b as fe}from"./chunk-J4XRJAME.js";import{a as x,b as ge,c as xe,d as he,e as _e,f as Ee,g as Re}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as me,x as de}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{c as F,e as oe,f as ae,l as se,o as le,v as pe,y as ce}from"./chunk-FMVCTBCQ.js";import{a as re}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{G as ie,N as ne,c as W,e as X,f as Y,k as Z,l as ee,m as te}from"./chunk-B63BKC6F.js";import{Ab as G,Ac as I,Cb as h,D as L,Jc as T,Kb as f,Kc as J,L as N,Lc as Q,Mc as R,Nb as q,O as A,Ub as a,Vb as o,Wb as _,X as D,Yc as M,Z as U,_b as k,ba as O,c as w,dc as y,ec as g,gb as d,ha as u,pa as S,qa as v,qc as m,rc as E,s as b,sc as $,wb as B,yc as K,zc as z}from"./chunk-JP6RBSB3.js";import{a as s,b as p}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=u(re)}getPostRecurringExpenseLoader(){return this.httpService.get(void 0,"api/RecurringExpenseLoader/RecurringExpensesGenerate")}previewPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGeneratePreview",e)}submitPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGenerate",e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=O({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ve={data:{data:[]},meta:{options:{expenses:[]},form:{date:"",number:"",listIDs:[]}},filter:{date:"",number:"",listIDs:[]}},H=ge(Ee(Ve),Re("PostRecurringExpenseStore"),xe(t=>({hasCheckedRows:M(()=>t.data().data.some(l=>l.checked)),checkedPRE:M(()=>t.data().data.filter(l=>l.checked))})),_e(t=>{let l=u(P);return{updateFilter:i=>{x(t,n=>p(s({},n),{filter:s(s({},n.filter),i)}))},emptyData(){x(t,i=>p(s({},i),{data:{data:[],totalCount:0}}))},onRowSelect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!0}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onRowUnselect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!1}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){x(t,n=>{let r=n.data.data.map(c=>p(s({},c),{checked:i}));return p(s({},n),{data:p(s({},n.data),{data:r})})})},getPRELoader:j(w(D(()=>l.getPostRecurringExpenseLoader().pipe(V({next:i=>{x(t,n=>p(s({},n),{meta:i}))},error:i=>{console.error("Error fetching PRE Loader:",i)}}))))),getPREPreview:j(w(L(i=>i.date&&i.listIDs.length>0),b(i=>({Date:i.date,Number:i.number,ListIDs:i.listIDs})),D(i=>l.previewPostRecurringExpense(i).pipe(b(n=>p(s({},n),{data:n.data.map(r=>p(s({},r),{checked:!1}))})),V({next:n=>{x(t,r=>p(s({},r),{data:n}))},error:n=>{console.error("Error fetching PRE Preview:",n)}})))))}}),he(t=>({onInit:()=>{t.getPRELoader(),t.getPREPreview(t.filter)}})));var He=()=>({height:"calc(100vh - 70px)"}),Le=t=>({"ng-invalid ng-dirty":t}),Ne=t=>["/pages/recurring/recurring-expense/details/",t];function Ae(t,l){if(t&1){let e=k();a(0,"p-button",7),y("onClick",function(){S(e);let n=g(2);return v(n.onSubmitPRE())}),o()}}function Ue(t,l){if(t&1&&h(0,Ae,1,0,"p-button",6),t&2){let e=g();f("ngIf",e.store.hasCheckedRows())}}function Oe(t,l){if(t&1&&(a(0,"div")(1,"span",19),m(2),o()()),t&2){let e=l.$implicit;d(2),E(e)}}function Be(t,l){if(t&1&&(a(0,"div"),h(1,Oe,3,1,"div",18),o()),t&2){let e=g(2);d(),f("ngForOf",e.getErrors("listIDs"))}}function Ge(t,l){t&1&&(a(0,"tr")(1,"th",20),_(2,"p-tableHeaderCheckbox"),o(),a(3,"th"),m(4,"Name"),o(),a(5,"th"),m(6,"Date"),o(),a(7,"th"),m(8,"Asset Account"),o(),a(9,"th"),m(10,"Expense Account"),o(),a(11,"th",21),m(12,"Amount"),o()())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),_(2,"p-tableCheckbox",22),o(),a(3,"td")(4,"a",23),m(5),o()(),a(6,"td"),m(7),T(8,"date"),o(),a(9,"td"),m(10),o(),a(11,"td"),m(12),o(),a(13,"td",21),m(14),T(15,"number"),o()()),t&2){let e=l.$implicit;d(2),f("value",e),d(2),f("routerLink",I(12,Ne,e.id)),d(),$(" ",e.name," "),d(2),E(Q(8,7,e.nextExpenseDate,"d MMM y")),d(3),E(e.paymentName),d(2),E(e.expenseName),d(2),E(J(15,10,e.amount))}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function Ke(t,l){if(t&1){let e=k();a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12)(6,"label",13),m(7,"Date"),o(),_(8,"p-datepicker",14),o()(),a(9,"div",11)(10,"div",12)(11,"label",13),m(12,"Recurring Expense"),o(),_(13,"p-multiselect",15),h(14,Be,2,1,"div",16),o()()()()(),_(15,"p-divider"),a(16,"p-table",17),y("onRowSelect",function(n){S(e);let r=g();return v(r.onRowSelect(n))})("onRowUnselect",function(n){S(e);let r=g();return v(r.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let r=g();return v(r.onHeaderCheckboxToggle(n))}),h(17,Ge,13,0,"ng-template",null,2,R)(19,qe,16,14,"ng-template",null,3,R)(21,$e,4,0,"ng-template",null,4,R),o()()}if(t&2){let e=g();q(z(9,He)),d(),f("formGroup",e.form),d(12),f("ngClass",I(10,Le,e.isInvalid("listIDs")))("options",e.store.meta().options.expenses),d(),f("ngIf",e.isInvalid("listIDs")),d(2),f("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 200px)")}}var jt=(()=>{class t extends Ie{constructor(){super(),this.store=u(H),this.fb=u(pe),this.dayjsService=u(Te),this.PREService=u(P)}ngOnInit(){this.initForm(),this.form.valueChanges.pipe(N(300),A(),C("Form Value Changes"),b(e=>Object.entries(e).reduce((i,[n,r])=>{switch(n){case"date":typeof r=="object"&&r!==null&&!Array.isArray(r)?i[n]=this.dayjsService.from(r)?this.dayjsService.format(r):null:(typeof r=="string"||typeof r=="number"||r instanceof Date)&&!Array.isArray(r)?i[n]=r!=null?String(r):null:i[n]=null;break;default:i[n]=r===null?"":r;break}return i},{})),C("Mapped Form Value"),U(e=>{(!e.listIDs||e.listIDs.length===0)&&this.store.emptyData(),this.store.updateFilter(e)})).subscribe()}initForm(){let{date:e,listIDs:i,number:n}=this.store.filter();this.form=this.fb.group({date:this.fb.control(this.dayjsService.from(e)?this.dayjsService.from(e).toDate():this.dayjsService.now.toDate(),[F.required]),number:this.fb.control(n||""),listIDs:this.fb.control(i,[F.required])})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(i=>{this.store.onRowUnselect(i)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onSubmitPRE(){console.log(this.store.checkedPRE());let i=this.store.checkedPRE().reduce((r,c)=>(r[c.id]||(r[c.id]={ID:c.id,ListDate:[]}),r[c.id].ListDate.push(c.lastExpenseDate),r),{}),n=Object.values(i);console.log("Submitting PRE with body:",n),this.PREService.submitPostRecurringExpense(n).pipe(C("Submit Post Recurring Expense")).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-post-recurring-expense"]],features:[K([H]),G],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["emptymessage",""],["pageTitle","Post Recurring Expense"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"row"],[1,"col"],[1,"d-flex","flex-column"],["for",""],["fluid","","formControlName","date"],["display","chip","formControlName","listIDs","optionLabel","name","optionValue","id","placeholder","Select Recurring Expenses","fluid","",3,"ngClass","options"],[4,"ngIf"],["dataKey","lastExpenseDate",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","scrollable","scrollHeight"],[4,"ngFor","ngForOf"],[1,"text-danger"],[2,"width","4rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(i,n){i&1&&(a(0,"app-main-panel",5),h(1,Ue,1,1,"ng-template",null,0,R)(3,Ke,23,12,"ng-template",null,1,R),o())},dependencies:[be,te,W,X,Y,ee,Z,fe,ue,Fe,Me,ve,Se,ye,ke,ce,oe,ae,se,le,De,Ce,Pe,we,de,me,ne,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{jt as PostRecurringExpenseComponent};
1
+ import{a as Me,b as Fe}from"./chunk-HHDFSN55.js";import{b as Te}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as ke,b as ye}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{a as Ie}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import{a as j,b as V}from"./chunk-O4QM64EH.js";import{d as Ce,i as Pe,j as we,k as De}from"./chunk-EW3R2HAB.js";import{a as Se,b as ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as C}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{h as be}from"./chunk-AWXT2WGR.js";import"./chunk-C7LM5UCK.js";import{a as ue,b as fe}from"./chunk-J4XRJAME.js";import{a as x,b as ge,c as xe,d as he,e as _e,f as Ee,g as Re}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as me,x as de}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{c as F,e as oe,f as ae,l as se,o as le,v as pe,y as ce}from"./chunk-FMVCTBCQ.js";import{a as re}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{G as ie,N as ne,c as W,e as X,f as Y,k as Z,l as ee,m as te}from"./chunk-B63BKC6F.js";import{Ab as G,Ac as I,Cb as h,D as L,Jc as T,Kb as f,Kc as J,L as N,Lc as Q,Mc as R,Nb as q,O as A,Ub as a,Vb as o,Wb as _,X as D,Yc as M,Z as U,_b as k,ba as O,c as w,dc as y,ec as g,gb as d,ha as u,pa as S,qa as v,qc as m,rc as E,s as b,sc as $,wb as B,yc as K,zc as z}from"./chunk-JP6RBSB3.js";import{a as s,b as p}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=u(re)}getPostRecurringExpenseLoader(){return this.httpService.get(void 0,"api/RecurringExpenseLoader/RecurringExpensesGenerate")}previewPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGeneratePreview",e)}submitPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGenerate",e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=O({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ve={data:{data:[]},meta:{options:{expenses:[]},form:{date:"",number:"",listIDs:[]}},filter:{date:"",number:"",listIDs:[]}},H=ge(Ee(Ve),Re("PostRecurringExpenseStore"),xe(t=>({hasCheckedRows:M(()=>t.data().data.some(l=>l.checked)),checkedPRE:M(()=>t.data().data.filter(l=>l.checked))})),_e(t=>{let l=u(P);return{updateFilter:i=>{x(t,n=>p(s({},n),{filter:s(s({},n.filter),i)}))},emptyData(){x(t,i=>p(s({},i),{data:{data:[],totalCount:0}}))},onRowSelect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!0}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onRowUnselect(i){x(t,n=>{let r=n.data.data.map(c=>c.lastExpenseDate===i.lastExpenseDate?p(s({},c),{checked:!1}):c);return p(s({},n),{data:p(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){x(t,n=>{let r=n.data.data.map(c=>p(s({},c),{checked:i}));return p(s({},n),{data:p(s({},n.data),{data:r})})})},getPRELoader:j(w(D(()=>l.getPostRecurringExpenseLoader().pipe(V({next:i=>{x(t,n=>p(s({},n),{meta:i}))},error:i=>{console.error("Error fetching PRE Loader:",i)}}))))),getPREPreview:j(w(L(i=>i.date&&i.listIDs.length>0),b(i=>({Date:i.date,Number:i.number,ListIDs:i.listIDs})),D(i=>l.previewPostRecurringExpense(i).pipe(b(n=>p(s({},n),{data:n.data.map(r=>p(s({},r),{checked:!1}))})),V({next:n=>{x(t,r=>p(s({},r),{data:n}))},error:n=>{console.error("Error fetching PRE Preview:",n)}})))))}}),he(t=>({onInit:()=>{t.getPRELoader(),t.getPREPreview(t.filter)}})));var He=()=>({height:"calc(100vh - 70px)"}),Le=t=>({"ng-invalid ng-dirty":t}),Ne=t=>["/pages/recurring/recurring-expense/details/",t];function Ae(t,l){if(t&1){let e=k();a(0,"p-button",7),y("onClick",function(){S(e);let n=g(2);return v(n.onSubmitPRE())}),o()}}function Ue(t,l){if(t&1&&h(0,Ae,1,0,"p-button",6),t&2){let e=g();f("ngIf",e.store.hasCheckedRows())}}function Oe(t,l){if(t&1&&(a(0,"div")(1,"span",19),m(2),o()()),t&2){let e=l.$implicit;d(2),E(e)}}function Be(t,l){if(t&1&&(a(0,"div"),h(1,Oe,3,1,"div",18),o()),t&2){let e=g(2);d(),f("ngForOf",e.getErrors("listIDs"))}}function Ge(t,l){t&1&&(a(0,"tr")(1,"th",20),_(2,"p-tableHeaderCheckbox"),o(),a(3,"th"),m(4,"Name"),o(),a(5,"th"),m(6,"Date"),o(),a(7,"th"),m(8,"Asset Account"),o(),a(9,"th"),m(10,"Expense Account"),o(),a(11,"th",21),m(12,"Amount"),o()())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),_(2,"p-tableCheckbox",22),o(),a(3,"td")(4,"a",23),m(5),o()(),a(6,"td"),m(7),T(8,"date"),o(),a(9,"td"),m(10),o(),a(11,"td"),m(12),o(),a(13,"td",21),m(14),T(15,"number"),o()()),t&2){let e=l.$implicit;d(2),f("value",e),d(2),f("routerLink",I(12,Ne,e.id)),d(),$(" ",e.name," "),d(2),E(Q(8,7,e.nextExpenseDate,"d MMM y")),d(3),E(e.paymentName),d(2),E(e.expenseName),d(2),E(J(15,10,e.amount))}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function Ke(t,l){if(t&1){let e=k();a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12)(6,"label",13),m(7,"Date"),o(),_(8,"p-datepicker",14),o()(),a(9,"div",11)(10,"div",12)(11,"label",13),m(12,"Recurring Expense"),o(),_(13,"p-multiselect",15),h(14,Be,2,1,"div",16),o()()()()(),_(15,"p-divider"),a(16,"p-table",17),y("onRowSelect",function(n){S(e);let r=g();return v(r.onRowSelect(n))})("onRowUnselect",function(n){S(e);let r=g();return v(r.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let r=g();return v(r.onHeaderCheckboxToggle(n))}),h(17,Ge,13,0,"ng-template",null,2,R)(19,qe,16,14,"ng-template",null,3,R)(21,$e,4,0,"ng-template",null,4,R),o()()}if(t&2){let e=g();q(z(9,He)),d(),f("formGroup",e.form),d(12),f("ngClass",I(10,Le,e.isInvalid("listIDs")))("options",e.store.meta().options.expenses),d(),f("ngIf",e.isInvalid("listIDs")),d(2),f("value",e.store.data().data)("scrollable",!0)("scrollHeight","calc(100vh - 200px)")}}var jt=(()=>{class t extends Ie{constructor(){super(),this.store=u(H),this.fb=u(pe),this.dayjsService=u(Te),this.PREService=u(P)}ngOnInit(){this.initForm(),this.form.valueChanges.pipe(N(300),A(),C("Form Value Changes"),b(e=>Object.entries(e).reduce((i,[n,r])=>{switch(n){case"date":typeof r=="object"&&r!==null&&!Array.isArray(r)?i[n]=this.dayjsService.from(r)?this.dayjsService.format(r):null:(typeof r=="string"||typeof r=="number"||r instanceof Date)&&!Array.isArray(r)?i[n]=r!=null?String(r):null:i[n]=null;break;default:i[n]=r===null?"":r;break}return i},{})),C("Mapped Form Value"),U(e=>{(!e.listIDs||e.listIDs.length===0)&&this.store.emptyData(),this.store.updateFilter(e)})).subscribe()}initForm(){let{date:e,listIDs:i,number:n}=this.store.filter();this.form=this.fb.group({date:this.fb.control(this.dayjsService.from(e)?this.dayjsService.from(e).toDate():this.dayjsService.now.toDate(),[F.required]),number:this.fb.control(n||""),listIDs:this.fb.control(i,[F.required])})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(i=>{this.store.onRowUnselect(i)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onSubmitPRE(){console.log(this.store.checkedPRE());let i=this.store.checkedPRE().reduce((r,c)=>(r[c.id]||(r[c.id]={ID:c.id,ListDate:[]}),r[c.id].ListDate.push(c.lastExpenseDate),r),{}),n=Object.values(i);console.log("Submitting PRE with body:",n),this.PREService.submitPostRecurringExpense(n).pipe(C("Submit Post Recurring Expense")).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-post-recurring-expense"]],features:[K([H]),G],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["emptymessage",""],["pageTitle","Post Recurring Expense"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"row"],[1,"col"],[1,"d-flex","flex-column"],["for",""],["fluid","","formControlName","date"],["display","chip","formControlName","listIDs","optionLabel","name","optionValue","id","placeholder","Select Recurring Expenses","fluid","",3,"ngClass","options"],[4,"ngIf"],["dataKey","lastExpenseDate",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","scrollable","scrollHeight"],[4,"ngFor","ngForOf"],[1,"text-danger"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(i,n){i&1&&(a(0,"app-main-panel",5),h(1,Ue,1,1,"ng-template",null,0,R)(3,Ke,23,12,"ng-template",null,1,R),o())},dependencies:[be,te,W,X,Y,ee,Z,fe,ue,Fe,Me,ve,Se,ye,ke,ce,oe,ae,se,le,De,Ce,Pe,we,de,me,ne,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{jt as PostRecurringExpenseComponent};
@@ -0,0 +1 @@
1
+ import{a as D}from"./chunk-EXGI2AG7.js";import{a as rt}from"./chunk-G4XX7EU2.js";import{a as Le,b as We}from"./chunk-HHJMN4BS.js";import{a as ze}from"./chunk-P7Z64VPC.js";import{b as N}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as ne}from"./chunk-AGLKA7OG.js";import{a as Ae,b as Pe}from"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as z,b as O}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Je,k as Be}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Me}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import{a as De,b as Re}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ee,h as Te}from"./chunk-AWXT2WGR.js";import{b as we,c as Ie}from"./chunk-C7LM5UCK.js";import{a as he,b as Se}from"./chunk-J4XRJAME.js";import{a as y,b as Ce,c as xe,d as be,e as ve,f as ye,g as ot}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as de,o as fe,w as _e,x as ge}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as oe,c as re,e as le,f as ae,k as pe,l as me,o as se,v as ce,y as ue}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as X,e as Y,f as Z,i as nt,k as ee,l as te,m as ie}from"./chunk-B63BKC6F.js";import{Ab as L,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as j,Lc as V,Mc as b,Nb as W,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as H,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as G,sc as k,ta as it,uc as K,vc as q,wb as A,wc as M,xc as $,yc as Q,zc as P}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var Ct={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Qe=Ce(ye(Ct),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:z(J(G(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(G(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Me("getCustomerInvoice"),O({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(J(B(()=>p.getJournalInvoiceLoader().pipe(O({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),be(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var vt=()=>({height:"calc(100vh - 70px)"}),Xe=t=>({"ng-invalid ng-dirty":t}),yt=()=>({});function wt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function It(t,p){if(t&1&&g(0,wt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Et(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Tt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ft(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Dt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Et,20,0,"ng-template",null,3,b)(4,Tt,26,22,"ng-template",null,4,b)(6,Ft,1,3,"ng-template",null,5,b)(8,Vt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,vt)),a(),s("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Rt(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Mt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Pt(t,p){if(t&1&&(l(0,"div"),g(1,Mt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function jt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Rt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Nt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Bt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Customer"),o(),l(28,"p-autocomplete",33),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(29,"div",25)(30,"label",26),m(31,"Page Size"),o(),C(32,"input",34),g(33,Pt,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Xe,e.isInvalid("pageSize")))("autoNumeric",P(23,yt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends je{constructor(){super(...arguments),this.store=v(Qe),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(ce)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Me("Customer Suggestions"),H(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(H(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=rt);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=it(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[Q([Qe]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollable","scrollHeight","lazy","paginator","rows","totalRecords","value"],[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,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,It,1,1,"ng-template",null,0,b)(3,Dt,10,10,"ng-template",null,1,b)(5,jt,34,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,fe,de,We,Le,ue,pe,oe,le,ae,me,se,Ie,we,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Ye=Ce(ot("JournalSupplierBillStore"),ye(zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(J(B(()=>p.getGJSupplierBillLoader().pipe(O({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(J(G(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(G(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),O({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),be(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ot=()=>({height:"calc(100vh - 70px)"}),Ze=t=>({"ng-invalid ng-dirty":t}),Gt=()=>({});function Ht(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ut(t,p){if(t&1&&g(0,Ht,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function At(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Lt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Wt(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Kt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function qt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,At,20,0,"ng-template",null,3,b)(4,Lt,25,21,"ng-template",null,4,b)(6,Wt,1,3,"ng-template",null,5,b)(8,Kt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,Ot)),a(),s("scrollHeight","calc(100vh - 142px)")("value",e.store.data().data)("scrollable",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function $t(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Qt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Yt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Zt(t,p){if(t&1&&(l(0,"div"),g(1,Yt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ei(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ti(t,p){if(t&1&&(l(0,"div"),g(1,ei,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ii(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,$t,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Xt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Zt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Supplier"),o(),l(28,"p-autocomplete",33),w(29,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(30,"div",25)(31,"label",26),m(32,"Page Size"),o(),C(33,"input",34),g(34,ti,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",j(29,17,e.supplierSuggestions$)),a(5),s("autoNumeric",P(23,Gt))("ngClass",F(24,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Me("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),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(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(H(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[Q([Ye]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","value","scrollable","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,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ut,1,1,"ng-template",null,0,b)(3,qt,10,10,"ng-template",null,1,b)(5,ii,35,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,nt,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,We,Le,ue,pe,oe,le,ae,me,se,fe,de,Ee,Ie,we,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},et=Ce(ye(ni),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:z(J(B(()=>p.getGJShiftLoader().pipe(O(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(J(G(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(O(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),be(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var oi=()=>({height:"calc(100vh - 70px)"}),tt=t=>({"ng-invalid ng-dirty":t}),ri=()=>({});function li(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ai(t,p){if(t&1&&g(0,li,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function pi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function mi(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(j(16,20,e.salesNTax)),a(3),x(j(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(j(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function si(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ci(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ui(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,pi,22,0,"ng-template",null,3,b)(4,mi,29,26,"ng-template",null,4,b)(6,si,1,3,"ng-template",null,5,b)(8,ci,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,oi)),a(),s("scrollHeight","calc(100vh - 142px)")("scrollable",!0)("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function di(t,p){if(t&1&&(l(0,"span",31),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function gi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function hi(t,p){if(t&1&&(l(0,"div"),g(1,gi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Si(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Ci(t,p){if(t&1&&(l(0,"div"),g(1,Si,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function xi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,di,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From"),o(),C(10,"p-datepicker",27),g(11,_i,2,1,"div",28),o(),l(12,"div",24)(13,"label",25),m(14,"To"),o(),C(15,"p-datepicker",29),g(16,hi,2,1,"div",28),o(),l(17,"div",24)(18,"label",25),m(19,"Page Size"),o(),C(20,"input",30),g(21,Ci,2,1,"div",28),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,tt,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,tt,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",P(18,ri))("ngClass",F(19,tt,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var St=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(et),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:Oe,export:Ge,exportPageNumber:He,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(Oe,[re.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(H(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[Q([et]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","scrollable","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ai,1,1,"ng-template",null,0,b)(3,ui,10,10,"ng-template",null,1,b)(5,xi,22,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Se,he,ge,_e,ue,pe,oe,le,ae,me,se,Re,De,Ve,Fe,Ee,Ie,we,fe,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yo=[{path:"invoice",component:gt},{path:"supplier-bill",component:ht},{path:"shift",component:St},{path:"join-invoice",loadComponent:()=>import("./chunk-JB4UBWDT.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-TBT7EWUJ.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-FFGCE3TK.js").then(t=>t.AdjustmentJournalComponent)}];export{yo as generateJournalRoutes};
@@ -1 +1 @@
1
- import{a as V,b as oe}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as te,b as ie}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import{a as ne,b as re}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import{b as ee}from"./chunk-5R3XKSDM.js";import{h as $}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as Y,b as Z}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as U,x as X}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as G,j as H,x as q}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as A}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as z,m as R}from"./chunk-B63BKC6F.js";import{Cb as L,Ga as b,Jc as T,Kb as u,Kc as P,Mc as M,Nb as S,Ub as r,V as E,Vb as o,Wb as C,X as B,Z as W,_b as h,dc as f,ec as m,gb as s,h as J,ha as x,pa as l,qa as p,qc as _,ra as I,s as y,sa as N,vc as c,wb as O,wc as g,xc as d,yc as j,zc as F}from"./chunk-JP6RBSB3.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
1
+ import{a as V,b as oe}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as te,b as ie}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as K,b as Q}from"./chunk-4LGDNQMZ.js";import{a as ne,b as re}from"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import{b as ee}from"./chunk-5R3XKSDM.js";import{h as $}from"./chunk-AWXT2WGR.js";import"./chunk-C7LM5UCK.js";import{a as Y,b as Z}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as U,x as X}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{e as G,j as H,x as q}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as A}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as z,m as R}from"./chunk-B63BKC6F.js";import{Cb as L,Ga as b,Jc as T,Kb as u,Kc as P,Mc as M,Nb as S,Ub as r,V as E,Vb as o,Wb as C,X as B,Z as W,_b as h,dc as f,ec as m,gb as s,h as J,ha as x,pa as l,qa as p,qc as _,ra as I,s as y,sa as N,vc as c,wb as O,wc as g,xc as d,yc as j,zc as F}from"./chunk-JP6RBSB3.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
@@ -1 +1 @@
1
- import{a as x,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
1
+ import{a as x,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as E,b as V}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-AWXT2WGR.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as j,x as O}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as $,m as F}from"./chunk-B63BKC6F.js";import{Cb as A,Jc as c,Kb as p,Kc as s,Mc as C,Nb as h,Ub as n,V as v,Vb as o,Wb as l,X as T,Z as M,_b as B,dc as y,ec as m,gb as a,h as P,ha as f,pa as g,qa as d,ra as S,s as u,sa as b,wb as k,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
@@ -1 +1 @@
1
- import{a as x,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as E,b as O}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as F}from"./chunk-B63BKC6F.js";import{Cb as P,Jc as l,Kb as p,Kc as m,Mc as _,Nb as d,Ub as o,V as T,Vb as n,Wb as c,X as M,Z as S,_b as w,dc as y,ec as s,gb as a,h as v,ha as u,pa as f,qa as C,ra as b,s as g,sa as k,wb as B,yc as $,zc as h}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=w();o(0,"div",3)(1,"p-button",4),y("onClick",function(){f(e);let r=s();return C(r.onFormatCOACategory())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),y("onClick",function(){f(e);let r=s();return C(r.onMigrateCoaCategory())}),n()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),l(4,"async"),b(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),l(8,"async"),n()()()),i&2){let e=s();d(h(12,q)),a(),d(h(13,q)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=u(x),this.toastr=u(I),this.refresh$=new v(void 0),this.pageTitle="Chart of Account Category"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOACategoryCount()),S(t=>console.log("API response:",t)),T(1));this.countInPOS$=e.pipe(g(t=>Number(t.pos))),this.countInBooks$=e.pipe(g(t=>Number(t.books)))}onMigrateCoaCategory(){this.migrateService.migrateCoaCategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOACategory(){confirm("Are you sure you want to format?")&&this.migrateService.formatManualCOACategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-coa-configuration"]],features:[$([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),P(1,J,5,6,"ng-template",null,0,_)(3,K,9,14,"ng-template",null,1,_),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaCategoryComponent};
1
+ import{a as x,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as E,b as O}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-AWXT2WGR.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as I}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as A,m as F}from"./chunk-B63BKC6F.js";import{Cb as P,Jc as l,Kb as p,Kc as m,Mc as _,Nb as d,Ub as o,V as T,Vb as n,Wb as c,X as M,Z as S,_b as w,dc as y,ec as s,gb as a,h as v,ha as u,pa as f,qa as C,ra as b,s as g,sa as k,wb as B,yc as $,zc as h}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=w();o(0,"div",3)(1,"p-button",4),y("onClick",function(){f(e);let r=s();return C(r.onFormatCOACategory())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),y("onClick",function(){f(e);let r=s();return C(r.onMigrateCoaCategory())}),n()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),l(4,"async"),b(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),l(8,"async"),n()()()),i&2){let e=s();d(h(12,q)),a(),d(h(13,q)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=u(x),this.toastr=u(I),this.refresh$=new v(void 0),this.pageTitle="Chart of Account Category"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOACategoryCount()),S(t=>console.log("API response:",t)),T(1));this.countInPOS$=e.pipe(g(t=>Number(t.pos))),this.countInBooks$=e.pipe(g(t=>Number(t.books)))}onMigrateCoaCategory(){this.migrateService.migrateCoaCategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOACategory(){confirm("Are you sure you want to format?")&&this.migrateService.formatManualCOACategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-coa-configuration"]],features:[$([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),P(1,J,5,6,"ng-template",null,0,_)(3,K,9,14,"ng-template",null,1,_),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaCategoryComponent};
@@ -1 +1 @@
1
- import{a as v,b as L}from"./chunk-VVGZUJP6.js";import"./chunk-ERFXO32T.js";import"./chunk-ZM5TVQUU.js";import{a as I,b as E}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-UYC454VQ.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as F}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as O,m as $}from"./chunk-B63BKC6F.js";import{Cb as w,Jc as s,Kb as p,Kc as m,Mc as x,Nb as h,Ub as o,V as y,Vb as n,Wb as l,X as M,Z as b,_b as B,dc as C,ec as c,gb as a,h as T,ha as f,pa as g,qa as d,ra as S,s as u,sa as A,wb as k,yc as P,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
1
+ import{a as v,b as L}from"./chunk-BU5IXVPY.js";import"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as I,b as E}from"./chunk-4LGDNQMZ.js";import"./chunk-5R3XKSDM.js";import{h as H}from"./chunk-AWXT2WGR.js";import{b as N,c as G}from"./chunk-C7LM5UCK.js";import{a as R,b as D}from"./chunk-J4XRJAME.js";import"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{w as V,x as j}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import{a as F}from"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{i as O,m as $}from"./chunk-B63BKC6F.js";import{Cb as w,Jc as s,Kb as p,Kc as m,Mc as x,Nb as h,Ub as o,V as y,Vb as n,Wb as l,X as M,Z as b,_b as B,dc as C,ec as c,gb as a,h as T,ha as f,pa as g,qa as d,ra as S,s as u,sa as A,wb as k,yc as P,zc as _}from"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
@@ -1 +1 @@
1
- import{a as v,b as A}from"./chunk-O4QM64EH.js";import{d as V,k as W}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as Q}from"./chunk-5R3XKSDM.js";import{h as J}from"./chunk-UYC454VQ.js";import"./chunk-C7LM5UCK.js";import{a as N,b as j}from"./chunk-J4XRJAME.js";import{a as S,b as G,c as K,d as U,e as q,f as $,g as z}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{x as H}from"./chunk-FMVCTBCQ.js";import{a as O}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{G as R,N as F,l as I,m as L}from"./chunk-B63BKC6F.js";import{Ac as x,Cb as g,Jc as k,Kb as m,Kc as B,Mc as c,Nb as b,Ub as n,Vb as a,Wb as M,X as u,Yc as D,ba as y,c as f,ec as C,gb as l,ha as p,qc as i,rc as s,sc as T,wb as P,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import{a as d,b as h}from"./chunk-YQFG5XE2.js";var X=(()=>{class t{constructor(){this.httpService=p(O)}fetchCashAndBankLoader(){return this.httpService.get("","api/CashAndBankLoader/GetCashAndBank")}fetchCashAndBankData(){return this.httpService.get("","api/CashAndBank/GetCashAndBank")}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var et={data:[],filter:[],options:{hasGeneralLedger:!1}},E=G(z("cash-bank-store"),$(et),K(t=>({totalBalance:D(()=>t.data().reduce((o,e)=>o+e.balance,0))})),q(t=>{let o=p(X);return{loadCashAndBankLoader:v(f(u(()=>o.fetchCashAndBankLoader().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{options:e.options}))},error:e=>{console.log("error",e)}}))))),loadCashAndBankData:v(f(u(()=>o.fetchCashAndBankData().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{data:e}))},error:e=>{console.log("error",e)}})))))}}),U({onInit(t){t.loadCashAndBankLoader(),t.loadCashAndBankData()}}));var nt=["class","page"],at=()=>({height:"calc(100vh - 70px)"}),ot=t=>[t],it=()=>["/pages/report/general-ledger"],rt=t=>({id:t});function lt(t,o){t&1&&(n(0,"tr")(1,"th"),i(2,"Code"),a(),n(3,"th"),i(4,"Name"),a(),n(5,"th",7),i(6,"Balance"),a()())}function pt(t,o){if(t&1&&(n(0,"tr")(1,"td"),i(2),a(),n(3,"td")(4,"a",8),i(5),a()(),n(6,"td",7)(7,"a",9),i(8),k(9,"number"),a()()()),t&2){let e=o.$implicit;l(2),s(e.code),l(2),m("routerLink",x(8,ot,"/pages/chart-of-account/account/"+e.accountID)),l(),s(e.name),l(2),m("routerLink",_(10,it))("queryParams",x(11,rt,e.accountID)),l(),s(B(9,6,e.balance))}}function ct(t,o){if(t&1&&(n(0,"tr"),M(1,"td"),n(2,"td",10),i(3,"Total"),a(),n(4,"td",11),i(5),k(6,"number"),a()()),t&2){let e=C(2);l(5),T(" ",B(6,1,e.store.totalBalance())," ")}}function mt(t,o){t&1&&(n(0,"tr")(1,"td",12)(2,"span"),i(3,"No records found."),a()()())}function st(t,o){if(t&1&&(n(0,"p-panel")(1,"p-table",6),g(2,lt,7,0,"ng-template",null,1,c)(4,pt,10,13,"ng-template",null,2,c)(6,ct,7,3,"ng-template",null,3,c)(8,mt,4,0,"ng-template",null,4,c),a()()),t&2){let e=C();b(_(4,at)),l(),m("value",e.store.data())("scrollHeight","calc(100vh - 100px)")}}var Y=(()=>{class t{constructor(){this.store=p(E),this.routeInfo=Z}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-cash-bank",8,"page"]],features:[w([E])],attrs:nt,decls:3,vars:0,consts:[["content",""],["header",""],["body",""],["footer",""],["emptymessage",""],["pageTitle","Cash and Bank"],["scrollable","",3,"value","scrollHeight"],[1,"text-end"],[1,"link","link-primary",3,"routerLink"],[1,"link","link-primary",3,"routerLink","queryParams"],[1,"fw-bold"],[1,"text-end","fw-bold"],["colspan","3"]],template:function(r,dt){r&1&&(n(0,"app-main-panel",5),g(1,st,10,5,"ng-template",null,0,c),a())},dependencies:[L,I,J,H,W,V,Q,F,R,j,N],styles:[".card[_ngcontent-%COMP%]{height:calc(100vh - 120px)}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:inherit;overflow-y:auto}"],changeDetection:0})}}return t})();var qt=[{path:"",component:Y,children:[]}],Z={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[]};export{qt as CASH_BANK_ROUTES,Z as CASH_BANK_ROUTE_PAGE};
1
+ import{a as v,b as A}from"./chunk-O4QM64EH.js";import{d as V,k as W}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import"./chunk-PKN47FQE.js";import"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{b as Q}from"./chunk-5R3XKSDM.js";import{h as J}from"./chunk-AWXT2WGR.js";import"./chunk-C7LM5UCK.js";import{a as N,b as j}from"./chunk-J4XRJAME.js";import{a as S,b as G,c as K,d as U,e as q,f as $,g as z}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{x as H}from"./chunk-FMVCTBCQ.js";import{a as O}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{G as R,N as F,l as I,m as L}from"./chunk-B63BKC6F.js";import{Ac as x,Cb as g,Jc as k,Kb as m,Kc as B,Mc as c,Nb as b,Ub as n,Vb as a,Wb as M,X as u,Yc as D,ba as y,c as f,ec as C,gb as l,ha as p,qc as i,rc as s,sc as T,wb as P,yc as w,zc as _}from"./chunk-JP6RBSB3.js";import{a as d,b as h}from"./chunk-YQFG5XE2.js";var X=(()=>{class t{constructor(){this.httpService=p(O)}fetchCashAndBankLoader(){return this.httpService.get("","api/CashAndBankLoader/GetCashAndBank")}fetchCashAndBankData(){return this.httpService.get("","api/CashAndBank/GetCashAndBank")}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var et={data:[],filter:[],options:{hasGeneralLedger:!1}},E=G(z("cash-bank-store"),$(et),K(t=>({totalBalance:D(()=>t.data().reduce((o,e)=>o+e.balance,0))})),q(t=>{let o=p(X);return{loadCashAndBankLoader:v(f(u(()=>o.fetchCashAndBankLoader().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{options:e.options}))},error:e=>{console.log("error",e)}}))))),loadCashAndBankData:v(f(u(()=>o.fetchCashAndBankData().pipe(A({next:e=>{console.log("response",e),S(t,r=>h(d({},r),{data:e}))},error:e=>{console.log("error",e)}})))))}}),U({onInit(t){t.loadCashAndBankLoader(),t.loadCashAndBankData()}}));var nt=["class","page"],at=()=>({height:"calc(100vh - 70px)"}),ot=t=>[t],it=()=>["/pages/report/general-ledger"],rt=t=>({id:t});function lt(t,o){t&1&&(n(0,"tr")(1,"th"),i(2,"Code"),a(),n(3,"th"),i(4,"Name"),a(),n(5,"th",7),i(6,"Balance"),a()())}function pt(t,o){if(t&1&&(n(0,"tr")(1,"td"),i(2),a(),n(3,"td")(4,"a",8),i(5),a()(),n(6,"td",7)(7,"a",9),i(8),k(9,"number"),a()()()),t&2){let e=o.$implicit;l(2),s(e.code),l(2),m("routerLink",x(8,ot,"/pages/chart-of-account/account/"+e.accountID)),l(),s(e.name),l(2),m("routerLink",_(10,it))("queryParams",x(11,rt,e.accountID)),l(),s(B(9,6,e.balance))}}function ct(t,o){if(t&1&&(n(0,"tr"),M(1,"td"),n(2,"td",10),i(3,"Total"),a(),n(4,"td",11),i(5),k(6,"number"),a()()),t&2){let e=C(2);l(5),T(" ",B(6,1,e.store.totalBalance())," ")}}function mt(t,o){t&1&&(n(0,"tr")(1,"td",12)(2,"span"),i(3,"No records found."),a()()())}function st(t,o){if(t&1&&(n(0,"p-panel")(1,"p-table",6),g(2,lt,7,0,"ng-template",null,1,c)(4,pt,10,13,"ng-template",null,2,c)(6,ct,7,3,"ng-template",null,3,c)(8,mt,4,0,"ng-template",null,4,c),a()()),t&2){let e=C();b(_(4,at)),l(),m("value",e.store.data())("scrollHeight","calc(100vh - 100px)")}}var Y=(()=>{class t{constructor(){this.store=p(E),this.routeInfo=Z}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-cash-bank",8,"page"]],features:[w([E])],attrs:nt,decls:3,vars:0,consts:[["content",""],["header",""],["body",""],["footer",""],["emptymessage",""],["pageTitle","Cash and Bank"],["scrollable","",3,"value","scrollHeight"],[1,"text-end"],[1,"link","link-primary",3,"routerLink"],[1,"link","link-primary",3,"routerLink","queryParams"],[1,"fw-bold"],[1,"text-end","fw-bold"],["colspan","3"]],template:function(r,dt){r&1&&(n(0,"app-main-panel",5),g(1,st,10,5,"ng-template",null,0,c),a())},dependencies:[L,I,J,H,W,V,Q,F,R,j,N],styles:[".card[_ngcontent-%COMP%]{height:calc(100vh - 120px)}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:inherit;overflow-y:auto}"],changeDetection:0})}}return t})();var qt=[{path:"",component:Y,children:[]}],Z={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[]};export{qt as CASH_BANK_ROUTES,Z as CASH_BANK_ROUTE_PAGE};