dealposbooks 5.50.0 → 5.51.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 (91) hide show
  1. package/3rdpartylicenses.txt +10 -10
  2. package/chunk-2RXAK5B6.js +8 -0
  3. package/chunk-2U3PIWWJ.js +1 -0
  4. package/chunk-32QC4JFI.js +202 -0
  5. package/{chunk-KZU3VXLG.js → chunk-3O7NQ6AZ.js} +1 -1
  6. package/{chunk-PB2MFYIM.js → chunk-3RODMLL2.js} +1 -1
  7. package/chunk-4GZGUASQ.js +1 -0
  8. package/chunk-52EMI2TW.js +803 -0
  9. package/{chunk-DAM2WKDY.js → chunk-52PEVPZN.js} +1 -1
  10. package/{chunk-65V5R4TS.js → chunk-5XVZW6BJ.js} +1 -1
  11. package/chunk-7ET5ZE2L.js +1 -0
  12. package/chunk-7F5JJ627.js +129 -0
  13. package/chunk-7GORVGAV.js +1 -0
  14. package/chunk-AAKZYXG3.js +145 -0
  15. package/{chunk-3ALAWCRA.js → chunk-B7TGZ7J3.js} +1 -1
  16. package/{chunk-DM45YT57.js → chunk-BT4SLG45.js} +1 -1
  17. package/{chunk-IMPGOCFC.js → chunk-BVHTVDYP.js} +1 -1
  18. package/chunk-CPAPQNFC.js +1 -0
  19. package/{chunk-RBNXJUFM.js → chunk-D5WBKKO2.js} +1 -1
  20. package/{chunk-VNZUZ5UI.js → chunk-DAN3PD7R.js} +1 -1
  21. package/chunk-DM42MH3E.js +1 -0
  22. package/chunk-E57RWXDG.js +1 -0
  23. package/{chunk-GU4FXUJC.js → chunk-EDYUAYO2.js} +1 -1
  24. package/{chunk-SX4XIR77.js → chunk-ELZ5FFFM.js} +1 -1
  25. package/{chunk-Z4XRTHAH.js → chunk-F4PHXCVU.js} +1 -1
  26. package/{chunk-TOR7QRRB.js → chunk-G3BJCT7T.js} +1 -1
  27. package/{chunk-XGU6GBEK.js → chunk-GEYRJ2MR.js} +1 -1
  28. package/{chunk-KXW5NWRO.js → chunk-GN7VAGHH.js} +1 -1
  29. package/{chunk-2JFOEOZ2.js → chunk-GQ7SPEZH.js} +1 -1
  30. package/{chunk-ON7PMYMV.js → chunk-H7YYGW7V.js} +1 -1
  31. package/{chunk-XULSWUMO.js → chunk-HYOAHRKW.js} +1 -1
  32. package/chunk-ILQI2X5T.js +1 -0
  33. package/{chunk-A6T2KR7U.js → chunk-J346SEEU.js} +1 -1
  34. package/{chunk-YQYRAH7V.js → chunk-JBYPGHPN.js} +1 -1
  35. package/{chunk-J3HFAWXU.js → chunk-JPKZVL57.js} +1 -1
  36. package/{chunk-LBXNL7E4.js → chunk-JPNJTPYJ.js} +1 -1
  37. package/{chunk-BB2CNXSH.js → chunk-KBJ25I3J.js} +1 -1
  38. package/chunk-KJM3M7Y3.js +1 -0
  39. package/chunk-KU4BYYJE.js +1 -0
  40. package/{chunk-SXNOZOOP.js → chunk-KXWAD3X4.js} +1 -1
  41. package/chunk-L27GCER2.js +160 -0
  42. package/chunk-LF4HTMCE.js +1 -0
  43. package/chunk-MCR6MBS2.js +1 -0
  44. package/{chunk-ZC2ADHDH.js → chunk-MHM3ED4J.js} +1 -1
  45. package/chunk-MWRTPPEI.js +1 -0
  46. package/chunk-NSMNMKCV.js +1 -0
  47. package/{chunk-VKUW7E75.js → chunk-NTVIX4GB.js} +1 -1
  48. package/{chunk-SJOOTBQ5.js → chunk-OILVKUFA.js} +1 -1
  49. package/chunk-OKT36WED.js +1 -0
  50. package/{chunk-KORGIX2B.js → chunk-OOCLTY27.js} +1 -1
  51. package/{chunk-ZAMQ4RCL.js → chunk-QCGJB7O7.js} +1 -1
  52. package/chunk-QSIXT7W7.js +7 -0
  53. package/{chunk-GAXDMEOS.js → chunk-QXE4YYQV.js} +1 -1
  54. package/{chunk-3GYSEQ25.js → chunk-R45WWOYD.js} +1 -1
  55. package/chunk-RFHL2MJ4.js +1 -0
  56. package/{chunk-7DBOORB2.js → chunk-RGVP7KT4.js} +1 -1
  57. package/{chunk-4AGTFPOU.js → chunk-SOD2BIQR.js} +1 -1
  58. package/chunk-TOAH3PY3.js +1 -0
  59. package/{chunk-56CZGYL5.js → chunk-V6BSLJMN.js} +1 -1
  60. package/{chunk-NHW7GVHK.js → chunk-VABCBO2E.js} +1 -1
  61. package/{chunk-RVUOVLL5.js → chunk-VQ62YSFR.js} +1 -1
  62. package/{chunk-4IMFKRR6.js → chunk-WPHZJHC6.js} +1 -1
  63. package/{chunk-SOYJAYJK.js → chunk-YKZN6T5N.js} +1 -1
  64. package/chunk-YMV3SC73.js +1 -0
  65. package/{chunk-DAFEIZYQ.js → chunk-ZLBNHUZF.js} +1 -1
  66. package/{chunk-YU4Q7ASX.js → chunk-ZOMQLK4A.js} +1 -1
  67. package/index.html +2 -2
  68. package/{main-UCTZ3G6L.js → main-ET3JU27S.js} +1 -1
  69. package/package.json +1 -1
  70. package/chunk-27SC6O47.js +0 -1
  71. package/chunk-47G2N7SA.js +0 -1
  72. package/chunk-4RBG4SFN.js +0 -1
  73. package/chunk-5N5QHECN.js +0 -1
  74. package/chunk-6GO647AV.js +0 -1
  75. package/chunk-AF6G72MJ.js +0 -1
  76. package/chunk-BOQI2TMP.js +0 -8
  77. package/chunk-BTFX33U6.js +0 -947
  78. package/chunk-COSMZ2AH.js +0 -1
  79. package/chunk-FHXTQXB7.js +0 -160
  80. package/chunk-HQHEWKLC.js +0 -1
  81. package/chunk-I2OULINE.js +0 -1
  82. package/chunk-JERRSTLA.js +0 -1
  83. package/chunk-OOCCZG53.js +0 -129
  84. package/chunk-SASRJPT7.js +0 -1
  85. package/chunk-URGN4QVD.js +0 -1
  86. package/chunk-UTOLWW4T.js +0 -1
  87. package/chunk-VJROOSEO.js +0 -7
  88. package/chunk-WYLIU52Q.js +0 -1
  89. package/chunk-XN4CDKDI.js +0 -1
  90. package/chunk-Z3ZKNQZS.js +0 -1
  91. package/chunk-ZWNKUBMG.js +0 -202
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"dealposbooks","version":"5.50.0"}
1
+ {"name":"dealposbooks","version":"5.51.0"}
package/chunk-27SC6O47.js DELETED
@@ -1 +0,0 @@
1
- import{a as Q}from"./chunk-ZAMQ4RCL.js";import{a as W}from"./chunk-KARG227P.js";import{a as O}from"./chunk-BT7Y4ADP.js";import{i as B}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as A}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{n as z,w as D}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as I,c as N,e as w,f as R,m as P,p as V,v as G,y as q}from"./chunk-MGIEURA2.js";import{b as M,d as k}from"./chunk-DZCJWJUG.js";import"./chunk-TOR7QRRB.js";import"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{j as E,m as J}from"./chunk-DM2JLWKE.js";import{D as x,Eb as p,Fc as j,I as h,Mb as r,N as T,Sc as v,Wb as i,Xb as n,Y as d,Yb as g,_ as f,ac as F,fc as S,gc as s,ia as m,ib as a,k as _,qa as C,ra as b,sc as c,yb as y}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var U=t=>({"ng-invalid ng-dirty":t});function Y(t,u){if(t&1){let e=F();i(0,"div")(1,"p-button",3),S("onClick",function(){C(e);let l=s();return b(l.onSubmit())}),n()()}}function H(t,u){t&1&&(i(0,"div",14),c(1," Name is required "),n())}function K(t,u){if(t&1&&(i(0,"div"),p(1,H,2,0,"div",13),n()),t&2){let e=s(2);a(),r("ngIf",e.form.controls.name.errors.required)}}function L(t,u){if(t&1&&(i(0,"p-panel",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"label",9),c(6,"Name"),n(),g(7,"input",10),p(8,K,2,1,"div",11),n()(),i(9,"div",7)(10,"div",8)(11,"label",9),c(12,"Description"),n(),g(13,"textarea",12),n()()()()()),t&2){let e=s();a(),r("formGroup",e.form),a(6),r("ngClass",j(4,U,e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched))),a(),r("ngIf",e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched)),a(5),r("autoResize",!0)}}var ue=(()=>{class t{constructor(){this.fb=m(G),this.journalTagService=m(Q),this.route=m(M),this.router=m(k)}initForm(){console.log("Initializing form"),this.form=this.fb.group({name:this.fb.control("",[N.required]),description:this.fb.control("")})}ngOnInit(){this.initForm(),this.route.queryParamMap.pipe(x(e=>e.has("id")),d(e=>this.journalTagService.journalTagGet(e.get("id"))),O("Query params"),f(e=>{console.log("Got journal tag:",e),this.form.patchValue({name:e.name,description:e.description})})).subscribe()}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=this.form.getRawValue();this.route.queryParamMap.pipe(T(1),d(o=>{let l=o.get("id");return l?this.journalTagService.journalTagUpdate(e,l):this.journalTagService.journalTagCreate(e)}),f(()=>{console.log("Journal tag saved successfully"),this.router.navigate(["/pages/accounting-setup/journal-tag"])}),h(o=>(console.error("Failed to save journal tag:",o),_))).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=y({type:t,selectors:[["app-journal-tag-form"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["rows","2","pSize","large","cols","30","pTextarea","","formControlName","description",3,"autoResize"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"]],template:function(o,l){o&1&&(i(0,"app-main-panel",2),p(1,Y,2,0,"ng-template",null,0,v)(3,L,14,6,"ng-template",null,1,v),n()),o&2&&r("hasMainWrapperPadding",!0)},dependencies:[B,z,J,A,q,I,w,R,P,V,W,D,E],encapsulation:2})}}return t})();export{ue as JournalTagFormComponent};
package/chunk-47G2N7SA.js DELETED
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-4IMFKRR6.js";import{a as it}from"./chunk-YHLRDTIS.js";import{a as Pe}from"./chunk-SVGPDGYN.js";import{a as Ue,b as He}from"./chunk-LO4HJ77Y.js";import{a as te}from"./chunk-2JFOEOZ2.js";import{b as R}from"./chunk-LBXNL7E4.js";import{a as Me}from"./chunk-XKI7WLHE.js";import{a as Ge,b as Be}from"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{d as ke,i as Je,j as Ne,k as Re}from"./chunk-BTFX33U6.js";import{a as Ee,b as Te}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ve}from"./chunk-BT7Y4ADP.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as De}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ie}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as _e,b as ge}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import{a as xe,b as y,c as Ce,d as be,e as ve,f as ye,g as we,h as tt}from"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{n as ce,o as de,w as ue,x as fe,y as he,z as Se}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as ie,c as ne,e as oe,f as re,k as le,m as ae,p as pe,v as me,y as se}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-TOR7QRRB.js";import"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{j as $,l as Q,m as X,p as et,r as Y,s as Z,u as ee}from"./chunk-DM2JLWKE.js";import{Cb as L,Dc as q,Eb as g,Fc as V,Ha as J,Mb as s,Oc as w,Pc as N,Qc as F,Sc as b,Wb as l,Xb as o,Y as M,Yb as h,_ as G,ac as E,bd as I,c as B,eb as U,fc as T,gc as _,ia as v,ib as a,qa as S,ra as x,s as O,sc as m,tc as C,ua as Ze,uc as k,wc as A,xc as W,yb as H,yc as P,zc as K}from"./chunk-6QJHEOXN.js";import{a as c,b as d}from"./chunk-YQFG5XE2.js";var gt={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,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Ke=Ce(we(gt),be(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))})),ye(t=>{let p=v(D),e=v(R);return{updateFilter(n){y(t,i=>d(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!0}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!1}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(u=>d(c({},u),{checked:n}));return d(c({},i),{data:d(c({},i.data),{data:f})})})},getCustomerInvoice:z(B(O(n=>Object.entries(n).reduce((i,[f,u])=>(u!=null&&(i[f]=u),i),{})),M(n=>p.getJournalInvoice(n).pipe(O(i=>d(c({},i),{data:i.data.map(f=>d(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Ve("getCustomerInvoice"),j({next:i=>{y(t,f=>d(c({},f),{data:d(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(B(M(()=>p.getJournalInvoiceLoader().pipe(j({next:n=>{y(t,i=>d(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),ve(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var qe=t=>({"ng-invalid ng-dirty":t});function xt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Ct(t,p){if(t&1&&g(0,xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function bt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Customer"),o(),l(7,"th",15),m(8,"Date"),o(),l(9,"th",15),m(10,"Due"),o(),l(11,"th",16),m(12,"Amount"),o(),l(13,"th",17),m(14,"Payment"),o(),l(15,"th",17),m(16,"Delivery"),o(),h(17,"th",18),o())}function vt(t,p){if(t&1&&(l(0,"tr")(1,"td",12),h(2,"p-tableCheckbox",19),o(),l(3,"td",13)(4,"a",20),m(5),o(),h(6,"p-chip",21),o(),l(7,"td",14)(8,"a",22),m(9),o()(),l(10,"td",15),m(11),w(12,"date"),o(),l(13,"td",15),m(14),w(15,"date"),o(),l(16,"td",16),m(17),w(18,"number"),o(),l(19,"td",17),h(20,"p-chip",21),o(),l(21,"td",17),h(22,"p-chip",21),o(),l(23,"td",18),h(24,"p-button",23),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(),s("label",e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),C(F(12,14,e.date,"d/MM/yy")),a(3),k(" ",e.due?F(15,17,e.due,"d/MM/yy"):"-"," "),a(3),C(N(18,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 yt(t,p){if(t&1&&(m(0),w(1,"number")),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",N(1,3,e.store.data().totalCount)," entries ")}}function wt(t,p){t&1&&(l(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function It(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,bt,18,0,"ng-template",null,3,b)(4,vt,25,22,"ng-template",null,4,b)(6,yt,2,5,"ng-template",null,5,b)(8,wt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Et(t,p){if(t&1&&(l(0,"span",37),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function Tt(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Vt(t,p){if(t&1&&(l(0,"div"),g(1,Tt,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Ft(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Dt(t,p){if(t&1&&(l(0,"div"),g(1,Ft,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Jt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Nt(t,p){if(t&1){let e=E();l(0,"form",25)(1,"div",26)(2,"label",27),m(3,"Tag"),o(),l(4,"p-select",28),g(5,Et,3,5,"ng-template",null,7,b),o()(),l(7,"div",26)(8,"label",27),m(9,"Payment"),o(),h(10,"p-select",29),o(),l(11,"div",26)(12,"label",27),m(13,"Delivery"),o(),h(14,"p-select",30),o(),l(15,"div",26)(16,"label",27),m(17,"From - To"),o(),l(18,"div",31),h(19,"p-datepicker",32),g(20,Vt,2,1,"div",33),h(21,"p-datepicker",34),g(22,Dt,2,1,"div",33),o()(),l(23,"div",26)(24,"label",27),m(25,"Customer"),o(),l(26,"p-autocomplete",35),T("completeMethod",function(n){S(e);let i=_();return x(i.onSearchContact(n))}),o()(),l(27,"div",26)(28,"label",27),m(29,"Page Size"),o(),h(30,"input",36),g(31,Jt,2,1,"div",33),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(5),s("iconDisplay","input")("showIcon",!0)("ngClass",V(16,qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(18,qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",V(20,qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ut=(()=>{class t extends Me{constructor(){super(...arguments),this.store=v(Ke),this.dayjsService=v(R),this.generateJournalService=v(D),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.customerSuggestions=J([]),this.fb=v(me)}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:u,customerID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=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(u)?this.dayjsService.from(u).toDate():null),customerID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Ve("Customer Suggestions"),G(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(d(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(d(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(G(()=>{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]=it);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=Ze(t)))(n||t)}})()}static{this.\u0275cmp=H({type:t,selectors:[["app-customer-invoice"]],features:[q([Ke]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","lazy","paginator","rows","totalRecords","value"],[1,"pe-0",2,"width","5px"],[1,"ps-2",2,"width","200px"],[2,"width","200px"],[2,"width","40px"],[2,"width","80px"],[2,"width","50px"],[1,"ps-0",2,"width","20px"],[3,"value"],["target","_blank",1,"link","link-primary","text-wrap","text-break","d-flex",3,"href"],[1,"p-1","px-2",3,"label"],["target","_blank",1,"link","link-primary","text-wrap","text-break",3,"href"],["size","small",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 Tag",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"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Ct,1,1,"ng-template",null,0,b)(3,It,10,5,"ng-template",null,1,b)(5,Nt,32,22,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,de,ce,He,Ue,se,le,ie,oe,re,ae,pe,Se,he,xe,Pe],encapsulation:2,changeDetection:0})}}return t})();var Rt={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,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4},skipRequestFirst:!0},$e=Ce(tt("JournalSupplierBillStore"),we(Rt),be(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))})),ye(t=>{let p=v(D),e=v(R);return{updateFilter(r){y(t,n=>d(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?d(c({},f),{checked:!0}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?d(c({},f),{checked:!1}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>d(c({},f),{checked:r}));return d(c({},n),{data:d(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(B(M(()=>p.getGJSupplierBillLoader().pipe(j({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>d(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(B(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),M(r=>p.getJournalSupplierBill(r).pipe(O(n=>d(c({},n),{data:n.data.map(i=>d(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),j({next:n=>{y(t,i=>d(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),ve(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Qe=t=>({"ng-invalid ng-dirty":t});function Bt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Mt(t,p){if(t&1&&g(0,Bt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Pt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Tag"),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(),h(19,"th",18),o())}function zt(t,p){if(t&1&&(l(0,"tr")(1,"td"),h(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"),h(20,"p-chip",21),o(),l(21,"td"),h(22,"p-chip",21),o(),l(23,"td"),h(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),C(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),C(e.customer),a(2),C(F(12,13,e.date,"d MMM y hh:mm")),a(3),C(e.due?F(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),C(N(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 jt(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ot(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Gt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,Pt,20,0,"ng-template",null,3,b)(4,zt,25,21,"ng-template",null,4,b)(6,jt,1,3,"ng-template",null,5,b)(8,Ot,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function Ut(t,p){if(t&1&&(l(0,"span",36),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function Ht(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Lt(t,p){if(t&1&&(l(0,"div"),g(1,Ht,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function At(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Wt(t,p){if(t&1&&(l(0,"div"),g(1,At,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function qt(t,p){if(t&1&&(l(0,"div"),g(1,Kt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function $t(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Tag"),o(),l(4,"p-select",27),g(5,Ut,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),h(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),h(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),h(19,"p-datepicker",31),g(20,Lt,2,1,"div",32),h(21,"p-datepicker",33),g(22,Wt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Supplier"),o(),l(26,"p-autocomplete",34),w(27,"async"),T("completeMethod",function(n){S(e);let i=_();return x(i.onSearchSupplier(n))}),o()(),l(28,"div",25)(29,"label",26),m(30,"Page Size"),o(),h(31,"input",35),g(32,qt,2,1,"div",32),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(5),s("iconDisplay","input")("showIcon",!0)("ngClass",V(18,Qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(20,Qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",N(27,16,e.supplierSuggestions$)),a(5),s("ngClass",V(22,Qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ft=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v($e),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.fb=v(me),this.dayjsService=v(R)}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(Ve("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:u,supplierID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=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(u),supplierID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}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(G(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(d(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([$e]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"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 Tag",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"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","appMaskNumber","","formControlName","pageSize",3,"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),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Mt,1,1,"ng-template",null,0,b)(3,Gt,10,5,"ng-template",null,1,b)(5,$t,33,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,et,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,He,Ue,se,le,ie,oe,re,ae,pe,de,ce,xe,Se,he,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Xe=Ce(we(Qt),be(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))})),ye(t=>{let p=v(D);return{updateFilter(e){y(t,r=>d(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!0}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!1}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>d(c({},i),{checked:e}));return d(c({},r),{data:d(c({},r.data),{data:n})})})},getGJShiftLoader:z(B(M(()=>p.getGJShiftLoader().pipe(j(e=>y(t,r=>d(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(B(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),M(e=>p.getJournalShift(e).pipe(j(r=>y(t,n=>d(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),ve(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var Ye=t=>({"ng-invalid ng-dirty":t});function Xt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Yt(t,p){if(t&1&&g(0,Xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Zt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(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,"Tag"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),h(21,"th",18),o())}function ei(t,p){if(t&1&&(l(0,"tr")(1,"td"),h(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"),h(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),C(F(8,14,e.open,"dd MMM y hh:mm")),a(3),C(F(11,17,e.close,"dd MMM y hh:mm")),a(3),C(e.cashier),a(2),C(N(16,20,e.salesNTax)),a(3),C(N(19,22,e.totalInvoice)),a(3),C(e.outlet),a(2),C(e.register),a(2),C(N(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 ti(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ii(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ni(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,Zt,22,0,"ng-template",null,3,b)(4,ei,29,26,"ng-template",null,4,b)(6,ti,1,3,"ng-template",null,5,b)(8,ii,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function oi(t,p){if(t&1&&(l(0,"span",32),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function ri(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function li(t,p){if(t&1&&(l(0,"div"),g(1,ri,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function ai(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function pi(t,p){if(t&1&&(l(0,"div"),g(1,ai,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function mi(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function si(t,p){if(t&1&&(l(0,"div"),g(1,mi,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ci(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Tag"),o(),l(4,"p-select",26),g(5,oi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),h(11,"p-datepicker",28),g(12,li,2,1,"div",29),h(13,"p-datepicker",30),g(14,pi,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),h(18,"input",31),g(19,si,2,1,"div",29),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(7),s("iconDisplay","input")("showIcon",!0)("ngClass",V(13,Ye,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(15,Ye,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("ngClass",V(17,Ye,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Xe),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.fb=v(me),this.dayjsService=v(R)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,pageSize:u,export:ze,exportPageNumber:je,exportPageSize:Oe}=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),pageSize:this.fb.control(u,[ne.required]),export:this.fb.control(ze),exportPageNumber:this.fb.control(je),exportPageSize:this.fb.control(Oe)})}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(G(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(d(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-shift"]],features:[q([Xe]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","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 Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"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),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Yt,1,1,"ng-template",null,0,b)(3,ni,10,5,"ng-template",null,1,b)(5,ci,20,19,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,ge,_e,fe,ue,se,le,ie,oe,re,ae,pe,De,Fe,Te,Ee,xe,Se,he,de,ce,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var fo=[{path:"invoice",component:ut},{path:"supplier-bill",component:ft},{path:"shift",component:_t},{path:"join-invoice",loadComponent:()=>import("./chunk-UTOLWW4T.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-COSMZ2AH.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-I2OULINE.js").then(t=>t.AdjustmentJournalComponent)}];export{fo as generateJournalRoutes};
package/chunk-4RBG4SFN.js DELETED
@@ -1 +0,0 @@
1
- import{a as be}from"./chunk-2JFOEOZ2.js";import{b as Ve}from"./chunk-5VKDAA74.js";import{m as xe}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as Q,b as X}from"./chunk-3VQUNDVT.js";import{d as Y,i as Ie,j as Me,k as Z}from"./chunk-BTFX33U6.js";import{a as Re,b as Fe}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ke}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as q}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as j,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import{b as S,c as L,d as G,e as Ee,f as K,g as W}from"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{o as Ue,w as O,x as A}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as Ce,f as Se,k as Te,m as we,p as ve,v as ye,y as Pe}from"./chunk-MGIEURA2.js";import{e as B,l as ge}from"./chunk-DZCJWJUG.js";import{a as he}from"./chunk-TOR7QRRB.js";import{a as _e}from"./chunk-YQYRAH7V.js";import{d as $}from"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{m as ue,r as fe,s as J,u as z}from"./chunk-DM2JLWKE.js";import{Dc as D,Eb as T,Ec as R,Fc as se,Ha as ae,Mb as g,Oc as v,Pb as M,Pc as E,Qc as de,Rb as le,Sc as _,Wb as o,Xb as a,Y as N,Yb as k,_ as ie,ac as U,bd as y,c as F,ca as oe,eb as re,fc as w,gc as d,ia as f,ib as c,qa as x,ra as C,s as ne,sc as r,tc as h,wc as V,xc as pe,yb as I,yc as me,zc as ce}from"./chunk-6QJHEOXN.js";import{a as m,b as s}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=f(he)}getGenerateCoa(e){let n={params:new $().set("PageNumber",e.PageNumber).set("PageSize",e.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(e={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,e)}getUnbalanceJournal(e){let i=new $,n=(u,b)=>{b!=null&&b!==""&&(i=i.set(u,String(b)))};n("pageNumber",e.PageNumber),n("pageSize",e.PageSize),n("from",e.From),n("to",e.To),n("numberSearch",e.Number);let l=i.keys().length?{params:i}:{};return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal",l)}loadInitialUnbalanceJournal(){return this.httpService.get(void 0,"api/ToolsLoader/UnbalanceJurnal")}updateUnbalanceJournal(e){let i={ListID:e};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Be={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},ee=L(W(Be),G(t=>({first:y(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:y(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count))})),K(t=>{let p=f(P);return{updateFilter:i=>{S(t,n=>s(m({},n),{filter:m(m({},n.filter),i)}))},getUpdateCOA:Q(F(N(i=>p.getGenerateCoa(i).pipe(X({next:n=>{S(t,l=>s(m({},l),{data:n}))},error:n=>{console.error(n)}})))))}}),Ee({onInit(t){t.getUpdateCOA(t.filter)}}));var Le=()=>({height:"calc(100vh - 70px)"}),Ge=()=>({"min-width":"50rem"});function Ke(t,p){if(t&1){let e=U();o(0,"p-button",8),w("onClick",function(){x(e);let n=d(2);return C(n.updateCoaBalance())}),a()}}function We(t,p){if(t&1&&T(0,Ke,1,0,"p-button",7),t&2){let e=d();le(e.roleService.permissions().tools.edit?0:-1)}}function qe(t,p){t&1&&(o(0,"tr")(1,"th"),r(2,"Code"),a(),o(3,"th"),r(4,"Name"),a(),o(5,"th"),r(6,"Tag"),a(),o(7,"th",10),r(8,"COA Balance"),a(),o(9,"th",10),r(10,"Correct Balance"),a()())}function Qe(t,p){if(t&1&&(o(0,"tr")(1,"td"),r(2),a(),o(3,"td")(4,"a",11),r(5),a()(),o(6,"td"),r(7),a(),o(8,"td",10),r(9),v(10,"number"),a(),o(11,"td",10),r(12),v(13,"number"),a()()),t&2){let e=p.$implicit;c(2),h(e.Code),c(2),g("routerLink","/pages/chart-of-account/account/"+e.ID),c(),h(e.Name),c(2),h(e.OutletName),c(2),h(E(10,6,e.Balance)),c(3),h(E(13,8,e.CorrectBalance))}}function Xe(t,p){if(t&1&&(o(0,"div",12)(1,"p",13),r(2),a()()),t&2){let e=d(2);c(2),V(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function Ye(t,p){t&1&&(o(0,"tr")(1,"td",14)(2,"span"),r(3,"No records found."),a()()())}function Ze(t,p){if(t&1){let e=U();o(0,"p-panel")(1,"p-table",9),w("onPage",function(n){x(e);let l=d();return C(l.onPageChange(n))}),T(2,qe,11,0,"ng-template",null,2,_)(4,Qe,14,10,"ng-template",null,3,_)(6,Xe,3,3,"ng-template",null,4,_)(8,Ye,4,0,"ng-template",null,5,_),a()()}if(t&2){let e=d();M(R(8,Le)),c(),g("paginator",!0)("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().PageSize)("value",e.store.data().data)("tableStyle",R(9,Ge))}}var Je=(()=>{class t{constructor(){this.store=f(ee),this.coaService=f(P),this.toastrService=f(_e),this.roleService=f(xe)}onPageChange(e){this.store.updateFilter(s(m({},this.store.filter()),{PageNumber:Math.floor(e.first/e.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ne("Update COA Balance"),ie(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-tools-update-coa"]],features:[D([ee])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(i,n){i&1&&(o(0,"app-main-panel",6),T(1,We,1,1,"ng-template",null,0,_)(3,Ze,10,10,"ng-template",null,1,_),a()),i&2&&g("scrollable",!0)},dependencies:[q,Z,Y,ke,z,J,A,O,H,j,B],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return t})();var $e={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20,From:"",To:"",Number:null}},te=L(W($e),G(t=>({first:y(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:y(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count)),selectedItems:y(()=>t.data().data.filter(p=>p.checked)),hasCheckedRows:y(()=>t.data().data.some(p=>p.checked))})),K(t=>{let p=f(P);return{updateFilter(i){S(t,n=>s(m({},n),{filter:m(m({},n.filter),i)}))},onRowSelect(i){S(t,n=>{let l=n.data.data.map(u=>u.id===i.id?s(m({},u),{checked:!0}):u);return s(m({},n),{data:s(m({},n.data),{data:l})})})},onRowUnselect(i){S(t,n=>{let l=n.data.data.map(u=>u.id===i.id?s(m({},u),{checked:!1}):u);return s(m({},n),{data:s(m({},n.data),{data:l})})})},onHeaderCheckboxToggle(i){S(t,n=>{let l=n.data.data.map(u=>s(m({},u),{checked:i}));return s(m({},n),{data:s(m({},n.data),{data:l})})})},loadData:Q(F(N(i=>p.getUnbalanceJournal(i).pipe(ne(n=>s(m({},n),{data:n.data.map(l=>s(m({},l),{checked:!1}))})),X({next:n=>{S(t,l=>s(m({},l),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}));var et=()=>({height:"calc(100vh - 70px)"}),tt=t=>["/pages/journal/journal-entry",t];function nt(t,p){if(t&1){let e=U();o(0,"div",9),k(1,"p-button",10),o(2,"p-button",11),w("onClick",function(){x(e);let n=d(2);return C(n.regenerateUnbalanceJournal())}),r(3,"Regenerate"),a()()}}function it(t,p){if(t&1&&T(0,nt,4,0,"div",8),t&2){let e=d();g("ngIf",e.store.hasCheckedRows())}}function ot(t,p){t&1&&(o(0,"tr")(1,"th",13),k(2,"p-tableHeaderCheckbox"),a(),o(3,"th"),r(4,"Date"),a(),o(5,"th"),r(6,"Number"),a(),o(7,"th",14),r(8,"Debit SUM"),a(),o(9,"th",14),r(10,"Credit SUM"),a(),o(11,"th",14),r(12,"Difference"),a(),o(13,"th"),r(14,"Reference"),a(),o(15,"th"),r(16,"Tag"),a()())}function at(t,p){if(t&1&&(o(0,"tr")(1,"td"),k(2,"p-tableCheckbox",15),a(),o(3,"td"),r(4),v(5,"date"),a(),o(6,"td")(7,"a",16),r(8),a()(),o(9,"td",14),r(10),v(11,"number"),a(),o(12,"td",14),r(13),v(14,"number"),a(),o(15,"td",14),r(16),v(17,"number"),a(),o(18,"td")(19,"a",17),r(20),a()(),o(21,"td"),r(22),a()()),t&2){let e=p.$implicit,i=d(2);c(2),g("value",e),c(2),h(de(5,10,e.date,"dd MMM yyyy")),c(3),g("routerLink",se(19,tt,e.id)),c(),h(e.number),c(2),h(E(11,13,e.debitSum)),c(3),h(E(14,15,e.creditSum)),c(3),h(E(17,17,e.differences)),c(3),g("href",i.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,re),c(),h(e.referenceText),c(2),h(e.outletName)}}function rt(t,p){if(t&1&&r(0),t&2){let e=d(2);V(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function lt(t,p){t&1&&(o(0,"tr")(1,"td",18)(2,"span"),r(3,"No records found."),a()()())}function pt(t,p){if(t&1){let e=U();o(0,"p-panel")(1,"p-table",12),w("onPage",function(n){x(e);let l=d();return C(l.onPageChange(n))})("onRowSelect",function(n){x(e);let l=d();return C(l.onRowSelect(n))})("onRowUnselect",function(n){x(e);let l=d();return C(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){x(e);let l=d();return C(l.onHeaderCheckboxToggle(n))}),T(2,ot,17,0,"ng-template",null,3,_)(4,at,23,21,"ng-template",null,4,_)(6,rt,1,3,"ng-template",null,5,_)(8,lt,4,0,"ng-template",null,6,_),a()()}if(t&2){let e=d();M(R(7,et)),c(),g("value",e.store.data().data)("lazy",!0)("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)}}function mt(t,p){if(t&1&&(o(0,"form",19)(1,"div",20)(2,"label",21),r(3,"From - To"),a(),o(4,"div",22),k(5,"p-datepicker",23)(6,"p-datepicker",24),a()()()),t&2){let e=d();g("formGroup",e.form),c(5),g("iconDisplay","input")("showIcon",!0),c(),g("iconDisplay","input")("showIcon",!0)}}var ze=(()=>{class t{constructor(){this.store=f(te),this.toolsService=f(P),this.authService=f(be),this.fb=f(ye),this.isFilterVisible=ae(!1)}ngOnInit(){this.initForm(),this.toolsService.loadInitialUnbalanceJournal().subscribe({next:e=>{let i=e?.filter;i&&(this.store.updateFilter({PageNumber:i.pageNumber??this.store.filter().PageNumber,PageSize:i.pageSize??this.store.filter().PageSize,From:i.from??this.store.filter().From,To:i.to??this.store.filter().To,Number:i.numberSearch??this.store.filter().Number}),this.form&&this.form.patchValue({PageNumber:i.pageNumber??this.form.value.PageNumber,PageSize:i.pageSize??this.form.value.PageSize,from:i.from??this.form.value.from,to:i.to??this.form.value.to,number:i.numberSearch??this.form.value.number}))}})}initForm(){this.form=this.fb.group({PageNumber:this.fb.control(1),PageSize:this.fb.control(20),from:this.fb.control(null),to:this.fb.control(null),number:this.fb.control(null)}),this.form&&this.isFilterVisible.set(!0)}onPageChange(e){console.log("Page changed:",e);let i=e.first/e.rows;this.store.updateFilter({PageNumber:i+1})}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)}regenerateUnbalanceJournal(){let i=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(i).subscribe()}onFilterOKEvent(){let{PageNumber:e,PageSize:i,from:n,to:l,number:u}=this.form.value;this.store.updateFilter({PageNumber:e??this.store.filter().PageNumber,PageSize:i??this.store.filter().PageSize,From:n??this.store.filter().From,To:l??this.store.filter().To,Number:u??this.store.filter().Number}),this.store.loadData(this.store.filter()),this.isFilterVisible.update(b=>!b)}onSearch(e){this.store.updateFilter({Number:e}),this.store.loadData(this.store.filter())}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-unbalance-journal"]],features:[D([te])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Unbalance Journal",3,"filterConfirmed","isDialogFilterVisibleChange","search","scrollable","isFilterable","isDialogFilterVisible","isSearchableInput"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["paginatorStyleClass","d-flex justify-content-end","dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","6"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","dataType","string","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","dataType","string","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(i,n){if(i&1){let l=U();o(0,"app-main-panel",7),w("filterConfirmed",function(){return x(l),C(n.onFilterOKEvent())}),ce("isDialogFilterVisibleChange",function(b){return x(l),me(n.isFilterVisible,b)||(n.isFilterVisible=b),C(b)}),w("search",function(b){return x(l),C(n.onSearch(b))}),T(1,it,1,1,"ng-template",null,0,_)(3,pt,10,8,"ng-template",null,1,_)(5,mt,7,5,"ng-template",null,2,_),a()}i&2&&(g("scrollable",!0)("isFilterable",!0),pe("isDialogFilterVisible",n.isFilterVisible),g("isSearchableInput",!0))},dependencies:[q,Z,Y,Ie,Me,Ve,Ue,z,ue,J,fe,Pe,Te,Ce,Se,we,ve,A,O,H,j,ge,B,Fe,Re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var bn=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:Je},{path:"unbalance-journal",component:ze}];export{bn as TOOLS_ROUTES};
package/chunk-5N5QHECN.js DELETED
@@ -1 +0,0 @@
1
- import{b as Se}from"./chunk-LBXNL7E4.js";import{a as I,b as V}from"./chunk-3VQUNDVT.js";import{d as _e,k as xe}from"./chunk-BTFX33U6.js";import{a as be,b as Ce}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ge}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as he}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as re}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import{b as T,c as se,d as me,e as ce,f as de,g as fe,h as ue}from"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{y as le,z as pe}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as Y,f as Z,k as $,m as ee,p as te,v as ie,x as oe,y as ne}from"./chunk-MGIEURA2.js";import{e as z,l as J}from"./chunk-DZCJWJUG.js";import{a as X}from"./chunk-TOR7QRRB.js";import"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{s as W,u as q}from"./chunk-DM2JLWKE.js";import{D as M,Dc as H,Eb as F,Ec as Q,Fc as P,Ha as O,Mb as f,Oc as u,Pc as h,Sc as g,Wb as o,Xb as n,Y as D,Yb as E,ac as L,bd as B,c as v,ca as N,cd as U,fc as w,gc as k,ia as d,ib as p,qa as x,ra as S,sc as r,tc as y,uc as C,xc as j,yb as R,yc as G,zc as K}from"./chunk-6QJHEOXN.js";import{a as m,b as c}from"./chunk-YQFG5XE2.js";var ke=(()=>{class e{constructor(){this.httpService=d(X)}fetchCashAndBankLoader(){return this.httpService.get("","api/CashAndBankLoader/GetCashAndBank")}fetchCashAndBankData(t){return this.httpService.get("","api/CashAndBank/GetCashAndBank",{params:t})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var ve={data:{data:[],pageTitle:"",pageSubTitle:""},filter:null,options:{hasGeneralLedger:!1}},A=se(ue("cash-bank-store"),fe(ve),me(e=>({totalBalance:B(()=>e.data().data.reduce((l,t)=>l+t.balance,0)),subTotalDebit:B(()=>e.data().data.reduce((l,t)=>l+t.debit,0)),subTotalCredit:B(()=>e.data().data.reduce((l,t)=>l+t.credit,0))})),de(e=>{let l=d(ke);return{updateFilterQuery(i){T(e,a=>c(m({},a),{filter:c(m({},i),{pageNumber:1})}))},loadCashAndBankLoader:I(v(D(()=>l.fetchCashAndBankLoader().pipe(V({next:i=>{T(e,a=>c(m({},a),{options:i.options,filter:i.filter}))},error:i=>{console.log("error",i)}}))))),loadCashAndBankData:I(v(M(i=>!!i),D(i=>l.fetchCashAndBankData(i).pipe(V({next:a=>{T(e,s=>c(m({},s),{data:a}))},error:a=>{console.log("error",a)}})))))}}),ce({onInit(e){e.loadCashAndBankLoader(),e.loadCashAndBankData(e.filter)}}));var De=["class","page"],Fe=e=>[e],Ee=()=>["/pages/report/general-ledger"],we=e=>({id:e});function Pe(e,l){e&1&&(o(0,"tr")(1,"th"),r(2,"Code"),n(),o(3,"th"),r(4,"Name"),n(),o(5,"th",8)(6,"span",9),r(7," Debit "),n()(),o(8,"th",8)(9,"span",10),r(10," Credit "),n()(),o(11,"th",8)(12,"span",11),r(13," Current Balance"),n()()())}function Ie(e,l){if(e&1&&(o(0,"tr")(1,"td"),r(2),n(),o(3,"td")(4,"a",12),r(5),n()(),o(6,"td",13),r(7),u(8,"number"),n(),o(9,"td",14),r(10),u(11,"number"),n(),o(12,"td",8)(13,"a",15),r(14),u(15,"number"),n()()()),e&2){let t=l.$implicit;p(2),y(t.code),p(2),f("routerLink",P(14,Fe,"/pages/chart-of-account/account/"+t.accountID)),p(),y(t.name),p(2),C(" ",h(8,8,t.debit)," "),p(3),C(" ",h(11,10,t.credit)," "),p(3),f("routerLink",Q(16,Ee))("queryParams",P(17,we,t.accountID)),p(),y(h(15,12,t.balance))}}function Ve(e,l){if(e&1&&(o(0,"tr"),E(1,"td"),o(2,"td",16),r(3,"Total"),n(),o(4,"td",17),r(5),u(6,"number"),n(),o(7,"td",18),r(8),u(9,"number"),n(),o(10,"td",19),r(11),u(12,"number"),n()()),e&2){let t=k(2);p(5),C(" ",h(6,3,t.store.subTotalDebit())," "),p(3),C(" ",h(9,5,t.store.subTotalCredit())," "),p(3),C(" ",h(12,7,t.store.totalBalance())," ")}}function Ae(e,l){e&1&&(o(0,"tr")(1,"td",20)(2,"span"),r(3,"No records found."),n()()())}function Me(e,l){if(e&1&&(o(0,"p-panel")(1,"p-table",7),F(2,Pe,14,0,"ng-template",null,2,g)(4,Ie,16,19,"ng-template",null,3,g)(6,Ve,13,9,"ng-template",null,4,g)(8,Ae,4,0,"ng-template",null,5,g),n()()),e&2){let t=k();p(),f("value",t.store.data().data)}}function Ne(e,l){if(e&1&&(o(0,"form",21)(1,"div",22)(2,"label",23),r(3,"From - To"),n(),o(4,"div",24),E(5,"p-datepicker",25)(6,"p-datepicker",26),n()()()),e&2){let t=k();f("formGroup",t.filterForm),p(5),f("iconDisplay","input")("showIcon",!0),p(),f("iconDisplay","input")("showIcon",!0)}}var ye=(()=>{class e{constructor(){this.store=d(A),this.isDialogFilterVisible=O(!1),this.routeInfo=Be,this.fb=d(ie),this.dayjsService=d(Se),U(()=>{let t=this.store.filter();if(t){let i=Object.entries(t).reduce((a,[s,b])=>(s==="from"||s==="to"?a[s]=b?new Date(b):null:a[s]=b,a),{});this.filterForm?.patchValue(i)}})}ngOnInit(){this.initForm()}initForm(){this.filterForm=this.fb.group({text:this.fb.control(""),listOutletID:this.fb.control([]),listCategoryID:this.fb.control([]),isInRoleEmptyOutlets:this.fb.control(!1),discontinued:this.fb.control("all"),discontinuedValue:this.fb.control(!1),from:this.fb.control(null),to:this.fb.control(null),pageNumber:this.fb.control(1),pageSize:this.fb.control(10),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(10)})}onSearch(t){this.store.updateFilterQuery(c(m({},this.store.filter()),{text:t}))}onFilterOKEvent(){let t=this.filterForm.getRawValue();console.log("\u{1F680} ~ CashBankPageComponent ~ onFilterOKEvent ~ formValue:",t);let i=c(m({},t),{from:t.from?this.dayjsService.format(t.from):void 0,to:t.to?this.dayjsService.format(t.to):void 0});this.store.updateFilterQuery(i),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=R({type:e,selectors:[["app-cash-bank",8,"page"]],features:[H([A])],attrs:De,decls:5,vars:6,consts:[["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"search","isDialogFilterVisibleChange","filterConfirmed","pageTitle","pageSubTitle","scrollable","isSearchableInput","isFilterable","isDialogFilterVisible"],[3,"value"],[1,"text-end"],["pTooltip","Total debit based on the selected date filter","tooltipPosition","top"],["pTooltip","Total credit based on the selected date filter","tooltipPosition","top"],["pTooltip","Current balance based on the selected date filter","tooltipPosition","top"],[1,"link","link-primary",3,"routerLink"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"link","link-primary",3,"routerLink","queryParams"],[1,"fw-bold"],[1,"fw-bold","text-end","text-success"],[1,"fw-bold","text-end","text-danger"],[1,"text-end","fw-bold"],["colspan","5"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","dataType","string","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(i,a){if(i&1){let s=L();o(0,"app-main-panel",6),w("search",function(_){return x(s),S(a.onSearch(_))}),K("isDialogFilterVisibleChange",function(_){return x(s),G(a.isDialogFilterVisible,_)||(a.isDialogFilterVisible=_),S(_)}),w("filterConfirmed",function(){return x(s),S(a.onFilterOKEvent())}),F(1,Me,10,1,"ng-template",null,0,g)(3,Ne,7,5,"ng-template",null,1,g),n()}i&2&&(f("pageTitle",a.store.data().pageTitle)("pageSubTitle",a.store.data().pageSubTitle)("scrollable",!0)("isSearchableInput",!0)("isFilterable",!0),j("isDialogFilterVisible",a.isDialogFilterVisible))},dependencies:[q,W,he,oe,$,Y,Z,xe,_e,ge,J,z,re,ae,pe,le,ne,ee,te,Ce,be],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 e})();var St=[{path:"",component:ye,children:[]}],Be={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[]};export{St as CASH_BANK_ROUTES,Be as CASH_BANK_ROUTE_PAGE};
package/chunk-6GO647AV.js DELETED
@@ -1 +0,0 @@
1
- import{a as r}from"./chunk-2JFOEOZ2.js";import"./chunk-WL6ZZCYW.js";import{d as e}from"./chunk-DZCJWJUG.js";import"./chunk-TOR7QRRB.js";import"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-DM2JLWKE.js";import{ia as n}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var a=(t,u)=>{let o=n(r),i=n(e),p=o.isAuthenticated(),m=!o.isTokenExpired(),h=o.checkAuthKeysExists();return p&&m&&h?(i.navigateByUrl("/pages/dashboard"),!1):!0};var A=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-SXNOZOOP.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-JRBGNG24.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-KORGIX2B.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6DTQWLB3.js").then(t=>t.TimeoutComponent)},{path:"unauthorized",loadComponent:()=>import("./chunk-ZC2ADHDH.js").then(t=>t.FullComponent),children:[{path:"",loadComponent:()=>import("./chunk-VNZUZ5UI.js").then(t=>t.ForbiddenComponent)}]}];export{A as AuthenticationRoutes};
package/chunk-AF6G72MJ.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-DM45YT57.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-65V5R4TS.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-XULSWUMO.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-GAXDMEOS.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-A6T2KR7U.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-SX4XIR77.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-PB2MFYIM.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-NHW7GVHK.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-XGU6GBEK.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
package/chunk-BOQI2TMP.js DELETED
@@ -1,8 +0,0 @@
1
- import{a as nt,b as it,c as ot,d as rt,e as at,f as lt}from"./chunk-TAN6GLIH.js";import{a as Qe,b as Xe,c as Ye,d as Ze}from"./chunk-SLD7RSX6.js";import{a as et,b as tt}from"./chunk-GIRWHO6Q.js";import{a as Ke}from"./chunk-SVGPDGYN.js";import{a as S}from"./chunk-DAM2WKDY.js";import{b as He}from"./chunk-LBXNL7E4.js";import{a as We,b as qe}from"./chunk-5VKDAA74.js";import"./chunk-ZC7ZENN7.js";import{m as P}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as je,b as ze,d as $e,i as Le,j as Ue,k as le}from"./chunk-BTFX33U6.js";import{a as Re,b as Pe}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ge}from"./chunk-BT7Y4ADP.js";import{a as oe,b as re}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import{a as Be,b as Ve}from"./chunk-CN6AT4LE.js";import{a as Oe,b as Je}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ae}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as v}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as L,b as U}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{n as ie,o as E,w as T,x as $}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{Ia as z,b as G,c as ge,e as w,f as B,j as ke,m as V,n as te,o as Ne,p as O,v as J,x as ne,y as j}from"./chunk-MGIEURA2.js";import{b as Te,e as Ae,l as Ie}from"./chunk-DZCJWJUG.js";import{a as Me}from"./chunk-TOR7QRRB.js";import{a as De}from"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{j as ye,l as Fe,m as we,s as Ee,u as F}from"./chunk-DM2JLWKE.js";import{Dc as ee,Eb as f,Ec as W,Fc as de,Ha as A,L as xe,Mb as s,Oc as ue,Pb as H,Pc as fe,Rb as y,Sb as M,Sc as h,Ub as k,Vb as N,Wb as o,Xb as n,Yb as d,Z as ve,_ as D,ac as C,bd as he,ca as Se,fc as b,g as Ce,gc as c,ia as u,ib as l,ob as se,qa as g,ra as _,s as be,sc as a,tc as R,uc as I,xc as X,yb as x,yc as Y,zc as Z}from"./chunk-6QJHEOXN.js";import{a as K,b as Q}from"./chunk-YQFG5XE2.js";var vt=()=>({height:"calc(100vh - 100px)"});function St(t,m){if(t&1){let e=C();o(0,"p-button",7),b("click",function(){g(e);let r=c(2);return _(r.updateAccountingIntegration())}),n()}}function yt(t,m){if(t&1&&(o(0,"div",4)(1,"a",5),a(2,"Cancel"),n(),f(3,St,1,0,"p-button",6),n()),t&2){let e=c();l(3),y(e.roleService.permissions().accountingSetup.create||e.roleService.permissions().accountingSetup.edit?3:-1)}}function Ft(t,m){if(t&1&&(o(0,"p-tab",9),a(1),n()),t&2){let e=m.$implicit,i=m.$index;s("value",i),l(),R(e)}}function wt(t,m){if(t&1&&(o(0,"div",26),d(1,"p-radiobutton",42),o(2,"label",43),a(3),n()()),t&2){let e=m.$implicit;l(),s("inputId",e.value)("value",e.key),l(),s("for",e.value),l(),R(e.value)}}function Et(t,m){if(t&1&&(o(0,"div",41)(1,"div",26),d(2,"p-radiobutton",44),o(3,"label",43),a(4),n()()()),t&2){let e=m.$implicit;l(2),s("inputId",e.key.toString())("value",e.key),l(),s("for",e.key),l(),R(e.value)}}function Tt(t,m){if(t&1&&(o(0,"p-scrollpanel",null,2)(2,"p-tabs",8)(3,"p-tablist"),k(4,Ft,2,2,"p-tab",9,M),n(),o(6,"p-tabpanels")(7,"p-tabpanel",10)(8,"div",11)(9,"h3",12),a(10,"Accounting Numbering"),n(),o(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",14)(15,"div",16)(16,"label",17),a(17,"Digit"),n(),d(18,"p-inputnumber",18),n()(),o(19,"div",14)(20,"div",16)(21,"label",19),a(22,"Seed"),n(),d(23,"p-inputnumber",20),n()(),o(24,"div",14)(25,"div",16)(26,"label",21),a(27,"Last Number"),n(),d(28,"p-inputnumber",22),n()(),o(29,"div",14)(30,"div",16)(31,"label",23),a(32,"Format"),n(),d(33,"p-select",24),n()(),o(34,"div",14)(35,"div",16)(36,"label",23),a(37,"Reset Every"),n(),o(38,"div",25),k(39,wt,4,4,"div",26,M),n()()()()()()()(),o(41,"p-tabpanel",9)(42,"div",27)(43,"div",28)(44,"h3",12),a(45,"Journal Generate"),n(),o(46,"p"),a(47,"Configure generate transaction"),n()(),o(48,"div",13)(49,"div",29)(50,"div",13)(51,"div",30)(52,"div",16)(53,"label",23),a(54,"Outlet Delivery Journal"),n(),d(55,"p-toggleswitch",31),n()(),o(56,"div",32)(57,"div",16)(58,"label",23),a(59,"Payment Discount Journal On Payment"),n(),d(60,"p-toggleswitch",33),n()()()()()(),d(61,"hr"),o(62,"div",27)(63,"div",29)(64,"div",13)(65,"div",34)(66,"label",23),a(67,"Note"),n()(),o(68,"div",30)(69,"div",16)(70,"label",23),a(71,"Note Required On Journal"),n(),d(72,"p-toggleswitch",35),n()(),o(73,"div",30)(74,"div",16)(75,"label",23),a(76,"Trial Balance Footer Visible"),n(),d(77,"p-toggleswitch",36),n()(),d(78,"div",30),n()()()(),o(79,"p-tabpanel",37)(80,"div",11)(81,"h3",12),a(82,"Report"),n(),o(83,"div",13)(84,"div",28)(85,"div",38)(86,"div")(87,"label",39),a(88,"Accounting For Treatment"),n(),o(89,"div",13)(90,"div",40)(91,"div",13),k(92,Et,5,4,"div",41,M),n()()()()()()()()()()()()),t&2){let e,i,r,p=c();H(W(8,vt)),l(2),s("formGroup",p.form)("value",0),l(2),N(p.tabs()),l(3),s("value",0),l(26),s("options",(e=p.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),l(6),N((i=p.accountingIntegration())==null||i.options==null?null:i.options.resetPeriods),l(2),s("value",1),l(38),s("value",2),l(13),N((r=p.accountingIntegration())==null||r.options==null?null:r.options.generatePrepaidJournal)}}var ct=(()=>{class t{constructor(){this.accountingIntegration=A(null),this.roleService=u(P),this.tabs=A(["Numbering","Journal","Report"]),this.accountingSetupService=u(S),this.fb=u(J).nonNullable}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(D(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"click"],[1,"border-top",3,"formGroup","value"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["formControlName","digit","inputId","digit"],["for","seed",1,"fs-4"],["formControlName","seed","inputId","seed"],["for","lastNumber",1,"fs-4"],["formControlName","lastNumber","inputId","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionLabel","value","optionValue","key",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["formControlName","resetEvery","name","resetEvery",3,"inputId","value"],[1,"m-0",3,"for"],["formControlName","generatePrepaidJournal","name","generatePrepaidJournal",3,"inputId","value"]],template:function(i,r){i&1&&(o(0,"app-main-panel",3),f(1,yt,4,1,"ng-template",null,0,h)(3,Tt,94,9,"ng-template",null,1,h),n())},dependencies:[F,lt,at,rt,ot,nt,it,v,ae,ze,je,j,w,B,V,O,te,E,Je,Oe,qe,We,Ie,Ae,$,T,Ve,Be,re,oe],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var It=()=>({height:"cacl(100vh - 200px)"}),Dt=()=>({height:"calc(100vh - 250px)"});function Mt(t,m){if(t&1){let e=C();o(0,"p-button",6),b("onClick",function(){g(e);let r=c(2);return _(r.submitForm())}),n()}}function kt(t,m){if(t&1&&(o(0,"div"),f(1,Mt,1,0,"p-button",5),n()),t&2){let e=c();l(),y(e.roleService.permissions().accountingSetup.create?1:-1)}}function Nt(t,m){t&1&&(o(0,"div",18)(1,"h3",19),a(2,"Date"),n(),d(3,"p-datePicker",20),n())}function Rt(t,m){if(t&1&&(o(0,"tr",10)(1,"td",28),a(2),n(),o(3,"td"),d(4,"input",29),n(),o(5,"td"),d(6,"input",30),n()()),t&2){let e,i=m.$implicit,r=m.index,p=c(4);s("formGroupName",r),l(2),I(" ",(e=p.asFormGroup(i).get("accountName"))==null?null:e.value," ")}}function Pt(t,m){if(t&1&&(o(0,"div",10)(1,"h4",21),a(2),n(),o(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),n(),o(9,"th",26),a(10,"Debit"),n(),o(11,"th",26),a(12,"Credit"),n()()(),o(13,"tbody"),f(14,Rt,7,2,"tr",27),n()()()()),t&2){let e=m.$implicit,i=m.$index,r=c(3);s("formGroupName",i),l(2),I(" ",e.get("name").value," "),l(12),s("ngForOf",r.getItemsArray(r.asFormGroup(e)).controls)}}function Gt(t,m){if(t&1&&(o(0,"p-panel",8),f(1,Nt,4,0,"ng-template",null,2,h),d(3,"p-divider"),o(4,"p-scroll-panel")(5,"div",9),k(6,Pt,15,3,"div",10,M),n()(),o(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),n()(),o(14,"td",15)(15,"p",16),a(16),ue(17,"number"),n()(),o(18,"td",17)(19,"p",16),a(20),ue(21,"number"),n()()()()()()),t&2){let e=c(2);H(W(11,It)),s("formGroup",e.formGroups),l(4),H(W(12,Dt)),l(2),N(e.formsArray.controls),l(10),I(" ",fe(17,7,e.subtotalDebit)," "),l(4),I(" ",fe(21,9,e.subtotalCredit)," ")}}function Bt(t,m){if(t&1&&f(0,Gt,22,13,"p-panel",7),t&2){let e=c();s("ngIf",e.formGroups)}}var st=(()=>{class t{constructor(){this.destroy$=new Ce,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(J),this.accSetupService=u(S),this.dayjsService=u(He),this.date=new Date,this.routes=u(Te),this.roleService=u(P)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(xe(300),ve(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let i=e.map(r=>this.createItemGroup(r));return this.fb.array(i)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(be(e=>e.data),Ge("response"),D(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(r=>r.items&&r.items.length>0).forEach(r=>{this.formsArray.push(this.createFormGroup(r))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(i=>{let r=this.getItemsArray(i),p=r.controls.reduce((me,ce)=>{let pe=ce.get("debitAmount").value||0;return me+pe},0),bt=r.controls.reduce((me,ce)=>{let pe=ce.get("creditAmount").value||0;return me+pe},0);this.subtotalDebit+=p,this.subtotalCredit+=bt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((i,[r,p])=>(r==="date"?i[r]=p instanceof Date?this.dayjsService.format(p):p:r==="forms"?i.form=p:i[r]=p,i),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-acc-opening-balance-form"]],features:[ee([z])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
2
- width`,`calc(
3
- 100% - 243px
4
- )`,`/* adjust width to fit the remaining space */
5
- z-index`,"91","background-color","white",`/* added background */
6
- /* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
7
- padding`,"8px 0",`/* added padding for height */
8
- border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(i,r){i&1&&(o(0,"app-main-panel",3),f(1,kt,2,1,"ng-template",null,0,h)(3,Bt,1,1,"ng-template",null,1,h),n(),d(5,"p-toast",4)),i&2&&s("scrollable",!0)},dependencies:[v,ae,F,Fe,we,Ee,Pe,Re,le,re,oe,ne,G,w,B,E,Ye,$,T,U,L,Ke,j,V,O,te,Ne,tt,et],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var dt=t=>({"ng-invalid ng-dirty":t});function Ot(t,m){if(t&1){let e=C();o(0,"p-button",4),b("onClick",function(){g(e);let r=c();return _(r.verifyCredentials())}),a(1,"Verify"),n(),o(2,"p-button",4),b("onClick",function(){g(e);let r=c();return _(r.saveCredentials())}),a(3,"Update"),n()}}function Jt(t,m){t&1&&(o(0,"div",12)(1,"h3",13),a(2,"Account"),n(),o(3,"small",14),a(4,"Configure Client ID and Client Secret"),n()())}function jt(t,m){if(t&1&&(o(0,"div",5)(1,"p-panel"),f(2,Jt,5,0,"ng-template",null,2,h),o(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),n(),d(9,"input",10),n()(),o(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),n(),d(14,"input",11),n()()()()()),t&2){let e=c();l(4),s("formGroup",e.credentialForm),l(5),s("ngClass",de(3,dt,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),s("ngClass",de(5,dt,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var ut=(()=>{class t{constructor(e,i){this.fb=e,this.messageService=i,this.setupService=u(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(D(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ge.required]],clientSecret:["",[ge.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:i=>{console.log("Verify result:",i),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:i=>{console.error("Verify failed:",i),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(i){return new(i||t)(se(J),se(z))}}static{this.\u0275cmp=x({type:t,selectors:[["app-api-credential"]],features:[ee([z])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(i,r){i&1&&(o(0,"app-main-panel",3),f(1,Ot,4,0,"ng-template",null,0,h)(3,jt,15,7,"ng-template",null,1,h),n())},dependencies:[F,ye,j,G,w,B,V,O,E,ie,U,L,v,$,T,Ze],encapsulation:2})}}return t})();function zt(t,m){if(t&1){let e=C();o(0,"button",5),b("click",function(){g(e);let r=c(2);return _(r.onFormatJournal())}),a(1," Format "),n()}}function $t(t,m){if(t&1&&f(0,zt,2,0,"button",4),t&2){let e=c();y(e.roleService.permissions().accountingSetup.delete?0:-1)}}function Lt(t,m){t&1&&(o(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),n(),o(4,"small",16),a(5," Enter your account information to format journal entries "),n()()())}function Ut(t,m){if(t&1){let e=C();o(0,"div",6)(1,"p-panel"),f(2,Lt,6,0,"ng-template",null,2,h),o(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),Z("ngModelChange",function(r){g(e);let p=c();return Y(p.subdomain,r)||(p.subdomain=r),_(r)}),n(),o(8,"label",11),a(9,"Subdomain"),n()(),o(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=c();l(7),X("ngModel",e.subdomain)}}var ft=(()=>{class t{constructor(){this.setupService=u(S),this.subdomain=A(""),this.toastrService=u(De),this.roleService=u(P)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(i,r){i&1&&(o(0,"app-main-panel",3),f(1,$t,1,1,"ng-template",null,0,h)(3,Ut,12,1,"ng-template",null,1,h),n())},dependencies:[F,ne,G,w,ke,E,ie,v,U,L,Xe,Qe],encapsulation:2})}}return t})();var ht=()=>u(S).fetchOpeningBalanceFormConfiguration();var gt=(()=>{class t{constructor(){this._httpService=u(Me)}flushCache(e){e.forEach(i=>{this.flushCacheByEndPoint(i.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var _t=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function Ht(t,m){if(t&1){let e=C();o(0,"div",5)(1,"p-button",6),b("onClick",function(){g(e);let r=c(2);return _(r.onFlushCached())}),n()()}}function Wt(t,m){if(t&1&&f(0,Ht,2,0,"div",5),t&2){let e=c();y(e.isAnyCacheSelected?0:-1)}}function qt(t,m){t&1&&(o(0,"tr")(1,"th",8),d(2,"p-tableHeaderCheckbox"),n(),o(3,"th"),a(4,"Cache"),n(),o(5,"th"),a(6,"Description"),n()())}function Kt(t,m){if(t&1&&(o(0,"tr")(1,"td"),d(2,"p-tableCheckbox",9),n(),o(3,"td"),a(4),n(),o(5,"td"),a(6),n()()),t&2){let e=m.$implicit;l(2),s("value",e),l(2),I(" ",e.label," "),l(2),R(e.description)}}function Qt(t,m){if(t&1){let e=C();o(0,"p-table",7),b("onRowSelect",function(r){g(e);let p=c();return _(p.onRowSelect(r))})("onRowUnselect",function(r){g(e);let p=c();return _(p.onRowUnselect(r))})("onHeaderCheckboxToggle",function(r){g(e);let p=c();return _(p.onHeaderCheckboxToggle(r))}),Z("selectionChange",function(r){g(e);let p=c();return Y(p.selectedRows,r)||(p.selectedRows=r),_(r)}),f(1,qt,7,0,"ng-template",null,2,h)(3,Kt,7,3,"ng-template",null,3,h),n()}if(t&2){let e=c();s("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),X("selection",e.selectedRows)}}var Ct=(()=>{class t{constructor(){this.flushCachedService=u(gt),this.cachedData=_t,this.selectedRows=[],this.params=A({pageNumber:1,pageSize:100}),this.first=he(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=he(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let i=e.data;i?.endPoint&&this.updateCheckedRows([i.endPoint],!0)}updateCheckedRows(e,i){this.cachedData=this.cachedData.map(r=>e.includes(r.endPoint)?Q(K({},r),{checked:i}):r),this.selectedRows=this.cachedData.filter(r=>r.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let i=e.data;i?.endPoint&&this.updateCheckedRows([i.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(i=>Q(K({},i),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(i=>i.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(i=>Q(K({},i),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(i,r){i&1&&(o(0,"app-main-panel",4),f(1,Wt,1,1,"ng-template",null,0,h)(3,Qt,5,6,"ng-template",null,1,h),n()),i&2&&s("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,le,$e,Le,Ue,T],encapsulation:2})}}return t})();var Wi=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-Z4XRTHAH.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-Z3ZKNQZS.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-SJOOTBQ5.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-27SC6O47.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:ct},{path:"opening-balance-form",component:st,resolve:{data:ht}},{path:"api-crendetial",component:ut},{path:"flush-cached",component:Ct},{path:"format-journal",component:ft},{path:"closing-entries",loadComponent:()=>import("./chunk-SASRJPT7.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-DAFEIZYQ.js").then(t=>t.ClosingFormComponent)}]}];export{Wi as ACCOUNTING_SETUP_ROUTES};