dealposbooks 5.51.0 → 5.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/{chunk-ELZ5FFFM.js → chunk-2UDDXT3B.js} +1 -1
  2. package/{chunk-VABCBO2E.js → chunk-2Z3VSENH.js} +1 -1
  3. package/{chunk-MHM3ED4J.js → chunk-3IOJJMQE.js} +1 -1
  4. package/{chunk-YMV3SC73.js → chunk-3PM6I5JR.js} +1 -1
  5. package/{chunk-B7TGZ7J3.js → chunk-4BAARBYV.js} +1 -1
  6. package/{chunk-D5WBKKO2.js → chunk-5MLCIFDJ.js} +1 -1
  7. package/{chunk-BT4SLG45.js → chunk-5SDFH3ZF.js} +1 -1
  8. package/{chunk-TOAH3PY3.js → chunk-6JWBYLFX.js} +1 -1
  9. package/{chunk-DAN3PD7R.js → chunk-7XSFPN5T.js} +1 -1
  10. package/{chunk-KBJ25I3J.js → chunk-BBR4SZ4S.js} +1 -1
  11. package/{chunk-ZLBNHUZF.js → chunk-E2PHUSPH.js} +1 -1
  12. package/{chunk-EDYUAYO2.js → chunk-EO32GXB6.js} +1 -1
  13. package/{chunk-QXE4YYQV.js → chunk-EZXX3QNG.js} +1 -1
  14. package/{chunk-KJM3M7Y3.js → chunk-FJM77N3D.js} +1 -1
  15. package/{chunk-ZOMQLK4A.js → chunk-FUYYSJF7.js} +1 -1
  16. package/{chunk-GN7VAGHH.js → chunk-G25BIGG3.js} +1 -1
  17. package/{chunk-F4PHXCVU.js → chunk-HR6W3DC4.js} +1 -1
  18. package/{chunk-3RODMLL2.js → chunk-I3DG6HPA.js} +1 -1
  19. package/{chunk-KU4BYYJE.js → chunk-IWB6L5HR.js} +1 -1
  20. package/{chunk-E57RWXDG.js → chunk-IYV5JRCZ.js} +1 -1
  21. package/{chunk-LF4HTMCE.js → chunk-JNPTKMYO.js} +1 -1
  22. package/{chunk-ILQI2X5T.js → chunk-JRHKJYE2.js} +1 -1
  23. package/{chunk-4GZGUASQ.js → chunk-KPSZN2UI.js} +1 -1
  24. package/{chunk-7F5JJ627.js → chunk-KU3G54A2.js} +2 -2
  25. package/{chunk-L27GCER2.js → chunk-LP4UYVTQ.js} +2 -2
  26. package/{chunk-GEYRJ2MR.js → chunk-LZCLNB3T.js} +1 -1
  27. package/{chunk-QSIXT7W7.js → chunk-MDE76CBT.js} +1 -1
  28. package/{chunk-MCR6MBS2.js → chunk-MGEVP222.js} +1 -1
  29. package/{chunk-7GORVGAV.js → chunk-N3AQU3B6.js} +1 -1
  30. package/{chunk-R45WWOYD.js → chunk-OW6NHTGL.js} +1 -1
  31. package/{chunk-7ET5ZE2L.js → chunk-OZYL2K6P.js} +1 -1
  32. package/{chunk-32QC4JFI.js → chunk-PQ2NDMDD.js} +1 -1
  33. package/{chunk-BVHTVDYP.js → chunk-PXAENMFN.js} +1 -1
  34. package/{chunk-OKT36WED.js → chunk-PZCAY2XI.js} +1 -1
  35. package/{chunk-GQ7SPEZH.js → chunk-QSZKELXB.js} +1 -1
  36. package/{chunk-2U3PIWWJ.js → chunk-RA2HD63W.js} +1 -1
  37. package/{chunk-WPHZJHC6.js → chunk-RCHTOR4U.js} +1 -1
  38. package/{chunk-5XVZW6BJ.js → chunk-RNMAINY3.js} +1 -1
  39. package/{chunk-MWRTPPEI.js → chunk-U52NCHP2.js} +1 -1
  40. package/{chunk-2RXAK5B6.js → chunk-U7I6X4QJ.js} +2 -2
  41. package/chunk-UMDFA3TV.js +1 -0
  42. package/{chunk-NTVIX4GB.js → chunk-UNKPZO2B.js} +1 -1
  43. package/{chunk-NSMNMKCV.js → chunk-VANY33VH.js} +1 -1
  44. package/{chunk-J346SEEU.js → chunk-VYR5D7SO.js} +1 -1
  45. package/{chunk-HYOAHRKW.js → chunk-VZHZFGQ2.js} +1 -1
  46. package/{chunk-DM42MH3E.js → chunk-WNEAYP2J.js} +1 -1
  47. package/{chunk-OILVKUFA.js → chunk-X7I6QMMX.js} +1 -1
  48. package/{chunk-JPNJTPYJ.js → chunk-Y4SHAFGQ.js} +1 -1
  49. package/{chunk-JPKZVL57.js → chunk-YI5IYWUO.js} +1 -1
  50. package/{chunk-VQ62YSFR.js → chunk-YZ76QE4R.js} +1 -1
  51. package/{chunk-KXWAD3X4.js → chunk-Z2MDQN57.js} +1 -1
  52. package/{chunk-RFHL2MJ4.js → chunk-ZM7C3PCP.js} +1 -1
  53. package/index.html +2 -2
  54. package/{main-ET3JU27S.js → main-ARGVLXJ4.js} +1 -1
  55. package/package.json +1 -1
  56. package/chunk-CPAPQNFC.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-X6KL7VKV.js";import{a as Zt,b as gi,c as ni}from"./chunk-3O7NQ6AZ.js";import{a as kt,b as zt}from"./chunk-43JH7CKX.js";import{a as Xt}from"./chunk-YKZN6T5N.js";import{a as qe}from"./chunk-BT7Y4ADP.js";import{a as Ot}from"./chunk-5U7KZJ3H.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import{a as Vt}from"./chunk-II7KELI4.js";import{c as je}from"./chunk-FTBQKOYS.js";import{a as Lt}from"./chunk-L4ENW4RK.js";import{a as qt,b as Wt}from"./chunk-FHJOSHI3.js";import{a as Qe}from"./chunk-KONCSTVQ.js";import{a as $e}from"./chunk-FMAG3RQL.js";import{e as Qt,f as Ut,i as jt}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as At,b as Bt}from"./chunk-ISIYG4D5.js";import{a as $t}from"./chunk-FNGX2XFA.js";import{a as Mt}from"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht,z as Kt}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{$ as de,A as Re,C as De,Da as It,Ha as be,M as wt,Ma as _e,N as Pe,Na as Fe,Q as ie,R as z,S as fe,T as Ve,Va as Et,X as vt,Y as St,Z as ce,oa as Ne,ra as xt,sa as V,ta as Oe,x as Ct,z as Me}from"./chunk-MGIEURA2.js";import{d as Tt}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ae,l as yt,m as G,n as Le,o as se,u as me,x as ge}from"./chunk-DM2JLWKE.js";import{$b as T,$c as Q,Aa as S,Ab as rt,Ba as le,Cb as xe,Dc as pt,Eb as p,Ec as ee,Fa as Se,Fc as P,Gc as te,Ha as X,Hc as ht,I as Ye,Ic as ut,Kc as mt,La as it,Lb as ne,Mb as a,Nb as at,Oc as gt,Pb as Z,Qb as j,Qc as ft,Rb as Ie,Sb as Ee,Sc as x,Ub as ke,Vb as ze,Wb as d,Wc as bt,Xb as h,Yb as I,Zb as q,_ as Ce,_b as W,_c as w,ac as D,ca as we,cd as _t,da as et,fc as k,g as J,gb as ot,gc as m,ia as A,ib as s,lc as _,m as Ze,mc as E,nb as lt,nc as g,ob as N,oc as f,pa as tt,qa as L,ra as M,rc as Y,sc as b,tc as B,ua as ve,uc as re,xc as st,yb as U,yc as ct,zb as nt,zc as dt}from"./chunk-6QJHEOXN.js";import{a as $,b as ue,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
1
+ import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-X6KL7VKV.js";import{a as Zt,b as gi,c as ni}from"./chunk-3O7NQ6AZ.js";import{a as kt,b as zt}from"./chunk-43JH7CKX.js";import{a as Xt}from"./chunk-YKZN6T5N.js";import{a as qe}from"./chunk-BT7Y4ADP.js";import{a as Ot}from"./chunk-5U7KZJ3H.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import{a as Vt}from"./chunk-II7KELI4.js";import{c as je}from"./chunk-FTBQKOYS.js";import{a as Lt}from"./chunk-L4ENW4RK.js";import{a as qt,b as Wt}from"./chunk-FHJOSHI3.js";import{a as Qe}from"./chunk-KONCSTVQ.js";import{a as $e}from"./chunk-FMAG3RQL.js";import{e as Qt,f as Ut,i as jt}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as At,b as Bt}from"./chunk-ISIYG4D5.js";import{a as $t}from"./chunk-FNGX2XFA.js";import{a as Mt}from"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht,z as Kt}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{$ as de,A as Re,C as De,Da as It,Ha as be,M as wt,Ma as _e,N as Pe,Na as Fe,Q as ie,R as z,S as fe,T as Ve,Va as Et,X as vt,Y as St,Z as ce,oa as Ne,ra as xt,sa as V,ta as Oe,x as Ct,z as Me}from"./chunk-MGIEURA2.js";import{d as Tt}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ae,l as yt,m as G,n as Le,o as se,u as me,x as ge}from"./chunk-DM2JLWKE.js";import{$b as T,$c as Q,Aa as S,Ab as rt,Ba as le,Cb as xe,Dc as pt,Eb as p,Ec as ee,Fa as Se,Fc as P,Gc as te,Ha as X,Hc as ht,I as Ye,Ic as ut,Kc as mt,La as it,Lb as ne,Mb as a,Nb as at,Oc as gt,Pb as Z,Qb as j,Qc as ft,Rb as Ie,Sb as Ee,Sc as x,Ub as ke,Vb as ze,Wb as d,Wc as bt,Xb as h,Yb as I,Zb as q,_ as Ce,_b as W,_c as w,ac as D,ca as we,cd as _t,da as et,fc as k,g as J,gb as ot,gc as m,ia as A,ib as s,lc as _,m as Ze,mc as E,nb as lt,nc as g,ob as N,oc as f,pa as tt,qa as L,ra as M,rc as Y,sc as b,tc as B,ua as ve,uc as re,xc as st,yb as U,yc as ct,zb as nt,zc as dt}from"./chunk-6QJHEOXN.js";import{a as $,b as ue,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
2
2
  /* For PrimeNG */
3
3
  .p-treetable {
4
4
  position: relative;
@@ -1 +1 @@
1
- import{b as Se}from"./chunk-JPNJTPYJ.js";import{a as I,b as V}from"./chunk-3VQUNDVT.js";import{b as _e,i as xe}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as re}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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"./chunk-VQ62YSFR.js";import{a as X}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.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};
1
+ import{b as Se}from"./chunk-Y4SHAFGQ.js";import{a as I,b as V}from"./chunk-3VQUNDVT.js";import{b as _e,i as xe}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as re}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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"./chunk-YZ76QE4R.js";import{a as X}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.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};
@@ -1 +1 @@
1
- import{a as i,b as T}from"./chunk-WL6ZZCYW.js";import{d as s}from"./chunk-DZCJWJUG.js";import{c as m}from"./chunk-VQ62YSFR.js";import{a as l}from"./chunk-G3BJCT7T.js";import{_ as a,ca as c,ia as r}from"./chunk-6QJHEOXN.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
1
+ import{a as i,b as T}from"./chunk-WL6ZZCYW.js";import{d as s}from"./chunk-DZCJWJUG.js";import{c as m}from"./chunk-YZ76QE4R.js";import{a as l}from"./chunk-G3BJCT7T.js";import{_ as a,ca as c,ia as r}from"./chunk-6QJHEOXN.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-WPHZJHC6.js";import{a as Pe}from"./chunk-SVGPDGYN.js";import{a as it}from"./chunk-YHLRDTIS.js";import{a as Ue,b as He}from"./chunk-LO4HJ77Y.js";import{a as te}from"./chunk-GQ7SPEZH.js";import{b as R}from"./chunk-JPNJTPYJ.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{b as ke,g as Je,h as Ne,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as _e,b as ge}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as $,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:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:null,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-LF4HTMCE.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-4GZGUASQ.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-7ET5ZE2L.js").then(t=>t.AdjustmentJournalComponent)}];export{fo as generateJournalRoutes};
1
+ import{a as D}from"./chunk-RCHTOR4U.js";import{a as Pe}from"./chunk-SVGPDGYN.js";import{a as it}from"./chunk-YHLRDTIS.js";import{a as Ue,b as He}from"./chunk-LO4HJ77Y.js";import{a as te}from"./chunk-QSZKELXB.js";import{b as R}from"./chunk-Y4SHAFGQ.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{b as ke,g as Je,h as Ne,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as _e,b as ge}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.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:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:null,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-JNPTKMYO.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-KPSZN2UI.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-OZYL2K6P.js").then(t=>t.AdjustmentJournalComponent)}];export{fo as generateJournalRoutes};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-GQ7SPEZH.js";import{a as o}from"./chunk-G3BJCT7T.js";import{ca as i,ia as n}from"./chunk-6QJHEOXN.js";var d=(()=>{class r{constructor(){this.httpService=n(o),this.authService=n(u)}getJournalInvoiceLoader(){return this.httpService.get(void 0,"api/GenerateJournal/invoice/Loader")}getCustomerSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:t})}getJournalInvoice(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/invoice/get",t)}generateJournalInvoice(e){return this.httpService.post(void 0,"api/GenerateJournal/invoice/Submit",e)}getGJSupplierBillLoader(){return this.httpService.get(void 0,"api/GenerateJournal/bill/Loader")}getJournalSupplierBill(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/bill/get",t)}generateJournalSupplierBill(e){return this.httpService.post(void 0,"api/GenerateJournal/bill/Submit",e)}getGJShiftLoader(){return this.httpService.get(void 0,"api/GenerateJournal/Shift/Loader")}getJournalShift(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/Shift/get",t)}generateJornalShift(e){return this.httpService.post(void 0,"api/GenerateJournal/Shift/Submit",e)}getARJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinInvoice/Loader")}getARJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinInvoice/get",t)}createARJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinInvoice/Submit",e)}getAPJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinBill/Loader")}getAPJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinBill/get",t)}createAPJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinBill/Submit",e)}getGJAdjustmentLoader(){return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/Loader")}getAdjustmentJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/get",t)}createAdjustmentJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/InventoryAdjustment/Submit",e)}getSupplierSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:t})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=i({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{d as a};
1
+ import{a as u}from"./chunk-QSZKELXB.js";import{a as o}from"./chunk-G3BJCT7T.js";import{ca as i,ia as n}from"./chunk-6QJHEOXN.js";var d=(()=>{class r{constructor(){this.httpService=n(o),this.authService=n(u)}getJournalInvoiceLoader(){return this.httpService.get(void 0,"api/GenerateJournal/invoice/Loader")}getCustomerSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:t})}getJournalInvoice(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/invoice/get",t)}generateJournalInvoice(e){return this.httpService.post(void 0,"api/GenerateJournal/invoice/Submit",e)}getGJSupplierBillLoader(){return this.httpService.get(void 0,"api/GenerateJournal/bill/Loader")}getJournalSupplierBill(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/bill/get",t)}generateJournalSupplierBill(e){return this.httpService.post(void 0,"api/GenerateJournal/bill/Submit",e)}getGJShiftLoader(){return this.httpService.get(void 0,"api/GenerateJournal/Shift/Loader")}getJournalShift(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/Shift/get",t)}generateJornalShift(e){return this.httpService.post(void 0,"api/GenerateJournal/Shift/Submit",e)}getARJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinInvoice/Loader")}getARJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinInvoice/get",t)}createARJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinInvoice/Submit",e)}getAPJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinBill/Loader")}getAPJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinBill/get",t)}createAPJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinBill/Submit",e)}getGJAdjustmentLoader(){return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/Loader")}getAdjustmentJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/get",t)}createAdjustmentJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/InventoryAdjustment/Submit",e)}getSupplierSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:t})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=i({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{d as a};
@@ -1 +1 @@
1
- import{a as y,b as J}from"./chunk-NTVIX4GB.js";import"./chunk-JPNJTPYJ.js";import{m as V}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as j,b as R}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import{a as I}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as F,u as E}from"./chunk-DM2JLWKE.js";import{Dc as $,Eb as _,Ec as b,Mb as c,Oc as l,Pb as h,Pc as s,Rb as x,Sc as S,W as M,Wb as o,Xb as n,Y as k,Yb as u,_ as w,ac as v,fc as T,gc as a,h as A,ia as m,ib as r,qa as g,ra as C,s as d,sa as B,ta as O,yb as P}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(e,f){if(e&1){let t=v();o(0,"p-button",6),T("onClick",function(){g(t);let p=a(2);return C(p.onFormatCOA())}),n()}}function U(e,f){if(e&1){let t=v();o(0,"p-button",7),l(1,"async"),l(2,"async"),T("onClick",function(){g(t);let p=a(2);return C(p.onMigrateCoaAccount())}),n()}if(e&2){let t=a(2);c("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(e,f){if(e&1&&(o(0,"div",3),_(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),n()),e&2){let t=a();r(),x(t.roleService.permissions().migrate.delete?1:-1),r(),x(t.roleService.permissions().migrate.create?2:-1)}}function X(e,f){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),l(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),O(),u(7,"app-migration-cards",12),l(8,"async"),n()()()),e&2){let t=a();h(b(12,K)),r(),h(b(13,K)),r(2),c("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),c("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var xt=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(I),this.refresh$=new A(void 0),this.pageTitle="Chart of Account",this.roleService=m(V)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getCOACount()),w(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(d(i=>Number(i.pos))),this.countInBooks$=t.pipe(d(i=>Number(i.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=P({type:e,selectors:[["app-chart-of-account"]],features:[$([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),_(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),n()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[z,E,F,J,N,D,R,j,H,G,q,L],encapsulation:2})}}return e})();export{xt as ChartOfAccountComponent};
1
+ import{a as y,b as J}from"./chunk-UNKPZO2B.js";import"./chunk-Y4SHAFGQ.js";import{m as V}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as j,b as R}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import{a as I}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as F,u as E}from"./chunk-DM2JLWKE.js";import{Dc as $,Eb as _,Ec as b,Mb as c,Oc as l,Pb as h,Pc as s,Rb as x,Sc as S,W as M,Wb as o,Xb as n,Y as k,Yb as u,_ as w,ac as v,fc as T,gc as a,h as A,ia as m,ib as r,qa as g,ra as C,s as d,sa as B,ta as O,yb as P}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(e,f){if(e&1){let t=v();o(0,"p-button",6),T("onClick",function(){g(t);let p=a(2);return C(p.onFormatCOA())}),n()}}function U(e,f){if(e&1){let t=v();o(0,"p-button",7),l(1,"async"),l(2,"async"),T("onClick",function(){g(t);let p=a(2);return C(p.onMigrateCoaAccount())}),n()}if(e&2){let t=a(2);c("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(e,f){if(e&1&&(o(0,"div",3),_(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),n()),e&2){let t=a();r(),x(t.roleService.permissions().migrate.delete?1:-1),r(),x(t.roleService.permissions().migrate.create?2:-1)}}function X(e,f){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),l(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),O(),u(7,"app-migration-cards",12),l(8,"async"),n()()()),e&2){let t=a();h(b(12,K)),r(),h(b(13,K)),r(2),c("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),c("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var xt=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(I),this.refresh$=new A(void 0),this.pageTitle="Chart of Account",this.roleService=m(V)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getCOACount()),w(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(d(i=>Number(i.pos))),this.countInBooks$=t.pipe(d(i=>Number(i.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=P({type:e,selectors:[["app-chart-of-account"]],features:[$([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),_(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),n()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[z,E,F,J,N,D,R,j,H,G,q,L],encapsulation:2})}}return e})();export{xt as ChartOfAccountComponent};
@@ -1 +1 @@
1
- import{a as be}from"./chunk-GQ7SPEZH.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{b as Y,g as Ie,h as Me,i as Z}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as j,b as H}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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"./chunk-VQ62YSFR.js";import{a as he}from"./chunk-G3BJCT7T.js";import{a as _e}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{d as $}from"./chunk-KL3TPLRB.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};
1
+ import{a as be}from"./chunk-QSZKELXB.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{b as Y,g as Ie,h as Me,i as Z}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.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-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as j,b as H}from"./chunk-ISIYG4D5.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-ALLR2NXQ.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"./chunk-YZ76QE4R.js";import{a as he}from"./chunk-G3BJCT7T.js";import{a as _e}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{d as $}from"./chunk-KL3TPLRB.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};