dealposbooks 5.45.0 → 5.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-4PUT2IIE.js → chunk-26UQWFZL.js} +1 -1
- package/{chunk-5EJXAYSX.js → chunk-2CZSVC7E.js} +1 -1
- package/{chunk-ZRCCGUC4.js → chunk-3HOFEEIL.js} +1 -1
- package/chunk-3KUSIKRO.js +202 -0
- package/{chunk-IFQIZ5KJ.js → chunk-4LXFEAO3.js} +1 -1
- package/{chunk-M6LSMNSQ.js → chunk-4TTCPL3N.js} +1 -1
- package/{chunk-BJWQQABR.js → chunk-5M4DFZYR.js} +2 -2
- package/{chunk-EERQ53V7.js → chunk-66OMKKIW.js} +1 -1
- package/{chunk-GIQOPGQF.js → chunk-A2PK5UDL.js} +1 -1
- package/{chunk-6HX55BLY.js → chunk-AJUXGEAH.js} +1 -1
- package/{chunk-HPITHIZA.js → chunk-AOJUTF6L.js} +1 -1
- package/{chunk-4ETCCLMI.js → chunk-BSDEDT6G.js} +1 -1
- package/{chunk-LSK6C72D.js → chunk-BTVPGIVW.js} +1 -1
- package/{chunk-OTO7ELZ2.js → chunk-BXJSXLQV.js} +1 -1
- package/{chunk-35MXFTDN.js → chunk-CDM64DTS.js} +1 -1
- package/{chunk-N75VYDTF.js → chunk-DHA762N3.js} +1 -1
- package/{chunk-4MZNOMUN.js → chunk-DWCZUCH4.js} +1 -1
- package/{chunk-R6TARUG2.js → chunk-FPBO6QHG.js} +1 -1
- package/{chunk-K5U6AQ75.js → chunk-FXATM6DM.js} +1 -1
- package/{chunk-3FDVZDYS.js → chunk-GJJEUBYR.js} +1 -1
- package/{chunk-7FFVGWUP.js → chunk-GNLE4WCA.js} +1 -1
- package/{chunk-T6B4BOOB.js → chunk-GZYN6L4H.js} +1 -1
- package/{chunk-6D4IGQVY.js → chunk-HSCJP74Q.js} +1 -1
- package/{chunk-EG4A3G2F.js → chunk-HWYLSS7R.js} +1 -1
- package/{chunk-IYBQ7NLP.js → chunk-JOKE4TMJ.js} +1 -1
- package/{chunk-GX5CQNX3.js → chunk-JTUKNSIL.js} +1 -1
- package/{chunk-ITBP232X.js → chunk-KQGEEF2E.js} +2 -2
- package/{chunk-OTMBGB3T.js → chunk-KUECUVZ7.js} +1 -1
- package/{chunk-27TIOMYM.js → chunk-MLC5Q3HL.js} +1 -1
- package/{chunk-7XL26PM3.js → chunk-MMQTWRG5.js} +1 -1
- package/{chunk-PJDNYCLD.js → chunk-N4CQ65FU.js} +1 -1
- package/{chunk-ZZCT6WNV.js → chunk-NMNIOSPK.js} +1 -1
- package/{chunk-PPJQN2WS.js → chunk-OQD4ZKBU.js} +1 -1
- package/{chunk-CSDQYXOM.js → chunk-OVHHHUDY.js} +1 -1
- package/{chunk-W5ER7276.js → chunk-OX6CAMTK.js} +1 -1
- package/{chunk-QVIFRW2H.js → chunk-OZG2M6UV.js} +2 -2
- package/{chunk-YOMVOFLB.js → chunk-P63CD72K.js} +1 -1
- package/chunk-PYQLVU3L.js +7 -0
- package/{chunk-3OMEVXSG.js → chunk-QTPVRMTB.js} +1 -1
- package/{chunk-DLIPUA4K.js → chunk-QUL4J2CF.js} +1 -1
- package/{chunk-66D4GMNG.js → chunk-QY6YO5GR.js} +1 -1
- package/{chunk-VXTZNZMH.js → chunk-SZPSOPM4.js} +1 -1
- package/{chunk-FPI32FQH.js → chunk-UP4DWDNE.js} +1 -1
- package/{chunk-Y6YUTTA4.js → chunk-VEALQLJ2.js} +1 -1
- package/{chunk-U7BSQJHQ.js → chunk-W325ZFGZ.js} +1 -1
- package/{chunk-T7VJORKB.js → chunk-WO62II7E.js} +1 -1
- package/{chunk-DX2A6LIU.js → chunk-WZQ3ORPU.js} +1 -1
- package/{chunk-S5O44AS7.js → chunk-XBIY3I5H.js} +1 -1
- package/{chunk-G2DQX336.js → chunk-Y4NMBCL7.js} +1 -1
- package/{chunk-H3BFDSSJ.js → chunk-Y7P7BGVH.js} +1 -1
- package/{chunk-KW4A377H.js → chunk-YDFJ65ST.js} +1 -1
- package/chunk-YVO6JHL7.js +1 -0
- package/index.html +2 -2
- package/{main-SLMY35VH.js → main-TUODCJBC.js} +1 -1
- package/package.json +1 -1
- package/chunk-AUYM5P42.js +0 -202
- package/chunk-O2QIO42B.js +0 -7
- package/chunk-OBZRC7DX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-SZPSOPM4.js";import{b as q}from"./chunk-GNLE4WCA.js";import{a as J}from"./chunk-XKI7WLHE.js";import{a as z,b as H}from"./chunk-EB6NEJHF.js";import{a as O,b as W}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as I}from"./chunk-Y7P7BGVH.js";import"./chunk-VGNJD35F.js";import{a as G,b as A}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as j,w as k,x as B}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as y,e as D,f as M,k as T,l as w,o as N,u as V,x as R}from"./chunk-OIBDX2CA.js";import{d as P}from"./chunk-AOOG6YOT.js";import"./chunk-4TTCPL3N.js";import"./chunk-2MKKFLNJ.js";import{s as F}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as b,Bb as S,Db as p,Lb as c,Rc as a,Vb as i,Wb as t,Xb as f,_ as C,ec as E,fc as u,hb as _,ia as m,qa as x,ra as h,rc as l,xb as v}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";function L(e,d){if(e&1){let o=b();i(0,"p-button",4),E("onClick",function(){x(o);let n=u();return h(n.onSubmit())}),t()}}function Q(e,d){e&1&&(i(0,"div",13)(1,"h3",14),l(2,"General"),t(),i(3,"span",15),l(4,"Enter your closing Fiscal Date"),t()())}function U(e,d){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,Q,5,0,"ng-template",null,2,a),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),l(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),l(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=u();_(7),c("formGroup",o.form)}}var he=(()=>{class e extends J{constructor(){super(),this.closingEntriesService=m(K),this.dayjsService=m(q),this.fb=m(V),this.router=m(P)}ngOnInit(){this.initForm()}initForm(){this.form=this.fb.group({Period:this.fb.control(new Date),Note:this.fb.control("")})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{Period:o}=this.form.getRawValue(),r=Object.entries(this.form.getRawValue()).reduce((n,[s,g])=>(s==="Period"?n[s]=this.dayjsService.from(o)?this.dayjsService.format(g):"":n[s]=g,n),{});this.closingEntriesService.createClosingEntry(r).pipe(C(()=>{this.router.navigate(["/pages/accounting-setup/closing-entries"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-closing-form"]],features:[S],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Closing Entries Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"col-4"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","Period","fluid",""],["formControlName","Note","rows","5","cols","30","pTextarea",""],[1,"d-flex","flex-column","mx-2"],[1,"fs-5","m-0"],[1,"fs-3"]],template:function(r,n){r&1&&(i(0,"app-main-panel",3),p(1,L,1,0,"ng-template",null,0,a)(3,U,16,1,"ng-template",null,1,a),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[I,F,A,G,W,O,j,H,z,B,k,R,T,y,D,M,w,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{he as ClosingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-SZPSOPM4.js";import{a as D,b as H}from"./chunk-3A4BFUGD.js";import{d as Y,i as Z,j as ee,k as te}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as X}from"./chunk-Y7P7BGVH.js";import"./chunk-VGNJD35F.js";import{a as f,b as $,c as q,d as G,e as J,f as Q,g as W}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as K,x as O}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-4TTCPL3N.js";import"./chunk-2MKKFLNJ.js";import{k as j,p as F,s as A}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as R,Cc as B,Db as E,Lb as h,Nc as v,Pc as M,Rc as _,Vb as r,Wb as l,Xb as S,Y as k,_ as N,bd as b,c as P,ec as T,fc as g,hb as d,ia as x,qa as u,ra as C,rc as p,s as V,sc as w,vc as z,xb as U}from"./chunk-NMCKMUY4.js";import{a,b as c}from"./chunk-YQFG5XE2.js";var ne={data:[],count:0,filter:{PageSize:20,PageNumber:1}},I=$(Q(ne),W("Closing Entries Store"),q(t=>({first:b(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:b(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.count())),hasCheckedRows:b(()=>t.data().some(s=>s.checked)),selectedItems:b(()=>t.data().filter(s=>s.checked))})),J(t=>{let s=x(y),e={updateFilter:o=>{f(t,n=>c(a({},n),{filter:a(a({},n.filter),o)}))},onRowSelect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!0}):m);return c(a({},n),{data:i})})},onRowUnselect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!1}):m);return c(a({},n),{data:i})})},onHeaderCheckboxToggle(o){f(t,n=>{let i=n.data.map(m=>c(a({},m),{checked:o}));return c(a({},n),{data:i})})},getClosingEntries:D(P(k(o=>s.getClosingEntries(o).pipe(V(n=>n.map(i=>c(a({},i),{checked:!1}))),H({next:n=>{f(t,i=>c(a({},i),{data:n})),e.getClosingEntryCount()},error:n=>{console.error("Error fetching closing entries:",n)}}))))),getClosingEntryCount:D(P(k(()=>s.getClosingEntryCount().pipe(H({next:({count:o})=>{f(t,n=>c(a({},n),{count:o}))},error:o=>{console.error("Error fetching closing entry count:",o)}})))))};return e}),G(t=>({onInit:()=>{t.getClosingEntries(t.filter)}})));function oe(t,s){if(t&1){let e=R();r(0,"p-button",11),T("onClick",function(){u(e);let n=g(2);return C(n.onDeleteClosingEntries())}),l()}}function ie(t,s){if(t&1&&(r(0,"div",7),E(1,oe,1,0,"p-button",8),r(2,"a",9),S(3,"i",10),p(4," Add"),l()()),t&2){let e=g();d(),h("ngIf",e.store.hasCheckedRows())}}function re(t,s){t&1&&(r(0,"tr")(1,"th",13),S(2,"p-tableHeaderCheckbox"),l(),r(3,"th"),p(4,"Period"),l(),r(5,"th"),p(6,"Note"),l(),r(7,"th"),p(8,"Created"),l(),r(9,"th"),p(10,"CreatedBy"),l()())}function ae(t,s){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",14),l(),r(3,"td"),p(4),v(5,"date"),l(),r(6,"td"),p(7),l(),r(8,"td"),p(9),v(10,"date"),l(),r(11,"td"),p(12),l()()),t&2){let e=s.$implicit;d(2),h("value",e),d(2),w(M(5,5,e.period,"d MMM y")),d(3),w(e.note),d(2),w(M(10,8,e.created,"d MMM y")),d(3),w(e.creatorName)}}function le(t,s){if(t&1&&p(0),t&2){let e=g(2);z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function se(t,s){t&1&&(r(0,"tr")(1,"td",15)(2,"span"),p(3," No journal entries found. "),l()()())}function ce(t,s){if(t&1){let e=R();r(0,"p-table",12),T("onPage",function(n){u(e);let i=g();return C(i.onPageChange(n))})("onRowSelect",function(n){u(e);let i=g();return C(i.onRowSelect(n))})("onRowUnselect",function(n){u(e);let i=g();return C(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){u(e);let i=g();return C(i.onHeaderCheckboxToggle(n))}),E(1,re,11,0,"ng-template",null,2,_)(3,ae,13,11,"ng-template",null,3,_)(5,le,1,3,"ng-template",null,4,_)(7,se,4,0,"ng-template",null,5,_),l()}if(t&2){let e=g();h("value",e.store.data())("paginator",!0)("totalRecords",e.store.count())("lazy",!0)("rows",e.store.filter().PageSize)("scrollHeight","calc(100vh - 142px)")}}var Ve=(()=>{class t{constructor(){this.store=x(I),this.closingEntryService=x(y)}onPageChange(e){let o=e.first/e.rows+1;this.store.updateFilter(c(a({},this.store.filter()),{PageSize:o}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onDeleteClosingEntries(){let e=this.store.selectedItems().map(o=>o.id).join(",");console.log("Deleting closing entries with IDs:",e),this.closingEntryService.deleteClosingEntry(e).pipe(N(()=>{this.store.updateFilter(a({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-closing-page"]],features:[B([I])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Closing Entries List",3,"scrollable"],[1,"d-flex","gap-2"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollHeight"],[2,"width","1rem"],[3,"value"],["colspan","5"]],template:function(o,n){o&1&&(r(0,"app-main-panel",6),E(1,ie,5,1,"ng-template",null,0,_)(3,ce,9,6,"ng-template",null,1,_),l()),o&2&&h("scrollable",!0)},dependencies:[X,A,j,F,te,Y,Z,ee,L,O,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Ve as ClosingPageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-K5U6AQ75.js";import{a as nt}from"./chunk-G4XX7EU2.js";import{a as ze}from"./chunk-JRVYSBUZ.js";import{a as Ae,b as He}from"./chunk-BLR3HBYP.js";import{a as ie}from"./chunk-T6B4BOOB.js";import{b as J}from"./chunk-7FFVGWUP.js";import{a as Me}from"./chunk-XKI7WLHE.js";import{a as Ue,b as Pe}from"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import"./chunk-IGWIRCAS.js";import{a as z,b as j}from"./chunk-3A4BFUGD.js";import{d as ke,i as Ne,j as Je,k as Re}from"./chunk-EL5BUFMO.js";import{a as Te,b as Fe}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Be}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import{a as Ve,b as De}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as Ie,h as Ee}from"./chunk-H3BFDSSJ.js";import{b as ye,c as we}from"./chunk-VGNJD35F.js";import{a as ge,b as he}from"./chunk-2XUSZCQL.js";import{a as y,b as Se,c as xe,d as Ce,e as be,f as ve,g as it}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as de,o as ue,w as fe,x as _e}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as ne,c as oe,e as re,f as le,k as ae,l as pe,o as me,u as se,x as ce}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-M6LSMNSQ.js";import"./chunk-2MKKFLNJ.js";import{h as Q,j as X,k as Y,n as tt,p as Z,q as ee,s as te}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as E,Bb as H,Cc as q,Db as g,Dc as $,Ec as F,Ha as k,Lb as s,Nc as w,Oc as M,Pc as V,Rc as b,Vb as l,Wb as o,Xb as x,Y as B,_ as G,bd as I,c as R,db as U,ec as T,fc as _,hb as a,ia as v,qa as h,ra as S,rc as m,s as O,sc as C,tc as N,ua as et,vc as L,wc as W,xb as A,xc as P,yc as K}from"./chunk-NMCKMUY4.js";import{a as c,b as d}from"./chunk-YQFG5XE2.js";var ht={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}},qe=Se(ve(ht),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(J);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(R(O(n=>Object.entries(n).reduce((i,[f,u])=>(u!=null&&(i[f]=u),i),{})),B(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}))})),Be("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(R(B(()=>p.getJournalInvoiceLoader().pipe(j({next:n=>{y(t,i=>d(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),Ce(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var $e=t=>({"ng-invalid ng-dirty":t}),Ct=()=>({});function bt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function vt(t,p){if(t&1&&g(0,bt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function yt(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),x(19,"th",18),o())}function wt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),x(21,"p-chip",21),o(),l(22,"td"),x(23,"p-chip",21),o(),l(24,"td"),x(25,"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/Customer_Invoice/Info?ID="+e.id,U),a(),N(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),N(" ",e.customer," "),a(2),C(V(13,14,e.date,"d MMM y hh:mm")),a(3),C(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),C(M(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function It(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Et(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Tt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,yt,20,0,"ng-template",null,3,b)(4,wt,26,22,"ng-template",null,4,b)(6,It,1,3,"ng-template",null,5,b)(8,Et,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 Ft(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(),N(" ",V(2,2,e.name,30)," ")}}function Vt(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 Dt(t,p){if(t&1&&(l(0,"div"),g(1,Vt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}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 Nt(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("to"))}}function Jt(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 Rt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Bt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Ft,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Dt,2,1,"div",32),x(21,"p-datepicker",33),g(22,Nt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Customer"),o(),l(26,"p-autocomplete",34),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(27,"div",25)(28,"label",26),m(29,"Page Size"),o(),x(30,"input",35),g(31,Rt,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",F(17,$e,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,$e,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,$e,e.isInvalid("pageSize")))("autoNumeric",$(23,Ct)),a(),s("ngIf",e.isInvalid("pageSize"))}}var ft=(()=>{class t extends Me{constructor(){super(...arguments),this.store=v(qe),this.dayjsService=v(J),this.generateJournalService=v(D),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.customerSuggestions=k([]),this.fb=v(se)}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:je,pageNumber:Oe,pageSize:Ge,export:Le,exportPageNumber:We,exportPageSize:Ke}=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(je),pageNumber:this.fb.control(Oe),pageSize:this.fb.control(Ge,[oe.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(We),exportPageSize:this.fb.control(Ke)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Be("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]=nt);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=et(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[q([qe]),H],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"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[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",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,vt,1,1,"ng-template",null,0,b)(3,Tt,10,5,"ng-template",null,1,b)(5,Bt,32,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:[Ee,Re,ke,Ne,Je,te,Q,X,Y,ee,Z,Pe,Ue,he,ge,_e,fe,De,Ve,Fe,Te,ue,de,He,Ae,ce,ae,ne,re,le,pe,me,we,ye,Ie,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Pt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4},skipRequestFirst:!0},Qe=Se(it("JournalSupplierBillStore"),ve(Pt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(J);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(R(B(()=>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(R(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(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)}})))))}}),Ce(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Xe=t=>({"ng-invalid ng-dirty":t}),Mt=()=>({});function zt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function jt(t,p){if(t&1&&g(0,zt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Ot(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),x(19,"th",18),o())}function Gt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(20,"p-chip",21),o(),l(21,"td"),x(22,"p-chip",21),o(),l(23,"td"),x(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(),N(" ",e.number," "),a(2),C(e.customer),a(2),C(V(12,13,e.date,"d MMM y hh:mm")),a(3),C(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),C(M(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 Ut(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function At(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Ht(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Ot,20,0,"ng-template",null,3,b)(4,Gt,25,21,"ng-template",null,4,b)(6,Ut,1,3,"ng-template",null,5,b)(8,At,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 Lt(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(),N(" ",V(2,2,e.name,30)," ")}}function Wt(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 Kt(t,p){if(t&1&&(l(0,"div"),g(1,Wt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function qt(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 $t(t,p){if(t&1&&(l(0,"div"),g(1,qt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Qt(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 Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Yt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Lt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Kt,2,1,"div",32),x(21,"p-datepicker",33),g(22,$t,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){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(28,"div",25)(29,"label",26),m(30,"Page Size"),o(),x(31,"input",35),g(32,Xt,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",F(19,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",M(27,17,e.supplierSuggestions$)),a(5),s("autoNumeric",$(23,Mt))("ngClass",F(24,Xe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Qe),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(se),this.dayjsService=v(J)}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(Be("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:u,supplierID:je,pageNumber:Oe,pageSize:Ge,export:Le,exportPageNumber:We,exportPageSize:Ke}=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(je),pageNumber:this.fb.control(Oe),pageSize:this.fb.control(Ge,[oe.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(We),exportPageSize:this.fb.control(Ke)})}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=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([Qe]),H],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 Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[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","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,jt,1,1,"ng-template",null,0,b)(3,Ht,10,5,"ng-template",null,1,b)(5,Yt,33,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Re,ke,Ne,Je,te,Q,X,Y,tt,ee,Z,Pe,Ue,he,ge,_e,fe,De,Ve,Fe,Te,He,Ae,ce,ae,ne,re,le,pe,me,ue,de,Ie,we,ye,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt={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}},Ye=Se(ve(Zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(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(R(B(()=>p.getGJShiftLoader().pipe(j(e=>y(t,r=>d(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(R(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(j(r=>y(t,n=>d(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),Ce(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var Ze=t=>({"ng-invalid ng-dirty":t}),ei=()=>({});function ti(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ii(t,p){if(t&1&&g(0,ti,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function ni(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),x(21,"th",18),o())}function oi(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(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(),N(" ",e.number," "),a(2),C(V(8,14,e.open,"dd MMM y hh:mm")),a(3),C(V(11,17,e.close,"dd MMM y hh:mm")),a(3),C(e.cashier),a(2),C(M(16,20,e.salesNTax)),a(3),C(M(19,22,e.totalInvoice)),a(3),C(e.outlet),a(2),C(e.register),a(2),C(M(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 ri(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function li(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ai(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,ni,22,0,"ng-template",null,3,b)(4,oi,29,26,"ng-template",null,4,b)(6,ri,1,3,"ng-template",null,5,b)(8,li,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 pi(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(),N(" ",V(2,2,e.name,30)," ")}}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("from"))}}function ci(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 di(t,p){if(t&1&&(l(0,"div"),g(1,ci,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ui(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 fi(t,p){if(t&1&&(l(0,"div"),g(1,ui,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function _i(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,pi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),x(11,"p-datepicker",28),g(12,si,2,1,"div",29),x(13,"p-datepicker",30),g(14,di,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),x(18,"input",31),g(19,fi,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",F(14,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",$(18,ei))("ngClass",F(19,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(se),this.dayjsService=v(J)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,pageSize:u,export:je,exportPageNumber:Oe,exportPageSize:Ge}=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,[oe.required]),export:this.fb.control(je),exportPageNumber:this.fb.control(Oe),exportPageSize:this.fb.control(Ge)})}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=A({type:t,selectors:[["app-journal-shift"]],features:[q([Ye]),H],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 Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,ii,1,1,"ng-template",null,0,b)(3,ai,10,5,"ng-template",null,1,b)(5,_i,20,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Re,ke,Ne,Je,te,Q,X,Y,ee,Z,Pe,he,ge,_e,fe,ce,ae,ne,re,le,pe,me,De,Ve,Fe,Te,Ie,we,ye,ue,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var So=[{path:"invoice",component:ft},{path:"supplier-bill",component:_t},{path:"shift",component:gt},{path:"join-invoice",loadComponent:()=>import("./chunk-YOMVOFLB.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-LSK6C72D.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-CSDQYXOM.js").then(t=>t.AdjustmentJournalComponent)}];export{So as generateJournalRoutes};
|
|
1
|
+
import{a as D}from"./chunk-FXATM6DM.js";import{a as nt}from"./chunk-G4XX7EU2.js";import{a as ze}from"./chunk-JRVYSBUZ.js";import{a as Ae,b as He}from"./chunk-BLR3HBYP.js";import{a as ie}from"./chunk-GZYN6L4H.js";import{b as J}from"./chunk-GNLE4WCA.js";import{a as Me}from"./chunk-XKI7WLHE.js";import{a as Ue,b as Pe}from"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import"./chunk-IGWIRCAS.js";import{a as z,b as j}from"./chunk-3A4BFUGD.js";import{d as ke,i as Ne,j as Je,k as Re}from"./chunk-EL5BUFMO.js";import{a as Te,b as Fe}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Be}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import{a as Ve,b as De}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as Ie,h as Ee}from"./chunk-Y7P7BGVH.js";import{b as ye,c as we}from"./chunk-VGNJD35F.js";import{a as ge,b as he}from"./chunk-2XUSZCQL.js";import{a as y,b as Se,c as xe,d as Ce,e as be,f as ve,g as it}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as de,o as ue,w as fe,x as _e}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as ne,c as oe,e as re,f as le,k as ae,l as pe,o as me,u as se,x as ce}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-4TTCPL3N.js";import"./chunk-2MKKFLNJ.js";import{h as Q,j as X,k as Y,n as tt,p as Z,q as ee,s as te}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as E,Bb as H,Cc as q,Db as g,Dc as $,Ec as F,Ha as k,Lb as s,Nc as w,Oc as M,Pc as V,Rc as b,Vb as l,Wb as o,Xb as x,Y as B,_ as G,bd as I,c as R,db as U,ec as T,fc as _,hb as a,ia as v,qa as h,ra as S,rc as m,s as O,sc as C,tc as N,ua as et,vc as L,wc as W,xb as A,xc as P,yc as K}from"./chunk-NMCKMUY4.js";import{a as c,b as d}from"./chunk-YQFG5XE2.js";var ht={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}},qe=Se(ve(ht),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(J);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(R(O(n=>Object.entries(n).reduce((i,[f,u])=>(u!=null&&(i[f]=u),i),{})),B(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}))})),Be("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(R(B(()=>p.getJournalInvoiceLoader().pipe(j({next:n=>{y(t,i=>d(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),Ce(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var $e=t=>({"ng-invalid ng-dirty":t}),Ct=()=>({});function bt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function vt(t,p){if(t&1&&g(0,bt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function yt(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),x(19,"th",18),o())}function wt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),x(21,"p-chip",21),o(),l(22,"td"),x(23,"p-chip",21),o(),l(24,"td"),x(25,"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/Customer_Invoice/Info?ID="+e.id,U),a(),N(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),N(" ",e.customer," "),a(2),C(V(13,14,e.date,"d MMM y hh:mm")),a(3),C(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),C(M(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function It(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Et(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Tt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,yt,20,0,"ng-template",null,3,b)(4,wt,26,22,"ng-template",null,4,b)(6,It,1,3,"ng-template",null,5,b)(8,Et,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 Ft(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(),N(" ",V(2,2,e.name,30)," ")}}function Vt(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 Dt(t,p){if(t&1&&(l(0,"div"),g(1,Vt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}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 Nt(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("to"))}}function Jt(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 Rt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Bt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Ft,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Dt,2,1,"div",32),x(21,"p-datepicker",33),g(22,Nt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Customer"),o(),l(26,"p-autocomplete",34),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(27,"div",25)(28,"label",26),m(29,"Page Size"),o(),x(30,"input",35),g(31,Rt,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",F(17,$e,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,$e,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,$e,e.isInvalid("pageSize")))("autoNumeric",$(23,Ct)),a(),s("ngIf",e.isInvalid("pageSize"))}}var ft=(()=>{class t extends Me{constructor(){super(...arguments),this.store=v(qe),this.dayjsService=v(J),this.generateJournalService=v(D),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.customerSuggestions=k([]),this.fb=v(se)}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:je,pageNumber:Oe,pageSize:Ge,export:Le,exportPageNumber:We,exportPageSize:Ke}=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(je),pageNumber:this.fb.control(Oe),pageSize:this.fb.control(Ge,[oe.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(We),exportPageSize:this.fb.control(Ke)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Be("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]=nt);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=et(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[q([qe]),H],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"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[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",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,vt,1,1,"ng-template",null,0,b)(3,Tt,10,5,"ng-template",null,1,b)(5,Bt,32,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:[Ee,Re,ke,Ne,Je,te,Q,X,Y,ee,Z,Pe,Ue,he,ge,_e,fe,De,Ve,Fe,Te,ue,de,He,Ae,ce,ae,ne,re,le,pe,me,we,ye,Ie,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Pt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4},skipRequestFirst:!0},Qe=Se(it("JournalSupplierBillStore"),ve(Pt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(J);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(R(B(()=>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(R(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(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)}})))))}}),Ce(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Xe=t=>({"ng-invalid ng-dirty":t}),Mt=()=>({});function zt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function jt(t,p){if(t&1&&g(0,zt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Ot(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),x(19,"th",18),o())}function Gt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(20,"p-chip",21),o(),l(21,"td"),x(22,"p-chip",21),o(),l(23,"td"),x(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(),N(" ",e.number," "),a(2),C(e.customer),a(2),C(V(12,13,e.date,"d MMM y hh:mm")),a(3),C(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),C(M(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 Ut(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function At(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Ht(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Ot,20,0,"ng-template",null,3,b)(4,Gt,25,21,"ng-template",null,4,b)(6,Ut,1,3,"ng-template",null,5,b)(8,At,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 Lt(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(),N(" ",V(2,2,e.name,30)," ")}}function Wt(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 Kt(t,p){if(t&1&&(l(0,"div"),g(1,Wt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function qt(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 $t(t,p){if(t&1&&(l(0,"div"),g(1,qt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Qt(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 Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Yt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Lt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Kt,2,1,"div",32),x(21,"p-datepicker",33),g(22,$t,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){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(28,"div",25)(29,"label",26),m(30,"Page Size"),o(),x(31,"input",35),g(32,Xt,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",F(19,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",M(27,17,e.supplierSuggestions$)),a(5),s("autoNumeric",$(23,Mt))("ngClass",F(24,Xe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Qe),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(se),this.dayjsService=v(J)}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(Be("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:u,supplierID:je,pageNumber:Oe,pageSize:Ge,export:Le,exportPageNumber:We,exportPageSize:Ke}=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(je),pageNumber:this.fb.control(Oe),pageSize:this.fb.control(Ge,[oe.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(We),exportPageSize:this.fb.control(Ke)})}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=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([Qe]),H],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 Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[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","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,jt,1,1,"ng-template",null,0,b)(3,Ht,10,5,"ng-template",null,1,b)(5,Yt,33,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Re,ke,Ne,Je,te,Q,X,Y,tt,ee,Z,Pe,Ue,he,ge,_e,fe,De,Ve,Fe,Te,He,Ae,ce,ae,ne,re,le,pe,me,ue,de,Ie,we,ye,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt={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}},Ye=Se(ve(Zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(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(R(B(()=>p.getGJShiftLoader().pipe(j(e=>y(t,r=>d(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(R(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(j(r=>y(t,n=>d(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),Ce(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var Ze=t=>({"ng-invalid ng-dirty":t}),ei=()=>({});function ti(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ii(t,p){if(t&1&&g(0,ti,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function ni(t,p){t&1&&(l(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),x(21,"th",18),o())}function oi(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(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(),N(" ",e.number," "),a(2),C(V(8,14,e.open,"dd MMM y hh:mm")),a(3),C(V(11,17,e.close,"dd MMM y hh:mm")),a(3),C(e.cashier),a(2),C(M(16,20,e.salesNTax)),a(3),C(M(19,22,e.totalInvoice)),a(3),C(e.outlet),a(2),C(e.register),a(2),C(M(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 ri(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function li(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ai(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,ni,22,0,"ng-template",null,3,b)(4,oi,29,26,"ng-template",null,4,b)(6,ri,1,3,"ng-template",null,5,b)(8,li,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 pi(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(),N(" ",V(2,2,e.name,30)," ")}}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("from"))}}function ci(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 di(t,p){if(t&1&&(l(0,"div"),g(1,ci,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ui(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 fi(t,p){if(t&1&&(l(0,"div"),g(1,ui,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function _i(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,pi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),x(11,"p-datepicker",28),g(12,si,2,1,"div",29),x(13,"p-datepicker",30),g(14,di,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),x(18,"input",31),g(19,fi,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",F(14,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",$(18,ei))("ngClass",F(19,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ie),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(se),this.dayjsService=v(J)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,pageSize:u,export:je,exportPageNumber:Oe,exportPageSize:Ge}=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,[oe.required]),export:this.fb.control(je),exportPageNumber:this.fb.control(Oe),exportPageSize:this.fb.control(Ge)})}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=A({type:t,selectors:[["app-journal-shift"]],features:[q([Ye]),H],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 Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return h(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,ii,1,1,"ng-template",null,0,b)(3,ai,10,5,"ng-template",null,1,b)(5,_i,20,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Re,ke,Ne,Je,te,Q,X,Y,ee,Z,Pe,he,ge,_e,fe,ce,ae,ne,re,le,pe,me,De,Ve,Fe,Te,Ie,we,ye,ue,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var So=[{path:"invoice",component:ft},{path:"supplier-bill",component:_t},{path:"shift",component:gt},{path:"join-invoice",loadComponent:()=>import("./chunk-P63CD72K.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-BTVPGIVW.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-OVHHHUDY.js").then(t=>t.AdjustmentJournalComponent)}];export{So as generateJournalRoutes};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import{a as ie,b as yt}from"./chunk-A2PK5UDL.js";import{f as Ct}from"./chunk-XD7VHCRC.js";import"./chunk-NCDT6JPP.js";import{a as xt}from"./chunk-G4XX7EU2.js";import{a as bt}from"./chunk-XKI7WLHE.js";import{a as wt}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as rt}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as ee,b as te}from"./chunk-3A4BFUGD.js";import{d as _t,i as ft,j as ht,k as gt}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import{a as dt,b as ut}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as mt}from"./chunk-Y7P7BGVH.js";import{a as We}from"./chunk-VGNJD35F.js";import{a as it,b as nt}from"./chunk-2XUSZCQL.js";import{a as E,b as ot,c as at,d as st,e as lt,f as pt,g as ct}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{a as Je,f as O,k as Ke,m as Xe,o as Ye,s as et,w as Y,x as tt}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{A as ze,C as je,K as qe,La as $e,Ma as X,Ua as Ze,c as K,e as Ae,f as Oe,l as Be,ma as Ge,o as Ne,u as He,x as Qe,z as fe}from"./chunk-OIBDX2CA.js";import{b as Pe,d as Le,e as Re}from"./chunk-AOOG6YOT.js";import"./chunk-4TTCPL3N.js";import"./chunk-2MKKFLNJ.js";import{h as Z,k as J,m as Ve,s as W}from"./chunk-VZ5CMS5O.js";import{c as Me,d as ce,f as me,h as de,i as ue,k as _e}from"./chunk-F2X3VGZZ.js";import{$b as k,$c as Fe,Aa as H,Bb as z,Cc as $,Db as u,Ec as S,Fc as De,Ha as L,Jc as Ee,Kb as F,Lb as p,Ob as Ce,Pb as ae,Qb as j,Rb as R,Rc as x,Tb as M,Ub as A,Vb as l,Wb as s,Xb as y,Y as N,Yb as ye,Zb as ve,_ as re,_b as U,_c as D,bd as P,c as B,ca as we,cd as Ue,da as be,ec as b,fc as c,gc as Te,hb as a,hc as ke,ia as C,kc as V,lc as q,mc as v,nc as T,qa as _,qc as Ie,ra as f,rc as d,sc as I,tc as G,ua as oe,vc as Se,wc as se,xb as Q,xc as le,yb as xe,yc as pe}from"./chunk-NMCKMUY4.js";import{a as h,b as g}from"./chunk-YQFG5XE2.js";var kt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1,listJournalTagID:[]},options:{users:[],groups:[],accessTypes:[],journalTags:[]}}},he=ot(ct("UserStore"),pt(kt),at(t=>({first:P(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:P(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:P(()=>t.data().some(o=>o.checked)),checkedData:P(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:P(()=>t.data().find(o=>o.checked)?.userID||null)})),lt(t=>{let o=C(ie);return{setFilter(n){E(t,i=>g(h({},i),{filter:n}))},onRowSelect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!0}):m);return g(h({},i),{data:r})})},onRowUnselect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!1}):m);return g(h({},i),{data:r})})},onHeaderCheckboxToggle(n){let i=localStorage.getItem("AUTH_USERNAME");E(t,r=>{let m=r.data.map(w=>w.userName!==i?g(h({},w),{checked:n}):g(h({},w),{checked:!1}));return g(h({},r),{data:m})})},getUserLoader:ee(B(N(()=>o.getUserLoaderList().pipe(te({next:n=>{E(t,i=>g(h({},i),{meta:n}))},error:n=>{console.error("Failed to fetch user loader list:",n)}}))))),getUserFormMeta:ee(B(N(n=>o.getUserFormMeta(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{metaForm:i}))},error:i=>{console.error("Failed to fetch user form meta:",i)}}))))),getUsers:ee(B(N(n=>o.getUsers(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{data:i.data.map(m=>g(h({},m),{checked:!1})),count:i.count}))},error:i=>{console.error("Failed to fetch users:",i)}})))))}}),st({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Dt=["header"],Et=["footer"],Ft=["content"],Ut=["closeicon"],Vt=["headless"],Pt=["maskRef"],Lt=["container"],Rt=["closeButton"],Mt=["*"],At=(t,o,e,n,i,r)=>({"p-drawer":!0,"p-drawer-active":t,"p-drawer-left":o,"p-drawer-right":e,"p-drawer-top":n,"p-drawer-bottom":i,"p-drawer-full":r}),Ot=(t,o)=>({transform:t,transition:o}),Bt=t=>({value:"visible",params:t});function Nt(t,o){t&1&&U(0)}function Ht(t,o){if(t&1&&u(0,Nt,1,0,"ng-container",4),t&2){let e=c(2);p("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)}}function Qt(t,o){t&1&&U(0)}function zt(t,o){if(t&1&&(l(0,"div"),d(1),s()),t&2){let e=c(3);ae(e.cx("title")),a(),I(e.header)}}function jt(t,o){t&1&&y(0,"TimesIcon"),t&2&&F("data-pc-section","closeicon")}function qt(t,o){}function Gt(t,o){t&1&&u(0,qt,0,0,"ng-template")}function $t(t,o){if(t&1&&u(0,jt,1,1,"TimesIcon",8)(1,Gt,1,0,null,4),t&2){let e=c(4);p("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),p("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Zt(t,o){if(t&1){let e=k();l(0,"p-button",9),b("onClick",function(i){_(e);let r=c(3);return f(r.close(i))})("keydown.enter",function(i){_(e);let r=c(3);return f(r.close(i))}),u(1,$t,2,2,"ng-template",null,1,x),s()}if(t&2){let e=c(3);p("ngClass",e.cx("closeButton"))("buttonProps",e.closeButtonProps)("ariaLabel",e.ariaCloseLabel),F("data-pc-section","closebutton")("data-pc-group-section","iconcontainer")}}function Jt(t,o){t&1&&U(0)}function Wt(t,o){t&1&&U(0)}function Kt(t,o){if(t&1&&(ye(0),l(1,"div",5),u(2,Wt,1,0,"ng-container",4),s(),ve()),t&2){let e=c(3);a(),p("ngClass",e.cx("footer")),F("data-pc-section","footer"),a(),p("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Xt(t,o){if(t&1&&(l(0,"div",5),u(1,Qt,1,0,"ng-container",4)(2,zt,2,3,"div",6)(3,Zt,3,5,"p-button",7),s(),l(4,"div",5),ke(5),u(6,Jt,1,0,"ng-container",4),s(),u(7,Kt,3,3,"ng-container",8)),t&2){let e=c(2);p("ngClass",e.cx("header")),F("data-pc-section","header"),a(),p("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),a(),p("ngIf",e.header),a(),p("ngIf",e.showCloseIcon&&e.closable),a(),p("ngClass",e.cx("content")),F("data-pc-section","content"),a(2),p("ngTemplateOutlet",e.contentTemplate||e._contentTemplate),a(),p("ngIf",e.footerTemplate||e._footerTemplate)}}function Yt(t,o){if(t&1){let e=k();l(0,"div",3,0),b("@panelState.start",function(i){_(e);let r=c();return f(r.onAnimationStart(i))})("@panelState.done",function(i){_(e);let r=c();return f(r.onAnimationEnd(i))})("keydown",function(i){_(e);let r=c();return f(r.onKeyDown(i))}),u(2,Ht,1,1,"ng-container")(3,Xt,8,9),s()}if(t&2){let e=c();Ce(e.style),ae(e.styleClass),p("ngClass",Ee(9,At,e.visible,e.position==="left"&&!e.fullScreen,e.position==="right"&&!e.fullScreen,e.position==="top"&&!e.fullScreen,e.position==="bottom"&&!e.fullScreen,e.fullScreen||e.position==="full"))("@panelState",S(19,Bt,De(16,Ot,e.transformOptions,e.transitionOptions))),F("data-pc-name","sidebar")("data-pc-section","root"),a(2),j(e.headlessTemplate||e._headlessTemplate?2:3)}}var ei=({dt:t})=>`
|
|
2
|
+
.p-drawer {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
pointer-events: auto;
|
|
6
|
+
transform: translate3d(0px, 0px, 0px);
|
|
7
|
+
position: fixed;
|
|
8
|
+
transition: transform 0.3s;
|
|
9
|
+
background: ${t("drawer.background")};
|
|
10
|
+
color: ${t("drawer.color")};
|
|
11
|
+
border: 1px solid ${t("drawer.border.color")};
|
|
12
|
+
box-shadow: ${t("drawer.shadow")};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.p-drawer-content {
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
padding: ${t("drawer.content.padding")};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.p-drawer-header {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
padding: ${t("drawer.header.padding")};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.p-drawer-footer {
|
|
30
|
+
padding: ${t("drawer.header.padding")};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.p-drawer-title {
|
|
34
|
+
font-weight: ${t("drawer.title.font.weight")};
|
|
35
|
+
font-size: ${t("drawer.title.font.size")};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.p-drawer-full .p-drawer {
|
|
39
|
+
transition: none;
|
|
40
|
+
transform: none;
|
|
41
|
+
width: 100vw !important;
|
|
42
|
+
height: 100vh !important;
|
|
43
|
+
max-height: 100%;
|
|
44
|
+
top: 0px !important;
|
|
45
|
+
left: 0px !important;
|
|
46
|
+
border-width: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.p-drawer-left .p-drawer {
|
|
50
|
+
align-self: start;
|
|
51
|
+
width: 20rem;
|
|
52
|
+
height: 100%;
|
|
53
|
+
border-right-width: 1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.p-drawer-right .p-drawer {
|
|
57
|
+
align-self: end;
|
|
58
|
+
width: 20rem;
|
|
59
|
+
height: 100%;
|
|
60
|
+
border-left-width: 1px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.p-drawer-top .p-drawer {
|
|
64
|
+
height: 10rem;
|
|
65
|
+
width: 100%;
|
|
66
|
+
border-bottom-width: 1px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.p-drawer-bottom .p-drawer {
|
|
70
|
+
height: 10rem;
|
|
71
|
+
width: 100%;
|
|
72
|
+
border-top-width: 1px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.p-drawer-left .p-drawer-content,
|
|
76
|
+
.p-drawer-right .p-drawer-content,
|
|
77
|
+
.p-drawer-top .p-drawer-content,
|
|
78
|
+
.p-drawer-bottom .p-drawer-content {
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.p-drawer-open {
|
|
84
|
+
display: flex;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.p-drawer-top {
|
|
88
|
+
justify-content: flex-start;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.p-drawer-bottom {
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.p-drawer {
|
|
96
|
+
position: fixed;
|
|
97
|
+
transition: transform 0.3s;
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.p-drawer-content {
|
|
103
|
+
position: relative;
|
|
104
|
+
overflow-y: auto;
|
|
105
|
+
flex-grow: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.p-drawer-header {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.p-drawer-footer {
|
|
114
|
+
margin-top: auto;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.p-drawer-icon {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
margin-left: auto;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.p-drawer-left {
|
|
125
|
+
top: 0;
|
|
126
|
+
left: 0;
|
|
127
|
+
width: 20rem;
|
|
128
|
+
height: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.p-drawer-right {
|
|
132
|
+
top: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
width: 20rem;
|
|
135
|
+
height: 100%;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.p-drawer-top {
|
|
139
|
+
top: 0;
|
|
140
|
+
left: 0;
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 10rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.p-drawer-bottom {
|
|
146
|
+
bottom: 0;
|
|
147
|
+
left: 0;
|
|
148
|
+
width: 100%;
|
|
149
|
+
height: 10rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.p-drawer-full {
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
top: 0;
|
|
156
|
+
left: 0;
|
|
157
|
+
-webkit-transition: none;
|
|
158
|
+
transition: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.p-drawer-mask {
|
|
162
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
163
|
+
transition-duration: 0.2s;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.p-overlay-mask {
|
|
167
|
+
position: fixed;
|
|
168
|
+
top: 0;
|
|
169
|
+
left: 0;
|
|
170
|
+
width: 100%;
|
|
171
|
+
height: 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.p-overlay-mask:dir(rtl) {
|
|
175
|
+
flex-direction: row-reverse;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.p-overlay-mask-enter {
|
|
179
|
+
animation: p-overlay-mask-enter-animation 150ms forwards;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.p-overlay-mask-leave {
|
|
183
|
+
animation: p-overlay-mask-leave-animation 150ms forwards;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@keyframes p-overlay-mask-enter-animation {
|
|
187
|
+
from {
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
}
|
|
190
|
+
to {
|
|
191
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
@keyframes p-overlay-mask-leave-animation {
|
|
195
|
+
from {
|
|
196
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
197
|
+
}
|
|
198
|
+
to {
|
|
199
|
+
background-color: transparent;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
`,ti={mask:({instance:t})=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",flexDirection:"column",alignItems:t.position==="top"?"flex-start":t.position==="bottom"?"flex-end":"center"})},ii={mask:({instance:t})=>({"p-drawer-mask":!0,"p-overlay-mask p-overlay-mask-enter":t.modal,"p-drawer-open":t.containerVisible,"p-drawer-full":t.fullScreen,[`p-drawer-${t.position}`]:!!t.position}),root:({instance:t})=>({"p-drawer p-component":!0,"p-drawer-full":t.fullScreen}),header:"p-drawer-header",title:"p-drawer-title",pcCloseButton:"p-drawer-close-button",content:"p-drawer-content",footer:"p-drawer-footer"},vt=(()=>{class t extends Ze{name="drawer";theme=ei;classes=ii;inlineStyles=ti;static \u0275fac=(()=>{let e;return function(i){return(e||(e=oe(t)))(i||t)}})();static \u0275prov=we({token:t,factory:t.\u0275fac})}return t})();var ni=ue([me({transform:"{{transform}}",opacity:0}),ce("{{transition}}")]),ri=ue([ce("{{transition}}",me({transform:"{{transform}}",opacity:0}))]),ge=(()=>{class t extends Je{appendTo="body";blockScroll=!1;style;styleClass;ariaCloseLabel;autoZIndex=!0;baseZIndex=0;modal=!0;closeButtonProps={severity:"secondary",text:!0,rounded:!0};dismissible=!0;showCloseIcon=!0;closeOnEscape=!0;transitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";get visible(){return this._visible}set visible(e){this._visible=e}get position(){return this._position}set position(e){if(this._position=e,e==="full"){this.transformOptions="none";return}switch(e){case"left":this.transformOptions="translate3d(-100%, 0px, 0px)";break;case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)";break}}get fullScreen(){return this._fullScreen}set fullScreen(e){this._fullScreen=e,e&&(this.transformOptions="none")}header;maskStyle;closable=!0;onShow=new H;onHide=new H;visibleChange=new H;maskRef;containerViewChild;closeButtonViewChild;initialized;_visible;_position="left";_fullScreen=!1;container;transformOptions="translate3d(-100%, 0px, 0px)";mask;maskClickListener;documentEscapeListener;animationEndListener;_componentStyle=C(vt);ngAfterViewInit(){super.ngAfterViewInit(),this.initialized=!0}headerTemplate;footerTemplate;contentTemplate;closeIconTemplate;headlessTemplate;_headerTemplate;_footerTemplate;_contentTemplate;_closeIconTemplate;_headlessTemplate;templates;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"content":this._contentTemplate=e.template;break;case"header":this._headerTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"closeicon":this._closeIconTemplate=e.template;break;case"headless":this._headlessTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}onKeyDown(e){e.code==="Escape"&&this.hide(!1)}show(){this.container.setAttribute(this.attrSelector,""),this.autoZIndex&&O.set("modal",this.container,this.baseZIndex||this.config.zIndex.modal),this.modal&&this.enableModality(),this.onShow.emit({}),this.visibleChange.emit(!0)}hide(e=!0){e&&this.onHide.emit({}),this.modal&&this.disableModality()}close(e){this.hide(),this.visibleChange.emit(!1),e.preventDefault()}enableModality(){let e=this.document.querySelectorAll(".p-drawer-active"),n=e.length,i=n==1?String(parseInt(this.container.style.zIndex)-1):String(parseInt(e[n-1].style.zIndex)-1);this.mask||(this.mask=this.renderer.createElement("div"),this.renderer.setStyle(this.mask,"zIndex",i),Ge(this.mask,"style",this.maskStyle),fe(this.mask,"p-overlay-mask p-drawer-mask p-overlay-mask-enter"),this.dismissible&&(this.maskClickListener=this.renderer.listen(this.mask,"click",r=>{this.dismissible&&this.close(r)})),this.renderer.appendChild(this.document.body,this.mask),this.blockScroll&&ze())}disableModality(){this.mask&&(fe(this.mask,"p-overlay-mask-leave"),this.animationEndListener=this.renderer.listen(this.mask,"animationend",this.destroyModal.bind(this)))}destroyModal(){this.unbindMaskClickListener(),this.mask&&this.renderer.removeChild(this.document.body,this.mask),this.blockScroll&&je(),this.unbindAnimationEndListener(),this.mask=null}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.appendContainer(),this.show(),this.closeOnEscape&&this.bindDocumentEscapeListener();break}}onAnimationEnd(e){switch(e.toState){case"void":this.hide(!1),O.clear(this.container),this.unbindGlobalListeners();break}}appendContainer(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.container):qe(this.appendTo,this.container))}bindDocumentEscapeListener(){let e=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentEscapeListener=this.renderer.listen(e,"keydown",n=>{n.which==27&&parseInt(this.container.style.zIndex)===O.get(this.container)&&this.close(n)})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}unbindGlobalListeners(){this.unbindMaskClickListener(),this.unbindDocumentEscapeListener()}unbindAnimationEndListener(){this.animationEndListener&&this.mask&&(this.animationEndListener(),this.animationEndListener=null)}ngOnDestroy(){this.initialized=!1,this.visible&&this.modal&&this.destroyModal(),this.appendTo&&this.container&&this.renderer.appendChild(this.el.nativeElement,this.container),this.container&&this.autoZIndex&&O.clear(this.container),this.container=null,this.unbindGlobalListeners(),this.unbindAnimationEndListener()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=oe(t)))(i||t)}})();static \u0275cmp=Q({type:t,selectors:[["p-drawer"]],contentQueries:function(n,i,r){if(n&1&&(V(r,Dt,4),V(r,Et,4),V(r,Ft,4),V(r,Ut,4),V(r,Vt,4),V(r,$e,4)),n&2){let m;v(m=T())&&(i.headerTemplate=m.first),v(m=T())&&(i.footerTemplate=m.first),v(m=T())&&(i.contentTemplate=m.first),v(m=T())&&(i.closeIconTemplate=m.first),v(m=T())&&(i.headlessTemplate=m.first),v(m=T())&&(i.templates=m)}},viewQuery:function(n,i){if(n&1&&(q(Pt,5),q(Lt,5),q(Rt,5)),n&2){let r;v(r=T())&&(i.maskRef=r.first),v(r=T())&&(i.containerViewChild=r.first),v(r=T())&&(i.closeButtonViewChild=r.first)}},inputs:{appendTo:"appendTo",blockScroll:[2,"blockScroll","blockScroll",D],style:"style",styleClass:"styleClass",ariaCloseLabel:"ariaCloseLabel",autoZIndex:[2,"autoZIndex","autoZIndex",D],baseZIndex:[2,"baseZIndex","baseZIndex",Fe],modal:[2,"modal","modal",D],closeButtonProps:"closeButtonProps",dismissible:[2,"dismissible","dismissible",D],showCloseIcon:[2,"showCloseIcon","showCloseIcon",D],closeOnEscape:[2,"closeOnEscape","closeOnEscape",D],transitionOptions:"transitionOptions",visible:"visible",position:"position",fullScreen:"fullScreen",header:"header",maskStyle:"maskStyle",closable:[2,"closable","closable",D]},outputs:{onShow:"onShow",onHide:"onHide",visibleChange:"visibleChange"},features:[$([vt]),z],ngContentSelectors:Mt,decls:1,vars:1,consts:[["container",""],["icon",""],["role","complementary",3,"ngClass","style","class","keydown",4,"ngIf"],["role","complementary",3,"keydown","ngClass"],[4,"ngTemplateOutlet"],[3,"ngClass"],[3,"class",4,"ngIf"],[3,"ngClass","buttonProps","ariaLabel","onClick","keydown.enter",4,"ngIf"],[4,"ngIf"],[3,"onClick","keydown.enter","ngClass","buttonProps","ariaLabel"]],template:function(n,i){n&1&&(Te(),u(0,Yt,4,21,"div",2)),n&2&&p("ngIf",i.visible)},dependencies:[W,Z,J,Ve,Y,We,X],encapsulation:2,data:{animation:[Me("panelState",[de("void => visible",[_e(ni)]),de("visible => void",[_e(ri)])])]},changeDetection:0})}return t})(),Tt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=xe({type:t});static \u0275inj=be({imports:[ge,X,X]})}return t})();var ai=["class","page"],ne=t=>({"ng-invalid ng-dirty":t}),si=t=>({groupID:t});function li(t,o){if(t&1){let e=k();l(0,"p-button",23),b("onClick",function(){_(e);let i=c(2);return f(i.onDeleteUser())}),s()}}function pi(t,o){if(t&1){let e=k();l(0,"p-button",24),b("onClick",function(){_(e);let i=c(2);return f(i.onHandleDrawer())}),s()}}function ci(t,o){if(t&1&&(l(0,"div",20),u(1,li,1,0,"p-button",21)(2,pi,1,0,"p-button",22),s()),t&2){let e=c();a(),p("ngIf",e.store.hasCheckedRows()),a(),p("ngIf",e.roleService.user().create)}}function mi(t,o){t&1&&(l(0,"th",28),y(1,"p-tableHeaderCheckbox"),s())}function di(t,o){if(t&1&&(l(0,"tr"),u(1,mi,2,0,"th",27),l(2,"th"),d(3,"LoginID"),s(),l(4,"th"),d(5,"Group"),s(),l(6,"th"),d(7,"Access Type"),s(),l(8,"th"),d(9,"Tags"),s()()),t&2){let e=c(2);a(),p("ngIf",e.roleService.user().delete)}}function ui(t,o){t&1&&U(0)}function _i(t,o){if(t&1&&y(0,"p-tableCheckbox",34),t&2){let e=c(3).$implicit;p("value",e)}}function fi(t,o){if(t&1&&u(0,_i,1,1,"p-tableCheckbox",33),t&2){let e=c(4);p("ngIf",e.roleService.user().delete)}}function hi(t,o){if(t&1&&(l(0,"td"),u(1,ui,1,0,"ng-container",32)(2,fi,1,1,"ng-template",null,7,x),s()),t&2){let e=Ie(3),n=c().$implicit,i=c(2);a(),p("ngIf",i.roleService.user().delete&&n.userName===i.currentUser())("ngIfElse",e)}}function gi(t,o){t&1&&(l(0,"div"),d(1,"No Tags Assigned"),s())}function wi(t,o){if(t&1&&(l(0,"div"),d(1),s()),t&2){let e=c().$implicit;a(),G("",e.tagsCount," Tags Assigned")}}function bi(t,o){if(t&1){let e=k();l(0,"tr"),u(1,hi,4,2,"td",29),l(2,"td")(3,"button",30),b("click",function(){let i=_(e).$implicit,r=c(2);return f(r.onEditUser(i))}),d(4),s()(),l(5,"td")(6,"a",31),d(7),s()(),l(8,"td"),d(9),s(),l(10,"td"),u(11,gi,2,0,"div")(12,wi,2,1,"div"),s()()}if(t&2){let e=o.$implicit,n=c(2);a(),p("ngIf",n.roleService.user().delete),a(2),p("disabled",!n.roleService.user().edit),a(),G(" ",e.userName||e.userID," "),a(2),p("queryParams",S(7,si,e.groupID)),a(),I(e.groupName),a(2),G(" ",e.accessTypeName," "),a(2),j(e.tagsCount===0?11:12)}}function xi(t,o){if(t&1&&d(0),t&2){let e=c(2);Se(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function Ci(t,o){t&1&&(l(0,"tr")(1,"td",35)(2,"span"),d(3,"No users found. Try adjusting your filters or add a new user."),s()()())}function yi(t,o){if(t&1){let e=k();l(0,"p-panel")(1,"div",25),y(2,"app-user-tabs"),l(3,"p-table",26),b("onPage",function(i){_(e);let r=c();return f(r.onPageChange(i))})("onRowSelect",function(i){_(e);let r=c();return f(r.onRowSelect(i))})("onRowUnselect",function(i){_(e);let r=c();return f(r.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let r=c();return f(r.onHeaderCheckboxToggle(i))}),u(4,di,10,1,"ng-template",null,3,x)(6,bi,13,9,"ng-template",null,4,x)(8,xi,1,3,"ng-template",null,5,x)(10,Ci,4,0,"ng-template",null,6,x),s()()()}if(t&2){let e=c();a(3),p("value",e.store.data())("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.count())}}function vi(t,o){if(t&1&&(l(0,"div",36)(1,"div",18)(2,"div",37)(3,"label",38),d(4,"Group"),s(),y(5,"p-select",39),s()()()),t&2){let e=c();p("formGroup",e.forms.filterForm),a(5),p("showClear",!0)("options",e.store.meta().options.groups)}}function Ti(t,o){if(t&1&&(l(0,"span",40),d(1),s()),t&2){let e=c();a(),I(e.store.hasCheckedRows()?"Edit User":"Invite User")}}function ki(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),I(e)}}function Ii(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),I(e)}}function Si(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),I(e)}}function Di(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),I(e)}}var Rn=(()=>{class t extends bt{ngOnInit(){this.generateForm()}constructor(){Ue(()=>{this.store.metaForm()&&this.generateForm()}),super(),this.store=C(he),this.fb=C(He),this.userService=C(ie),this.isLoading=L(!1),this.form=null,this.isDrawerOpen=L(!1),this.router=C(Le),this.route=C(Pe),this.isDialogFilterVisible=L(!1),this.roleService=C(rt),this.currentUser=L(null),this.tabs=[{route:"/pages/users/users",label:"Users"},{route:"/pages/users/groups",label:"Groups"}]}ngAfterViewInit(){this.currentUser.set(localStorage.getItem("AUTH_USERNAME")||null)}onPageChange(e){this.store.setFilter(g(h({},this.store.filter()),{pagination:e.first/e.rows+1}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}generateForm(){this.forms={filterForm:this.fb.group({pagination:this.fb.control(1),pageSize:this.fb.control(10),groupID:this.fb.control(null)}),userForm:this.fb.group({id:this.fb.control({value:this.store.metaForm().form.id,disabled:this.store.metaForm().form.id!==xt},[K.required]),groupID:this.fb.control(this.store.metaForm().form.groupID,[K.required]),accessTypeID:this.fb.control(this.store.metaForm().form.accessTypeID,[K.required]),listJournalTagID:this.fb.control(this.store.metaForm().form.listJournalTagID??[])})}}onHandleDrawer(){this.isDrawerOpen.update(e=>!e),this.store.getUserFormMeta(this.route.snapshot.params.id||null)}onInviteUser(){let{userForm:e}=this.forms;if(e.invalid){e.markAllAsTouched();return}let n=e.getRawValue(),i;if(this.store.hasCheckedRows()){let[r]=this.store.checkedData();i={id:r,groupID:n.groupID,accessTypeID:n.accessTypeID,listJournalTagID:n.listJournalTagID}}else i=n;this.userService.inviteUser(i).pipe(re(()=>{this.onHandleDrawer(),this.store.setFilter(h({},this.store.filter())),e.reset()})).subscribe()}onSearch(e){this.store.setFilter(g(h({},this.store.filter()),{text:e,pagination:1}))}onOKFilter(){if(this.forms.filterForm.invalid){this.forms.filterForm.markAllAsTouched();return}let{groupID:e}=this.forms.filterForm.value;this.store.setFilter(g(h({},this.store.filter()),{groupID:e})),this.isDialogFilterVisible.update(n=>!n)}onEditUser(e){this.store.onRowSelect(e),this.store.getUserFormMeta(this.store.selectedID()),this.isDrawerOpen.update(n=>!n)}onHideDrawer(){this.store.onHeaderCheckboxToggle(!1)}onDeleteUser(){let e=this.store.checkedData();this.userService.deleteUser(e).pipe(re(()=>{this.store.setFilter(h({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=Q({type:t,selectors:[["app-user",8,"page"]],features:[$([he]),z],attrs:ai,decls:41,vars:23,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["showCheckbox",""],["pageTitle","User List",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],["position","right",3,"visibleChange","onHide","visible"],[1,"row","py-3","row-gap-3",3,"formGroup"],[1,"col-12"],["for","",1,"m-0"],["fluid","","filter","","filterBy","name","formControlName","id","optionLabel","loginID","optionValue","id","placeholder","Select a User",3,"disabled","options","ngClass"],[1,"text-danger"],["filter","","filterBy","name","formControlName","groupID","optionLabel","name","optionValue","id","placeholder","Select a Group","fluid","",3,"options","ngClass"],["filter","","filterBy","name","formControlName","accessTypeID","optionLabel","value","optionValue","key","placeholder","Select Access Type","fluid","",3,"options","ngClass"],["fluid","","filter","","filterBy","name","formControlName","listJournalTagID","optionLabel","name","optionValue","id","placeholder","Select a Tag",3,"options","ngClass"],[1,"col"],["label","Submit",3,"onClick"],[1,"d-flex","gap-2","flex-wrap"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["label","Invite",3,"onClick",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["label","Invite",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],["dataKey","userID",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],["style","width: 4rem",4,"ngIf"],[2,"width","4rem"],[4,"ngIf"],[1,"btn","btn-link","fw-light","text-primary","p-0",2,"text-decoration","none",3,"click","disabled"],["routerLink","/pages/users/groups/forms",1,"link","link-primary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"value",4,"ngIf"],[3,"value"],["colspan","3"],[1,"row",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["appendTo","body","formControlName","groupID","optionValue","id","optionLabel","name","placeholder","Select a Group",3,"showClear","options"],[1,"fs-5"]],template:function(n,i){if(n&1){let r=k();l(0,"app-main-panel",8),b("search",function(w){return _(r),f(i.onSearch(w))}),pe("isDialogFilterVisibleChange",function(w){return _(r),le(i.isDialogFilterVisible,w)||(i.isDialogFilterVisible=w),f(w)}),b("filterConfirmed",function(){return _(r),f(i.onOKFilter())}),u(1,ci,3,2,"ng-template",null,0,x)(3,yi,12,5,"ng-template",null,1,x)(5,vi,6,3,"ng-template",null,2,x),s(),l(7,"p-drawer",9),pe("visibleChange",function(w){return _(r),le(i.isDrawerOpen,w)||(i.isDrawerOpen=w),f(w)}),b("onHide",function(){return _(r),f(i.onHideDrawer())}),u(8,Ti,2,1,"ng-template",null,3,x),l(10,"div",10)(11,"div",11)(12,"div")(13,"label",12),d(14,"Users"),s(),y(15,"p-select",13),M(16,ki,2,1,"small",14,R),s()(),l(18,"div",11)(19,"div")(20,"label",12),d(21,"Groups"),s(),y(22,"p-select",15),M(23,Ii,2,1,"small",14,R),s()(),l(25,"div",11)(26,"div")(27,"label",12),d(28,"Access Type"),s(),y(29,"p-select",16),M(30,Si,2,1,"small",14,R),s()(),l(32,"div",11)(33,"div")(34,"label",12),d(35,"Tags"),s(),y(36,"p-multiSelect",17),M(37,Di,2,1,"small",14,R),s()(),l(39,"div",18)(40,"p-button",19),b("onClick",function(){return _(r),f(i.onInviteUser())}),s()()()()}n&2&&(p("isSearchableInput",!0)("isFilterable",!0),se("isDialogFilterVisible",i.isDialogFilterVisible),p("scrollable",!0),a(7),se("visible",i.isDrawerOpen),a(3),p("formGroup",i.forms.userForm),a(5),p("disabled",i.store.hasCheckedRows())("options",i.store.metaForm().options.users)("ngClass",S(15,ne,i.isInvalid("id","userForm"))),a(),A(i.getErrors("id","userForm")),a(6),p("options",i.store.metaForm().options.groups)("ngClass",S(17,ne,i.isInvalid("groupID","userForm"))),a(),A(i.getErrors("id","userForm")),a(6),p("options",i.store.metaForm().options.accessTypes)("ngClass",S(19,ne,i.isInvalid("accessTypeID","userForm"))),a(),A(i.getErrors("accessTypeID","userForm")),a(6),p("options",i.store.metaForm().options.journalTags)("ngClass",S(21,ne,i.isInvalid("listJournalTagID","userForm"))),a(),A(i.getErrors("listJournalTagID","userForm")))},dependencies:[mt,W,Z,J,gt,_t,ft,ht,tt,Y,Tt,ge,Qe,Ae,Oe,Be,Ne,Ye,Ke,Xe,et,ut,dt,Ct,nt,it,yt,Re,wt],styles:['[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding:"1rem 1.125rem"!important} .p-panel .p-panel-header{display:none!important}'],changeDetection:0})}}return t})();export{Rn as UserPageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as E}from"./chunk-
|
|
1
|
+
import{b as E}from"./chunk-GNLE4WCA.js";import{b as w}from"./chunk-VJ3IBUVO.js";import{a as T,b as j}from"./chunk-KJ2WX3FC.js";import{b as P}from"./chunk-2XUSZCQL.js";import{x as b}from"./chunk-H6HNANYB.js";import{a as y}from"./chunk-4TTCPL3N.js";import{q as O,s as A,z as _}from"./chunk-VZ5CMS5O.js";import{Db as C,Ea as c,Nc as M,Pc as S,Rc as a,Vb as i,Wb as r,Xb as x,ca as s,fc as m,hb as u,ia as g,rc as p,sc as v,tc as l,xb as h}from"./chunk-NMCKMUY4.js";var N=(()=>{class t{constructor(){this.httpService=g(y),this.dayjs=g(E)}migrateTaxAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/tax",{})}getManualJournalCount(){return this.httpService.get(void 0,"api/migrate/accounting/journalheader-count",{})}getCOACount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountcount",{})}getCOAConfigurationCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountConfigcount",{})}getCOACategoryCount(){return this.httpService.get(void 0,"api/migrate/accounting/chartOfAccountCategorycount",{})}getOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/outletaccount-count",{})}getPaymentMethodAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/paymentmethodaccountcount",{})}getWriteOffOutletAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/writeoffoutletaccountCount",{})}getTaxAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/taxcount",{})}getExpenseAccountCount(){return this.httpService.get(void 0,"api/migrate/accounting/expenseaccountcount",{})}migrateCoaAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccount",{})}migrateCoaConfig(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountConfig",{})}migrateCoaCategory(){return this.httpService.post(void 0,"api/Migrate/accounting/chartOfAccountCategory",{})}migrateOutletAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/outletaccount",{})}migrateManualJournal(e){let n={From:e.From?this.dayjs.from(e.From).format():null,To:e.To?this.dayjs.from(e.To).format():null,PageNumber:e.PageNumber||1,PageSize:e.PageSize||50},o=new _;return Object.keys(n).forEach(f=>{o=o.append(f,n[f])}),this.httpService.get(void 0,"api/migrate/accounting/journalheader",{params:o})}formatManualCOA(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa",{})}formatExpenseAccount(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-expenseaccount",{})}formatWriteOff(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-writeoff",{})}formatManualCOAConfig(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-coa-config",{})}formatOutletAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-outlet-account",{})}formatPaymentAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-paymentmethod",{})}formatTaxAccount(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-tax",{})}formatManualJournal(){return this.httpService.delete(void 0,"api/Migrate/accounting/truncate-journal",{})}formatManualCOACategory(){return this.httpService.delete(void 0,"api/migrate/accounting/truncate-coag",{})}migratePaymentMethod(){return this.httpService.post(void 0,"api/Migrate/accounting/paymentmethodaccount",{})}migrateWriteOffOutlet(){return this.httpService.post(void 0,"api/Migrate/accounting/writeoffoutletaccount",{})}migrateExpenseAccount(){return this.httpService.post(void 0,"api/Migrate/accounting/expenseaccount",{})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=s({token:t,factory:t.\u0275fac})}}return t})();function F(t,d){t&1&&(i(0,"div",5)(1,"div",6),x(2,"i",7),r()())}function I(t,d){if(t&1&&(i(0,"div",8),p(1),M(2,"number"),r()),t&2){let e=m();u(),l(" ",S(2,1,e.migrationCount(),"1.0-0")," ")}}function D(t,d){if(t&1&&(i(0,"div",9),p(1),r()),t&2){let e=m();u(),l(" ",e.migrationTitle()," ")}}function R(t,d){if(t&1&&(i(0,"div",10)(1,"div",11),p(2),r()()),t&2){let e=m();u(2),v(e.migrationPlace())}}var q=(()=>{class t{constructor(){this.migrationTitle=c(),this.migrationCount=c(),this.migrationPlace=c()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["app-migration-cards"]],inputs:{migrationTitle:[1,"migrationTitle"],migrationCount:[1,"migrationCount"],migrationPlace:[1,"migrationPlace"]},decls:9,vars:0,consts:[["header",""],["title",""],["subtitle",""],["footer",""],[1,"text-center","flex","flex-column","justify-content-center","align-items-center","card-shadow","responsive-card"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center","align-items-center","mt-4",2,"width","60px","height","60px","background-color","#e0f0ff","border-radius","50%"],[1,"icon","fa-file-lines","fa-light",2,"font-size","25px","color","#007bff"],[1,"bigscale","fw-bold"],[1,"text-sm","text-secondary"],[1,"flex","mt-5"],[1,"p-6","fs-7","fw-bold"]],template:function(n,o){n&1&&(i(0,"p-card",4),C(1,F,3,0,"ng-template",null,0,a)(3,I,3,4,"ng-template",null,1,a)(5,D,2,1,"ng-template",null,2,a)(7,R,3,1,"ng-template",null,3,a),r())},dependencies:[A,O,j,T,b,w,P],styles:["[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}[_nghost-%COMP%] .p-card{box-shadow:0 .25rem 1.25rem #0000001a!important;width:21.875rem!important;height:25rem!important}@media (max-width: 85rem){[_nghost-%COMP%] .p-card{width:18.875rem!important;height:21rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:2rem!important;margin-top:1rem!important}}@media (min-width: 85.001rem) and (max-width: 97.999rem){[_nghost-%COMP%] .p-card{width:21rem!important;height:25rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:3rem!important;margin-top:2rem!important}}@media (min-width: 98rem){[_nghost-%COMP%] .p-card{width:25rem!important;height:28rem!important}[_nghost-%COMP%] .p-card .p-card-title .bigscale{font-size:5rem!important;margin-top:2rem!important}}"]})}}return t})();export{N as a,q as b};
|