dealposbooks 5.32.3 → 5.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/scss/layouts/_sidebar.scss +1 -1
- package/assets/scss/style.scss +39 -6
- package/{chunk-LTU2XN7O.js → chunk-3CO4TF6P.js} +1 -1
- package/{chunk-UQS5OJFU.js → chunk-7GKCOHDX.js} +1 -1
- package/{chunk-QYJLXUNX.js → chunk-7M7NEFRU.js} +1 -1
- package/{chunk-ZI23MZE6.js → chunk-AWXT2WGR.js} +3 -3
- package/{chunk-IWCBGXO2.js → chunk-B3PT57AE.js} +1 -1
- package/{chunk-F46KQWAO.js → chunk-BPAXVUBR.js} +1 -1
- package/{chunk-TFIGD3CO.js → chunk-CI2PQN6B.js} +1 -1
- package/{chunk-76K2CYGK.js → chunk-F22SO6BQ.js} +1 -1
- package/{chunk-6ATDYFCA.js → chunk-FA5SZDUK.js} +1 -1
- package/{chunk-OFLZMVEN.js → chunk-FDTB3ERA.js} +1 -1
- package/{chunk-B753J6ZB.js → chunk-GJTECHST.js} +2 -2
- package/{chunk-NJZZBILL.js → chunk-GQWMJTTS.js} +1 -1
- package/{chunk-ZCUVD7AW.js → chunk-IBUJP2RH.js} +1 -1
- package/{chunk-MPFBVM6S.js → chunk-IQ6VG3YL.js} +1 -1
- package/chunk-J4Z57NEI.js +1 -0
- package/{chunk-XVE6KMPV.js → chunk-JL2CN3ZY.js} +1 -1
- package/{chunk-RK722ALH.js → chunk-JZM3B2LL.js} +1 -1
- package/{chunk-RE3DECQB.js → chunk-KPAVEB7H.js} +1 -1
- package/{chunk-DV5W2JUL.js → chunk-LMNTEWLI.js} +1 -1
- package/{chunk-6DDOOKHU.js → chunk-MNFWDRDS.js} +1 -1
- package/{chunk-UXABR4FY.js → chunk-NGY7QDWS.js} +1 -1
- package/{chunk-HPURXOG3.js → chunk-NKV2CQXX.js} +1 -1
- package/{chunk-H74NQYSU.js → chunk-O2ZSYZMM.js} +1 -1
- package/{chunk-6XPH2B7A.js → chunk-OD62LD7H.js} +2 -2
- package/{chunk-J2F5XODV.js → chunk-P37DL4A6.js} +1 -1
- package/{chunk-MDH73MG3.js → chunk-P7Z64VPC.js} +1 -1
- package/{chunk-GGBBHB6Z.js → chunk-PBN5IYNX.js} +1 -1
- package/{chunk-7SH5XZDT.js → chunk-PDFK6YU3.js} +1 -1
- package/{chunk-YLWKQB7B.js → chunk-PI5RBOCG.js} +1 -1
- package/chunk-PKLV4S5S.js +7 -0
- package/{chunk-X6CER3EN.js → chunk-QAQ2CXF3.js} +2 -2
- package/{chunk-RZ5RLIRX.js → chunk-QK4W3BGY.js} +1 -1
- package/{chunk-RUI3DTOX.js → chunk-R2SYW2WU.js} +1 -1
- package/{chunk-DLZ2BFC3.js → chunk-S5LYGYPM.js} +1 -1
- package/{chunk-CAXE6CPZ.js → chunk-SCNZ5AYG.js} +1 -1
- package/{chunk-IQVB5TK3.js → chunk-TYIRHEAK.js} +1 -1
- package/{chunk-ECHLZ4UT.js → chunk-U5M4TYR3.js} +1 -1
- package/{chunk-NOQ3MCWQ.js → chunk-VDDGE5HW.js} +1 -1
- package/{chunk-BU5IXVPY.js → chunk-XHUJABH3.js} +1 -1
- package/{chunk-V35EUCGI.js → chunk-ZXCNQW44.js} +1 -1
- package/index.html +2 -2
- package/main-2G5QRDWJ.js +1 -0
- package/package.json +1 -1
- package/{styles-TR7DEZTJ.css → styles-ERZ5377A.css} +1 -1
- package/chunk-EZOJ4EV5.js +0 -1
- package/chunk-QZSD3P6F.js +0 -7
- package/main-OSZVX4SI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-EXGI2AG7.js";import{a as rt}from"./chunk-G4XX7EU2.js";import{a as Le,b as We}from"./chunk-HHJMN4BS.js";import{a as ze}from"./chunk-MDH73MG3.js";import{b as N}from"./chunk-MPFBVM6S.js";import"./chunk-6ATDYFCA.js";import{a as ne}from"./chunk-AGLKA7OG.js";import{a as Ae,b as Pe}from"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as z,b as O}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Je,k as Be}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Me}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import{a as De,b as Re}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ee,h as Te}from"./chunk-ZI23MZE6.js";import{b as we,c as Ie}from"./chunk-C7LM5UCK.js";import{a as he,b as Se}from"./chunk-J4XRJAME.js";import{a as y,b as Ce,c as xe,d as be,e as ve,f as ye,g as ot}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as de,o as fe,w as _e,x as ge}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as oe,c as re,e as le,f as ae,k as pe,l as me,o as se,v as ce,y as ue}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as X,e as Y,f as Z,i as nt,k as ee,l as te,m as ie}from"./chunk-B63BKC6F.js";import{Ab as L,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as j,Lc as V,Mc as b,Nb as W,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as H,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as G,sc as k,ta as it,uc as K,vc as q,wb as A,wc as M,xc as $,yc as Q,zc as P}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var Ct={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Qe=Ce(ye(Ct),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:z(J(G(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(G(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Me("getCustomerInvoice"),O({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(J(B(()=>p.getJournalInvoiceLoader().pipe(O({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),be(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var vt=()=>({height:"calc(100vh - 70px)"}),Xe=t=>({"ng-invalid ng-dirty":t}),yt=()=>({});function wt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function It(t,p){if(t&1&&g(0,wt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Et(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Tt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ft(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Dt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Et,20,0,"ng-template",null,3,b)(4,Tt,26,22,"ng-template",null,4,b)(6,Ft,1,3,"ng-template",null,5,b)(8,Vt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,vt)),a(),s("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Rt(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Mt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Pt(t,p){if(t&1&&(l(0,"div"),g(1,Mt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function jt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Rt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Nt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Bt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Customer"),o(),l(28,"p-autocomplete",33),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(29,"div",25)(30,"label",26),m(31,"Page Size"),o(),C(32,"input",34),g(33,Pt,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Xe,e.isInvalid("pageSize")))("autoNumeric",P(23,yt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends je{constructor(){super(...arguments),this.store=v(Qe),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(ce)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Me("Customer Suggestions"),H(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(H(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=rt);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=it(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[Q([Qe]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollable","scrollHeight","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,It,1,1,"ng-template",null,0,b)(3,Dt,10,10,"ng-template",null,1,b)(5,jt,34,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,fe,de,We,Le,ue,pe,oe,le,ae,me,se,Ie,we,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Ye=Ce(ot("JournalSupplierBillStore"),ye(zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(J(B(()=>p.getGJSupplierBillLoader().pipe(O({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(J(G(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(G(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),O({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),be(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ot=()=>({height:"calc(100vh - 70px)"}),Ze=t=>({"ng-invalid ng-dirty":t}),Gt=()=>({});function Ht(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ut(t,p){if(t&1&&g(0,Ht,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function At(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Lt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Wt(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Kt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function qt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,At,20,0,"ng-template",null,3,b)(4,Lt,25,21,"ng-template",null,4,b)(6,Wt,1,3,"ng-template",null,5,b)(8,Kt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,Ot)),a(),s("scrollHeight","calc(100vh - 142px)")("value",e.store.data().data)("scrollable",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function $t(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Qt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Yt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Zt(t,p){if(t&1&&(l(0,"div"),g(1,Yt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ei(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ti(t,p){if(t&1&&(l(0,"div"),g(1,ei,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ii(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,$t,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Xt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Zt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Supplier"),o(),l(28,"p-autocomplete",33),w(29,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(30,"div",25)(31,"label",26),m(32,"Page Size"),o(),C(33,"input",34),g(34,ti,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",j(29,17,e.supplierSuggestions$)),a(5),s("autoNumeric",P(23,Gt))("ngClass",F(24,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Me("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(H(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[Q([Ye]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","value","scrollable","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ut,1,1,"ng-template",null,0,b)(3,qt,10,10,"ng-template",null,1,b)(5,ii,35,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,nt,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,We,Le,ue,pe,oe,le,ae,me,se,fe,de,Ee,Ie,we,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},et=Ce(ye(ni),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:z(J(B(()=>p.getGJShiftLoader().pipe(O(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(J(G(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(O(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),be(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var oi=()=>({height:"calc(100vh - 70px)"}),tt=t=>({"ng-invalid ng-dirty":t}),ri=()=>({});function li(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ai(t,p){if(t&1&&g(0,li,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function pi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function mi(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(j(16,20,e.salesNTax)),a(3),x(j(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(j(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function si(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ci(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ui(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,pi,22,0,"ng-template",null,3,b)(4,mi,29,26,"ng-template",null,4,b)(6,si,1,3,"ng-template",null,5,b)(8,ci,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,oi)),a(),s("scrollHeight","calc(100vh - 142px)")("scrollable",!0)("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function di(t,p){if(t&1&&(l(0,"span",31),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function gi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function hi(t,p){if(t&1&&(l(0,"div"),g(1,gi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Si(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Ci(t,p){if(t&1&&(l(0,"div"),g(1,Si,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function xi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,di,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From"),o(),C(10,"p-datepicker",27),g(11,_i,2,1,"div",28),o(),l(12,"div",24)(13,"label",25),m(14,"To"),o(),C(15,"p-datepicker",29),g(16,hi,2,1,"div",28),o(),l(17,"div",24)(18,"label",25),m(19,"Page Size"),o(),C(20,"input",30),g(21,Ci,2,1,"div",28),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,tt,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,tt,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",P(18,ri))("ngClass",F(19,tt,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var St=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(et),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:Oe,export:Ge,exportPageNumber:He,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(Oe,[re.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(H(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[Q([et]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","scrollable","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ai,1,1,"ng-template",null,0,b)(3,ui,10,10,"ng-template",null,1,b)(5,xi,22,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Se,he,ge,_e,ue,pe,oe,le,ae,me,se,Re,De,Ve,Fe,Ee,Ie,we,fe,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yo=[{path:"invoice",component:gt},{path:"supplier-bill",component:ht},{path:"shift",component:St},{path:"join-invoice",loadComponent:()=>import("./chunk-ZCUVD7AW.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-TFIGD3CO.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-DLZ2BFC3.js").then(t=>t.AdjustmentJournalComponent)}];export{yo as generateJournalRoutes};
|
|
1
|
+
import{a as D}from"./chunk-EXGI2AG7.js";import{a as rt}from"./chunk-G4XX7EU2.js";import{a as Le,b as We}from"./chunk-HHJMN4BS.js";import{a as ze}from"./chunk-P7Z64VPC.js";import{b as N}from"./chunk-IQ6VG3YL.js";import"./chunk-FA5SZDUK.js";import{a as ne}from"./chunk-AGLKA7OG.js";import{a as Ae,b as Pe}from"./chunk-YOUPD27G.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-AZUQDRJU.js";import"./chunk-C2GO6SPF.js";import{a as z,b as O}from"./chunk-O4QM64EH.js";import{d as ke,i as Ne,j as Je,k as Be}from"./chunk-EW3R2HAB.js";import{a as Fe,b as Ve}from"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as Me}from"./chunk-XKCLERWG.js";import"./chunk-PKN47FQE.js";import{a as De,b as Re}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{g as Ee,h as Te}from"./chunk-AWXT2WGR.js";import{b as we,c as Ie}from"./chunk-C7LM5UCK.js";import{a as he,b as Se}from"./chunk-J4XRJAME.js";import{a as y,b as Ce,c as xe,d as be,e as ve,f as ye,g as ot}from"./chunk-JBSIAXM5.js";import"./chunk-GH5Z5SPB.js";import{n as de,o as fe,w as _e,x as ge}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{b as oe,c as re,e as le,f as ae,k as pe,l as me,o as se,v as ce,y as ue}from"./chunk-FMVCTBCQ.js";import"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import"./chunk-F2X3VGZZ.js";import{c as X,e as Y,f as Z,i as nt,k as ee,l as te,m as ie}from"./chunk-B63BKC6F.js";import{Ab as L,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as j,Lc as V,Mc as b,Nb as W,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as H,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as G,sc as k,ta as it,uc as K,vc as q,wb as A,wc as M,xc as $,yc as Q,zc as P}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var Ct={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Qe=Ce(ye(Ct),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:z(J(G(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(G(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Me("getCustomerInvoice"),O({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(J(B(()=>p.getJournalInvoiceLoader().pipe(O({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),be(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var vt=()=>({height:"calc(100vh - 70px)"}),Xe=t=>({"ng-invalid ng-dirty":t}),yt=()=>({});function wt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function It(t,p){if(t&1&&g(0,wt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Et(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Tt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ft(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Dt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Et,20,0,"ng-template",null,3,b)(4,Tt,26,22,"ng-template",null,4,b)(6,Ft,1,3,"ng-template",null,5,b)(8,Vt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,vt)),a(),s("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Rt(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Mt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Pt(t,p){if(t&1&&(l(0,"div"),g(1,Mt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function jt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Rt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Nt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Bt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Customer"),o(),l(28,"p-autocomplete",33),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(29,"div",25)(30,"label",26),m(31,"Page Size"),o(),C(32,"input",34),g(33,Pt,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Xe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Xe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Xe,e.isInvalid("pageSize")))("autoNumeric",P(23,yt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends je{constructor(){super(...arguments),this.store=v(Qe),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(ce)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Me("Customer Suggestions"),H(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(H(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=rt);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=it(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[Q([Qe]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollable","scrollHeight","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,It,1,1,"ng-template",null,0,b)(3,Dt,10,10,"ng-template",null,1,b)(5,jt,34,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,fe,de,We,Le,ue,pe,oe,le,ae,me,se,Ie,we,Ee,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Ye=Ce(ot("JournalSupplierBillStore"),ye(zt),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(J(B(()=>p.getGJSupplierBillLoader().pipe(O({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(J(G(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(G(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),O({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),be(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ot=()=>({height:"calc(100vh - 70px)"}),Ze=t=>({"ng-invalid ng-dirty":t}),Gt=()=>({});function Ht(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ut(t,p){if(t&1&&g(0,Ht,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function At(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Lt(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(j(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Wt(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Kt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function qt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,At,20,0,"ng-template",null,3,b)(4,Lt,25,21,"ng-template",null,4,b)(6,Wt,1,3,"ng-template",null,5,b)(8,Kt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,Ot)),a(),s("scrollHeight","calc(100vh - 142px)")("value",e.store.data().data)("scrollable",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function $t(t,p){if(t&1&&(l(0,"span",35),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Qt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Xt(t,p){if(t&1&&(l(0,"div"),g(1,Qt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Yt(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Zt(t,p){if(t&1&&(l(0,"div"),g(1,Yt,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function ei(t,p){if(t&1&&(l(0,"div")(1,"span",37),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ti(t,p){if(t&1&&(l(0,"div"),g(1,ei,3,1,"div",36),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ii(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,$t,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From"),o(),C(18,"p-datepicker",30),g(19,Xt,2,1,"div",31),o(),l(20,"div",25)(21,"label",26),m(22,"To"),o(),C(23,"p-datepicker",32),g(24,Zt,2,1,"div",31),o(),l(25,"div",25)(26,"label",26),m(27,"Supplier"),o(),l(28,"p-autocomplete",33),w(29,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(30,"div",25)(31,"label",26),m(32,"Page Size"),o(),C(33,"input",34),g(34,ti,2,1,"div",31),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ze,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ze,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",j(29,17,e.supplierSuggestions$)),a(5),s("autoNumeric",P(23,Gt))("ngClass",F(24,Ze,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ye),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Me("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:Oe,pageNumber:Ge,rowCount:He,pageSize:Ue,export:Ke,exportPageNumber:qe,exportRowCount:$e}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(Oe),pageNumber:this.fb.control(Ge),rowCount:this.fb.control(He),pageSize:this.fb.control(Ue,[re.required]),export:this.fb.control(Ke),exportPageNumber:this.fb.control(qe),exportRowCount:this.fb.control($e)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(H(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[Q([Ye]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","value","scrollable","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ut,1,1,"ng-template",null,0,b)(3,qt,10,10,"ng-template",null,1,b)(5,ii,35,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,nt,te,ee,Pe,Ae,Se,he,ge,_e,Re,De,Ve,Fe,We,Le,ue,pe,oe,le,ae,me,se,fe,de,Ee,Ie,we,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},et=Ce(ye(ni),xe(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ve(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:z(J(B(()=>p.getGJShiftLoader().pipe(O(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(J(G(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(O(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),be(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var oi=()=>({height:"calc(100vh - 70px)"}),tt=t=>({"ng-invalid ng-dirty":t}),ri=()=>({});function li(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ai(t,p){if(t&1&&g(0,li,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function pi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function mi(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(j(16,20,e.salesNTax)),a(3),x(j(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(j(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function si(t,p){if(t&1&&m(0),t&2){let e=_(2);K(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ci(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ui(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,pi,22,0,"ng-template",null,3,b)(4,mi,29,26,"ng-template",null,4,b)(6,si,1,3,"ng-template",null,5,b)(8,ci,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();W(P(9,oi)),a(),s("scrollHeight","calc(100vh - 142px)")("scrollable",!0)("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function di(t,p){if(t&1&&(l(0,"span",31),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function gi(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function hi(t,p){if(t&1&&(l(0,"div"),g(1,gi,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Si(t,p){if(t&1&&(l(0,"div")(1,"span",33),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Ci(t,p){if(t&1&&(l(0,"div"),g(1,Si,3,1,"div",32),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function xi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,di,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From"),o(),C(10,"p-datepicker",27),g(11,_i,2,1,"div",28),o(),l(12,"div",24)(13,"label",25),m(14,"To"),o(),C(15,"p-datepicker",29),g(16,hi,2,1,"div",28),o(),l(17,"div",24)(18,"label",25),m(19,"Page Size"),o(),C(20,"input",30),g(21,Ci,2,1,"div",28),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,tt,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(4),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,tt,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",P(18,ri))("ngClass",F(19,tt,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var St=(()=>{class t extends je{constructor(){super(),this.generateJournalService=v(D),this.store=v(et),this.authService=v(ne),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(ce),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:Oe,export:Ge,exportPageNumber:He,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(Oe,[re.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(H(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[Q([et]),L],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","scrollHeight","scrollable","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),$("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ai,1,1,"ng-template",null,0,b)(3,ui,10,10,"ng-template",null,1,b)(5,xi,22,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),q("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible))},dependencies:[Te,Be,ke,Ne,Je,ie,X,Y,Z,te,ee,Pe,Se,he,ge,_e,ue,pe,oe,le,ae,me,se,Re,De,Ve,Fe,Ee,Ie,we,fe,de,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yo=[{path:"invoice",component:gt},{path:"supplier-bill",component:ht},{path:"shift",component:St},{path:"join-invoice",loadComponent:()=>import("./chunk-IBUJP2RH.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-CI2PQN6B.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-S5LYGYPM.js").then(t=>t.AdjustmentJournalComponent)}];export{yo as generateJournalRoutes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as st,b as ct}from"./chunk-ABBBWSSO.js";import{a as mt}from"./chunk-BTDW4G2F.js";import{a as Nn,b as Ae,c as Ee,d as Vn}from"./chunk-KJ6CKUEI.js";import{a as On,b as Fn}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{a as Ln,b as Dn}from"./chunk-TVNXFJII.js";import{a as Rn}from"./chunk-XKI7WLHE.js";import{a as kn}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as we}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as it,b as ot}from"./chunk-O4QM64EH.js";import{a as at,b as lt,c as wn,d as An,i as En,j as Pn,k as Mn}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as j}from"./chunk-RPPLUBX5.js";import{a as E}from"./chunk-XKCLERWG.js";import{b as hn}from"./chunk-4LGDNQMZ.js";import{a as _n}from"./chunk-PKN47FQE.js";import{a as Tn,b as rt}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{a as nt,b as K}from"./chunk-5R3XKSDM.js";import{f as Sn,h as $}from"./chunk-ZI23MZE6.js";import{b as tt,c as de}from"./chunk-C7LM5UCK.js";import{a as re,b as ae}from"./chunk-J4XRJAME.js";import{a as W,b as Cn,c as In,e as yn,f as bn,g as vn}from"./chunk-JBSIAXM5.js";import{c as We,d as Jt,f as en}from"./chunk-GH5Z5SPB.js";import{a as bt,f as vt,n as Je,o as et,p as gn,t as xn,u as St,w as ie,x as oe}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{$ as an,Ba as mn,E as ht,Ea as pn,J as tn,Ja as un,L as nn,Ma as Te,N as on,Na as Le,Pa as dn,R as Ye,S as Xe,Va as fn,X as rn,Y as xt,b as te,c as ue,e as Z,ea as ln,f as Ce,g as Yt,ha as sn,i as L,j as Qe,k as Xt,l as Ie,la as cn,o as ye,oa as Ct,ra as ne,v as be,wa as It,x as ve,xa as yt,y as Se}from"./chunk-FMVCTBCQ.js";import{a as Wt}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import{c as _t,d as gt,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{D as J,F as ee,G as B,N as V,c as z,e as je,f as F,g as ft,h as jt,l as Qt,m as N,n as Fe}from"./chunk-B63BKC6F.js";import{Ab as ke,Ac as S,Bc as Gt,Cb as d,D as $e,Ga as b,J as Ke,Jb as P,Jc as Ht,Kb as s,Kc as Ut,L as Dt,Mc as y,Nb as _e,O as Rt,Ob as Oe,Ub as a,Vb as r,Vc as pe,Wb as h,Wc as xe,X as R,Xb as se,Yb as ce,Yc as Q,Z as T,Zc as Zt,_b as w,aa as Bt,ba as qe,bb as Me,c as Be,ca as $t,cb as Kt,dc as v,ec as c,gb as m,ha as x,jc as Ge,kc as me,lc as H,mb as dt,mc as U,pa as _,pc as X,qa as g,qc as p,rc as A,s as G,sc as ge,t as Lt,ta as ze,uc as zt,vc as He,wb as O,wc as Ue,xb as qt,xc as Ze,yc as he,za as Y,zc as D}from"./chunk-JP6RBSB3.js";import{a as C,b as I}from"./chunk-YQFG5XE2.js";var Yn=["class","page"],Xn=n=>({id:n}),Jn=n=>["fa-solid",n];function ei(n,l){n&1&&h(0,"p-button",8)}function ti(n,l){if(n&1){let e=w();a(0,"p-button",9),v("onClick",function(){_(e);let i=c(2);return g(i.onDelete())}),r()}}function ni(n,l){if(n&1&&(a(0,"div",4)(1,"p-button-group"),d(2,ei,1,0,"p-button",5)(3,ti,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),n&2){let e,t=c();m(2),s("ngIf",t.roleService.coa.edit),m(),s("ngIf",t.roleService.coa.delete),m(),s("queryParams",S(3,Xn,(e=t.COAInfo())==null?null:e.id))}}function ii(n,l){if(n&1&&h(0,"i",18),n&2){let e=l.checked;s("ngClass",S(1,Jn,e?"fa-check":"fa-xmark"))}}function oi(n,l){if(n&1){let e=w();a(0,"div",11)(1,"div",12)(2,"p-card")(3,"div",13)(4,"div",14)(5,"div",15),p(6,"Name"),r(),a(7,"div",16),p(8),r()(),a(9,"div",14)(10,"div",15),p(11,"Code"),r(),a(12,"div",16),p(13),r()(),a(14,"div",14)(15,"div",15),p(16,"Category"),r(),a(17,"div",16),p(18),r()(),a(19,"div",14)(20,"div",15),p(21,"Note"),r(),a(22,"div",16),p(23),r()(),a(24,"div",14)(25,"div",15),p(26,"Outlet"),r(),a(27,"div",16),p(28),r()(),a(29,"div",14)(30,"div",15),p(31,"Discontinued"),r(),a(32,"div",16)(33,"p-toggleswitch",17),v("onChange",function(i){_(e);let o=c(2);return g(o.onDiscontinued(i))}),d(34,ii,1,3,"ng-template",null,2,y),r()()()()()()()}if(n&2){let e,t,i,o,u,f=c(2);m(8),A((e=f.COAInfo().name)!==null&&e!==void 0?e:"-"),m(5),A((t=f.COAInfo().code)!==null&&t!==void 0?t:"-"),m(5),A((i=f.COAInfo().category)!==null&&i!==void 0?i:"-"),m(5),A((o=f.COAInfo().note)!==null&&o!==void 0?o:"-"),m(5),A((u=f.COAInfo().outletName)!==null&&u!==void 0?u:"-"),m(5),s("ngModel",f.COAInfo().bin)}}function ri(n,l){if(n&1&&d(0,oi,36,6,"div",10),n&2){let e=c();s("ngIf",e.COAInfo())}}var Bn=(()=>{class n{constructor(){this.#e=x(j),this.#t=x(J),this.router=x(ee),this.COAInfo=b(null),this.checked=b(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(E("params"),R(e=>this.#e.getChartAccountById(e.get("id"))),T(e=>this.COAInfo.set(e)),E("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let t=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(t).pipe(T(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-info",8,"page"]],attrs:Yn,decls:5,vars:0,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["class","row justify-content-center mt-3",4,"ngIf"],[1,"row","justify-content-center","mt-3"],[1,"col","col-lg-8"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-3"],[1,"col"],[3,"onChange","ngModel"],[3,"ngClass"]],template:function(t,i){t&1&&(a(0,"app-main-panel",3),d(1,ni,6,5,"ng-template",null,0,y)(3,ri,1,1,"ng-template",null,1,y),r())},dependencies:[N,z,F,ve,Z,Qe,We,V,B,$,K,nt,oe,ie,ct,st,wn,kn],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var le=(()=>{class n{constructor(){this.httpService=x(Wt)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let t={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",t)}renameCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,t)}updateParentCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,t).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,t={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=qe({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var wt=n=>n?n.reduce((l,e)=>(l.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?l.push(...wt(e.children)):l.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),l),[]):[];var At=(n,l,e)=>{let t=Math.ceil(e/l),i=(n-1)*l+1,o=Math.min(n*l,e);return{start:i,end:o,totalRecords:e,totalPages:t}};var ai={filter:{RowCount:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2},options:{entities:[],categories:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},Et=Cn(bn(ai),vn("ChartOfAccount"),In(n=>({isAllChecked:Q(()=>n.data().every(l=>l.checked)),checkedItems:Q(()=>n.data().filter(l=>l.checked)),IDsChecked:Q(()=>n.data().filter(l=>l.checked).map(l=>l.id)),categories:Q(()=>wt(n.options.categories())),first:Q(()=>{let{start:l}=At(n.filter().PageNumber,n.filter().RowCount,n.count());return l}),last:Q(()=>{let{end:l}=At(n.filter().PageNumber,n.filter().RowCount,n.count());return l})})),yn(n=>{let l=x(j),e=x(le),t={updateFilter(i){W(n,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})});else{let o=i,u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})}},checkAllCheckbox(){let i=n.data().map(o=>I(C({},o),{checked:!o.checked}));W(n,{data:i})},fetchChartOfAccount:it(Be($e(()=>!!n.filter()),Dt(300),Rt(),R(i=>l.getPaginatedChartAccounts(i).pipe(G(o=>I(C({},o),{data:o.data.map(u=>I(C({},u),{checked:!1}))})),ot({next:o=>W(n,{data:o.data,count:o.count}),error:o=>{W(n,{data:[],count:0}),console.error(o)}}))))),fetchLoader:it(Be(R(()=>l.getChartOfAccountLoader().pipe(ot({next:i=>{W(n,{filter:I(C({},n.filter()),{RowCount:i.filter.rowCount,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),t.fetchChartOfAccount(n.filter)},error:i=>{console.error(i)}}))))),getCategories:it(Be(Ke(()=>e.fetchCOACategories().pipe(ot({next:i=>{W(n,{options:{entities:n.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return t}));var ci=["class","page"],mi=n=>["../account/",n],pi=n=>({"text-decoration-line-through":n}),ui=()=>["/pages/report/general-ledger"],di=n=>({id:n}),fi=()=>({width:"100%"}),_i=()=>({scrollHeight:"200px"});function gi(n,l){if(n&1){let e=w();a(0,"p-button",13),v("onClick",function(){_(e);let i=c(2);return g(i.deleteCOA())}),r()}}function hi(n,l){n&1&&h(0,"p-button",14)}function xi(n,l){if(n&1){let e=w();a(0,"p-button",15),v("onClick",function(){_(e);let i=c(2);return g(i.onExport())}),r()}}function Ci(n,l){n&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Ii(n,l){if(n&1&&(a(0,"div",8),d(1,gi,1,0,"p-button",9),a(2,"p-button-group"),d(3,hi,1,0,"p-button",10)(4,xi,1,0,"p-button",11),r(),d(5,Ci,3,0,"a",12),r()),n&2){let e=c();m(),s("ngIf",e.store.checkedItems().length&&e.roleService.coa.delete),m(2),s("ngIf",e.roleService.coa.create),m(),s("ngIf",e.roleService.global.export),m(),s("ngIf",e.roleService.coa.create)}}function yi(n,l){n&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function bi(n,l){if(n&1&&(a(0,"tr"),d(1,yi,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),n&2){let e=c(2);m(),s("ngIf",e.roleService.coa.delete)}}function vi(n,l){if(n&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),n&2){let e=c().$implicit;m(),s("value",e)}}function Si(n,l){if(n&1&&(a(0,"tr"),d(1,vi,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),Ht(14,"number"),r()()()),n&2){let e,t=l.$implicit,i=c(2);m(),s("ngIf",i.roleService.coa.delete),m(2),A(t.code),m(2),s("routerLink",S(12,mi,t.id))("ngClass",S(14,pi,t.bin)),m(),A(t.name),m(2),A(t.category),m(2),A(t.outletName),m(2),s("routerLink",D(16,ui))("queryParams",S(17,di,t.id)),m(),A(Ut(14,10,(e=t.balance)!==null&&e!==void 0?e:0))}}function Ti(n,l){if(n&1&&p(0),n&2){let e=c(2);zt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function wi(n,l){n&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function Ai(n,l){if(n&1){let e=w();a(0,"p-panel")(1,"p-table",18),v("onLazyLoad",function(i){_(e);let o=c();return g(o.loadData(i))})("onRowSelect",function(i){_(e);let o=c();return g(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=c();return g(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=c();return g(o.onSelectAll(i))})("onPage",function(i){_(e);let o=c();return g(o.onPageChange(i))}),d(2,bi,12,1,"ng-template",null,3,y)(4,Si,15,19,"ng-template",null,4,y)(6,Ti,1,3,"ng-template",null,5,y)(8,wi,4,0,"ng-template",null,6,y),r()()}if(n&2){let e=c();m(),s("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().RowCount)("totalRecords",e.store.count())}}function Ei(n,l){if(n&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),v("onFocus",function(){_(e);let i=c(2);return g(i.onCategoryFocus())}),r()(),a(9,"div",33)(10,"label",30),p(11,"Page Size"),r(),h(12,"input",34),r(),a(13,"div",33)(14,"label",30),p(15,"Discontinued"),r(),a(16,"div",35)(17,"div",36),h(18,"p-radiobutton",37),a(19,"label",38),p(20,"No"),r()(),a(21,"div",36),h(22,"p-radiobutton",39),a(23,"label",40),p(24,"Yes"),r()(),a(25,"div",36),h(26,"p-radiobutton",39),a(27,"label",40),p(28,"All"),r()()()()()}if(n&2){let e=c(2);s("formGroup",e.formFilter),m(4),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),m(4),_e(D(15,fi)),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",D(16,_i))("options",e.categoryNodes()),m(10),s("value",0),m(4),s("value",1),m(4),s("value",2)}}function Pi(n,l){if(n&1&&d(0,Ei,29,17,"form",27),n&2){let e=c();s("ngIf",e.formFilter)}}var Kn=(()=>{class n{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().RowCount),this.generateFilterForm()}#e;constructor(){this.routeInfo=qn,this.store=x(Et),this.#e=x(j),this.modalService=x(Jt),this.roleService=x(we),this.dialogVisible=b(!1),this.categoryNodes=b([]),this.fb=x(be),this.isDialogFilterVisible=b(!1),this.generateFilterForm()}generateFilterForm(){this.formFilter=this.fb.group({outletID:this.fb.control([]),categoryID:this.fb.control(null),pageSize:this.fb.control(this.store.filter().RowCount),discontinued:this.fb.control(2)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(I(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(T(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(I(C({},this.store.filter()),{Text:e}))}updateFilter(e,t){this.store.updateFilter(I(C({},this.store.filter()),{[e]:t}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(E("response"),T(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(I(C({},this.store.filter()),{Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:t,outletID:i,discontinued:o}=this.formFilter.value;this.store.updateFilter(I(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",RowCount:+t,Discontinued:o})),this.isDialogFilterVisible.update(u=>!u)}onExport(){let e=I(C({},this.store.filter()),{ExportPageNumber:1,ExportRowCount:1e4});this.#e.exportChartOfAccounts(e).pipe(T(t=>{let i=t.headers;console.log("All headers:",i.keys());let o=i.get("Content-Disposition"),u=i.get("content-disposition"),f=o??u,M="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(M=decodeURIComponent(q[1].replace(/"/g,"")))}let k=t.body;Vn(k,M,k.type)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-cash-of-account",8,"page"]],features:[he([Et])],attrs:ci,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["containerStyleClass","w-100","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",1,"w-100",3,"onFocus","showClear","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){if(t&1){let o=w();a(0,"app-main-panel",7),v("search",function(f){return _(o),g(i.onSearchEvent(f))}),Ze("isDialogFilterVisibleChange",function(f){return _(o),Ue(i.isDialogFilterVisible,f)||(i.isDialogFilterVisible=f),g(f)}),v("filterEmitted",function(){return _(o),g(i.onFilterEvent())})("filterConfirmed",function(){return _(o),g(i.onFilterOKEvent())}),d(1,Ii,6,4,"ng-template",null,0,y)(3,Ai,10,5,"ng-template",null,1,y)(5,Pi,1,1,"ng-template",null,2,y),r()}t&2&&(s("isSearchableInput",!0),He("isDialogFilterVisible",i.isDialogFilterVisible),s("isFilterable",!0)("scrollable",!0))},dependencies:[N,z,F,Qt,$,en,ct,st,mt,ve,Xt,te,Z,Ce,V,B,Se,Ie,ye,We,Mn,An,En,Pn,K,Sn,oe,ie,rt,et,Je,de,Fn,On,Ee,Ae,ae,re,lt,at],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return n})();var ki=["class","page"],Oi=()=>["../../"],Mt=n=>({"ng-invalid ng-dirty":n}),Fi=n=>({"ng-dirty ng-invalid":n});function Ni(n,l){if(n&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),v("onClick",function(){_(e);let i=c();return g(i.onSubmit())}),r()()}n&2&&(m(),s("routerLink",D(1,Oi)))}function Vi(n,l){n&1&&(a(0,"div",27),p(1," Name is required "),r())}function Li(n,l){if(n&1&&(a(0,"div"),d(1,Vi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Name.errors.required)}}function Di(n,l){n&1&&(a(0,"div",28)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Ri(n,l){if(n&1&&(a(0,"span",29),p(1),r()),n&2){let e=l.$implicit;s("pTooltip",e.name),m(),ge(" ",e.name," ")}}function Bi(n,l){n&1&&(a(0,"div",27),p(1," Code is required "),r())}function $i(n,l){if(n&1&&(a(0,"div"),d(1,Bi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Code.errors.required)}}function Ki(n,l){if(n&1&&p(0),n&2){let e=l.$implicit;ge(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function qi(n,l){n&1&&(a(0,"div",27),p(1," Category is required "),r())}function zi(n,l){if(n&1&&(a(0,"div"),d(1,qi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Category.errors.required)}}function Gi(n,l){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Hi(n,l){if(n&1&&(a(0,"div"),d(1,Gi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Note.errors.required)}}function Ui(n,l){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Zi(n,l){if(n&1&&(a(0,"div"),d(1,Ui,2,0,"div",26),r()),n&2){let e=c(3);m(),s("ngIf",e.form.controls.Note.errors.required)}}function ji(n,l){if(n&1&&(a(0,"div",12)(1,"div",13)(2,"label",14),p(3,"Discontinued"),r(),a(4,"div",30)(5,"div",31),h(6,"p-radiobutton",32),a(7,"label",33),p(8,"No"),r()(),a(9,"div",31),h(10,"p-radiobutton",34),a(11,"label",35),p(12,"Yes"),r()()(),d(13,Zi,2,1,"div",16),r()()),n&2){let e=c(2);m(6),s("value",!1),m(4),s("value",!0),m(3),s("ngIf",e.form.controls.Note.errors)}}function Qi(n,l){if(n&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"div",13)(6,"label",14),p(7,"Name"),r(),h(8,"input",15),d(9,Li,2,1,"div",16),r()(),a(10,"div",12)(11,"div",13)(12,"div")(13,"label",14),p(14,"Outlet"),r(),h(15,"p-button",17),d(16,Di,3,0,"ng-template",null,2,y),r(),a(18,"p-select",18),d(19,Ri,2,2,"ng-template",null,3,y),r()()(),a(21,"div",12)(22,"div",13)(23,"label",14),p(24,"Code"),r(),h(25,"input",19),d(26,$i,2,1,"div",16),r()(),a(27,"div",20)(28,"div",21)(29,"label",14),p(30,"Category"),r(),a(31,"p-treeselect",22),d(32,Ki,1,1,"ng-template",23),r(),d(33,zi,2,1,"div",16),r()(),a(34,"div",12)(35,"div",13)(36,"label",14),p(37,"Note"),r(),h(38,"textarea",24),d(39,Hi,2,1,"div",16),r()(),d(40,ji,14,3,"div",25),r()()()()),n&2){let e=X(17),t=c();m(),s("formGroup",t.form),m(7),s("ngClass",S(15,Mt,t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched))),m(),s("ngIf",t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched)),m(6),s("pTooltip",e)("rounded",!0)("text",!0),m(3),s("options",t.outlets()),m(7),s("ngClass",S(17,Mt,t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched))),m(),s("ngIf",t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched)),m(5),s("options",t.categoryOptions())("ngClass",S(19,Fi,t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched))),m(2),s("ngIf",t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched)),m(5),s("ngClass",S(21,Mt,t.form.controls.Note.invalid&&(t.form.controls.Note.dirty||t.form.controls.Note.touched))),m(),s("ngIf",t.form.controls.Note.errors),m(),s("ngIf",t.hasIdParam&&!t.coa_info().form.bin)}}var kt=(()=>{class n{constructor(){this.route=x(J),this.coa_service=x(j),this.coa_info=b(null),this.fb=x(be),this.isEdit=b(!1),this.categoryOptions=b([]),this.router=x(ee),this.outlets=Q(()=>this.coa_info()?this.coa_info().options.entities:[])}findParenChilds(e,t){function i(o,u=null){for(let f of o){if(f.key===t)return{parent:u,child:f};if(f.children){let M=i(f.children,f);if(M)return M}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new L(e.id||""),Name:new L(e.name||"",[ue.required]),Code:new L(e.code||"",[ue.required]),Note:new L(e.note||"",[]),Balance:new L(e.balance||0),Outlet:new L(e.outletID||""),AccessType:new L(e.accessTypeID||0),Category:new L(null,[ue.required]),Bin:new L(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(Ke(e=>{if(e.has("id")){this.isEdit.set(!0);let t=e.get("id");return this.coa_service.getChartAccountFormById(t)}else return this.coa_service.getChartAccountForm()}),E("response"),G(e=>I(C({},e),{form:I(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),T(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:t,Category:i,Code:o,Name:u,Note:f,Outlet:M}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:i.key,name:u,bin:this.form.value.Bin||!1,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:i.key,bin:this.form.value.Bin||!1,name:u,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),T(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),T(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(E("response"),T(e=>{this.categoryOptions.set(e);let t=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(t?.child)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-form",8,"page"]],attrs:ki,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"row","justify-content-center",3,"formGroup"],[1,"col"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["icon","fa-solid fa-circle-info",3,"pTooltip","rounded","text"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"co","col-lg-6"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"options","ngClass"],["pTemplate","value"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass"],["class","col col-lg-6",4,"ngIf"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){t&1&&(a(0,"app-main-panel",4),d(1,Ni,4,2,"ng-template",null,0,y)(3,Qi,41,23,"ng-template",null,1,y),r()),t&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,Se,te,Z,Ce,Ie,ye,mt,N,z,F,V,B,Ee,Ae,Te,K,et,Je,Dn,Ln,rt,Tn,de,tt,oe,ie,ae,re,lt,at],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return n})();var Wi=["sublist"],Yi=(n,l)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":l}),Xi=()=>({"p-contextmenu-item-link":!0}),Hn=()=>({class:"p-contextmenu-submenu-icon"}),Ji=()=>({exact:!1}),eo=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),to=n=>({$implicit:n});function no(n,l){if(n&1&&h(0,"li",8),n&2){let e=c().$implicit,t=c(2);_e(t.getItemProp(e,"style")),s("ngClass",t.getSeparatorItemClass(e)),P("id",t.getItemId(e))("data-pc-section","separator")}}function io(n,l){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);s("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function oo(n,l){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function ro(n,l){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);s("innerHTML",t.getItemLabel(e),Me),P("data-pc-section","label")}}function ao(n,l){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);s("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function lo(n,l){n&1&&h(0,"AngleRightIcon"),n&2&&(Oe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function so(n,l){}function co(n,l){n&1&&d(0,so,0,0,"ng-template",25),n&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function mo(n,l){if(n&1&&(se(0),d(1,lo,1,4,"AngleRightIcon",23)(2,co,1,2,null,24),ce()),n&2){let e=c(6);m(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),s("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",D(3,Hn))}}function po(n,l){if(n&1&&(a(0,"a",15),d(1,io,1,5,"span",16)(2,oo,2,2,"span",17)(3,ro,1,2,"ng-template",null,2,y)(5,ao,1,2,"p-badge",18)(6,mo,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);s("target",i.getItemProp(t,"target"))("ngClass",D(12,Xi)),P("href",i.getItemProp(t,"url"),Kt)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),m(),s("ngIf",i.getItemProp(t,"icon")),m(),s("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),s("ngIf",i.getItemProp(t,"badge")),m(),s("ngIf",i.isItemGroup(t))}}function uo(n,l){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);s("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function fo(n,l){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function _o(n,l){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);s("innerHTML",t.getItemLabel(e),Me),P("data-pc-section","label")}}function go(n,l){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);s("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ho(n,l){n&1&&h(0,"AngleRightIcon"),n&2&&(Oe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function xo(n,l){}function Co(n,l){n&1&&d(0,xo,0,0,"ng-template",25),n&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function Io(n,l){if(n&1&&(se(0),d(1,ho,1,4,"AngleRightIcon",23)(2,Co,1,2,null,24),ce()),n&2){let e=c(6);m(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),s("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",D(3,Hn))}}function yo(n,l){if(n&1&&(a(0,"a",26),d(1,uo,1,5,"span",16)(2,fo,2,2,"span",17)(3,_o,1,2,"ng-template",null,2,y)(5,go,1,2,"p-badge",18)(6,Io,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);s("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||D(20,Ji))("target",i.getItemProp(t,"target"))("ngClass",S(21,eo,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),P("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),m(),s("ngIf",i.getItemProp(t,"icon")),m(),s("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),s("ngIf",i.getItemProp(t,"badge")),m(),s("ngIf",i.isItemGroup(t))}}function bo(n,l){if(n&1&&(se(0),d(1,po,7,13,"a",13)(2,yo,7,23,"a",14),ce()),n&2){let e=c(2).$implicit,t=c(2);m(),s("ngIf",!t.getItemProp(e,"routerLink")),m(),s("ngIf",t.getItemProp(e,"routerLink"))}}function vo(n,l){}function So(n,l){n&1&&d(0,vo,0,0,"ng-template")}function To(n,l){if(n&1&&(se(0),d(1,So,1,0,null,24),ce()),n&2){let e=c(2).$implicit,t=c(2);m(),s("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",S(2,to,e.item))}}function wo(n,l){if(n&1){let e=w();a(0,"p-contextmenu-sub",27),v("itemClick",function(i){_(e);let o=c(4);return g(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=c(4);return g(o.onItemMouseEnter(i))}),r()}if(n&2){let e=c(2).$implicit,t=c(2);s("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Ao(n,l){if(n&1){let e=w();a(0,"li",9,1)(2,"div",10),v("click",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemMouseEnter({$event:i,processedItem:o}))}),d(3,bo,3,2,"ng-container",11)(4,To,2,4,"ng-container",11),r(),d(5,wo,1,7,"p-contextmenu-sub",12),r()}if(n&2){let e=c(),t=e.$implicit,i=e.index,o=c(2);Oe(o.getItemProp(t,"styleClass")),s("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),P("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),m(2),P("data-pc-section","content"),m(),s("ngIf",!o.itemTemplate),m(),s("ngIf",o.itemTemplate),m(),s("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Eo(n,l){if(n&1&&d(0,no,1,5,"li",6)(1,Ao,6,21,"li",7),n&2){let e=l.$implicit,t=c(2);s("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),m(),s("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Po(n,l){if(n&1){let e=w();a(0,"ul",4,0),v("@overlayAnimation.start",function(i){_(e);let o=X(1),u=c();return g(u.onEnter(i,o))})("keydown",function(i){_(e);let o=c();return g(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=c();return g(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=c();return g(o.menuBlur.emit(i))}),d(2,Eo,2,2,"ng-template",5),r()}if(n&2){let e=c();s("ngClass",Gt(10,Yi,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),m(2),s("ngForOf",e.items)}}var Mo=["item"],ko=["submenuicon"],Oo=["rootmenu"],Fo=["container"],No=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Vo=()=>({value:"visible"});function Lo(n,l){if(n&1){let e=w();a(0,"div",3,0),v("@overlayAnimation.start",function(i){_(e);let o=c();return g(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=c();return g(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),v("itemClick",function(i){_(e);let o=c();return g(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=c();return g(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=c();return g(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=c();return g(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=c();return g(o.onItemMouseEnter(i))}),r()()}if(n&2){let e=c();Oe(e.styleClass),s("ngClass",S(20,No,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",D(22,Vo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),m(2),s("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Do=({dt:n})=>`
|
|
1
|
+
import{a as st,b as ct}from"./chunk-ABBBWSSO.js";import{a as mt}from"./chunk-BTDW4G2F.js";import{a as Nn,b as Ae,c as Ee,d as Vn}from"./chunk-KJ6CKUEI.js";import{a as On,b as Fn}from"./chunk-YRCXWYJC.js";import"./chunk-YOUPD27G.js";import{a as Ln,b as Dn}from"./chunk-TVNXFJII.js";import{a as Rn}from"./chunk-XKI7WLHE.js";import{a as kn}from"./chunk-YO23YVSC.js";import"./chunk-AZUQDRJU.js";import{a as we}from"./chunk-6ACYDH2N.js";import"./chunk-C2GO6SPF.js";import{a as it,b as ot}from"./chunk-O4QM64EH.js";import{a as at,b as lt,c as wn,d as An,i as En,j as Pn,k as Mn}from"./chunk-EW3R2HAB.js";import"./chunk-OLOVFS3Y.js";import"./chunk-QCLAOAVG.js";import"./chunk-Q33XIUDN.js";import{a as j}from"./chunk-RPPLUBX5.js";import{a as E}from"./chunk-XKCLERWG.js";import{b as hn}from"./chunk-4LGDNQMZ.js";import{a as _n}from"./chunk-PKN47FQE.js";import{a as Tn,b as rt}from"./chunk-LRRVQSMI.js";import"./chunk-42UIGXWH.js";import"./chunk-NA5YXAMJ.js";import"./chunk-253IFSMV.js";import"./chunk-QYXQYPHB.js";import"./chunk-FBEBMNVC.js";import"./chunk-6NGIQJIP.js";import"./chunk-YDEVG4CR.js";import{a as nt,b as K}from"./chunk-5R3XKSDM.js";import{f as Sn,h as $}from"./chunk-AWXT2WGR.js";import{b as tt,c as de}from"./chunk-C7LM5UCK.js";import{a as re,b as ae}from"./chunk-J4XRJAME.js";import{a as W,b as Cn,c as In,e as yn,f as bn,g as vn}from"./chunk-JBSIAXM5.js";import{c as We,d as Jt,f as en}from"./chunk-GH5Z5SPB.js";import{a as bt,f as vt,n as Je,o as et,p as gn,t as xn,u as St,w as ie,x as oe}from"./chunk-67VPWIWW.js";import"./chunk-BHV2HCJY.js";import{$ as an,Ba as mn,E as ht,Ea as pn,J as tn,Ja as un,L as nn,Ma as Te,N as on,Na as Le,Pa as dn,R as Ye,S as Xe,Va as fn,X as rn,Y as xt,b as te,c as ue,e as Z,ea as ln,f as Ce,g as Yt,ha as sn,i as L,j as Qe,k as Xt,l as Ie,la as cn,o as ye,oa as Ct,ra as ne,v as be,wa as It,x as ve,xa as yt,y as Se}from"./chunk-FMVCTBCQ.js";import{a as Wt}from"./chunk-ZGXJEG37.js";import"./chunk-VFEEFGWW.js";import{c as _t,d as gt,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{D as J,F as ee,G as B,N as V,c as z,e as je,f as F,g as ft,h as jt,l as Qt,m as N,n as Fe}from"./chunk-B63BKC6F.js";import{Ab as ke,Ac as S,Bc as Gt,Cb as d,D as $e,Ga as b,J as Ke,Jb as P,Jc as Ht,Kb as s,Kc as Ut,L as Dt,Mc as y,Nb as _e,O as Rt,Ob as Oe,Ub as a,Vb as r,Vc as pe,Wb as h,Wc as xe,X as R,Xb as se,Yb as ce,Yc as Q,Z as T,Zc as Zt,_b as w,aa as Bt,ba as qe,bb as Me,c as Be,ca as $t,cb as Kt,dc as v,ec as c,gb as m,ha as x,jc as Ge,kc as me,lc as H,mb as dt,mc as U,pa as _,pc as X,qa as g,qc as p,rc as A,s as G,sc as ge,t as Lt,ta as ze,uc as zt,vc as He,wb as O,wc as Ue,xb as qt,xc as Ze,yc as he,za as Y,zc as D}from"./chunk-JP6RBSB3.js";import{a as C,b as I}from"./chunk-YQFG5XE2.js";var Yn=["class","page"],Xn=n=>({id:n}),Jn=n=>["fa-solid",n];function ei(n,l){n&1&&h(0,"p-button",8)}function ti(n,l){if(n&1){let e=w();a(0,"p-button",9),v("onClick",function(){_(e);let i=c(2);return g(i.onDelete())}),r()}}function ni(n,l){if(n&1&&(a(0,"div",4)(1,"p-button-group"),d(2,ei,1,0,"p-button",5)(3,ti,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),n&2){let e,t=c();m(2),s("ngIf",t.roleService.coa.edit),m(),s("ngIf",t.roleService.coa.delete),m(),s("queryParams",S(3,Xn,(e=t.COAInfo())==null?null:e.id))}}function ii(n,l){if(n&1&&h(0,"i",18),n&2){let e=l.checked;s("ngClass",S(1,Jn,e?"fa-check":"fa-xmark"))}}function oi(n,l){if(n&1){let e=w();a(0,"div",11)(1,"div",12)(2,"p-card")(3,"div",13)(4,"div",14)(5,"div",15),p(6,"Name"),r(),a(7,"div",16),p(8),r()(),a(9,"div",14)(10,"div",15),p(11,"Code"),r(),a(12,"div",16),p(13),r()(),a(14,"div",14)(15,"div",15),p(16,"Category"),r(),a(17,"div",16),p(18),r()(),a(19,"div",14)(20,"div",15),p(21,"Note"),r(),a(22,"div",16),p(23),r()(),a(24,"div",14)(25,"div",15),p(26,"Outlet"),r(),a(27,"div",16),p(28),r()(),a(29,"div",14)(30,"div",15),p(31,"Discontinued"),r(),a(32,"div",16)(33,"p-toggleswitch",17),v("onChange",function(i){_(e);let o=c(2);return g(o.onDiscontinued(i))}),d(34,ii,1,3,"ng-template",null,2,y),r()()()()()()()}if(n&2){let e,t,i,o,u,f=c(2);m(8),A((e=f.COAInfo().name)!==null&&e!==void 0?e:"-"),m(5),A((t=f.COAInfo().code)!==null&&t!==void 0?t:"-"),m(5),A((i=f.COAInfo().category)!==null&&i!==void 0?i:"-"),m(5),A((o=f.COAInfo().note)!==null&&o!==void 0?o:"-"),m(5),A((u=f.COAInfo().outletName)!==null&&u!==void 0?u:"-"),m(5),s("ngModel",f.COAInfo().bin)}}function ri(n,l){if(n&1&&d(0,oi,36,6,"div",10),n&2){let e=c();s("ngIf",e.COAInfo())}}var Bn=(()=>{class n{constructor(){this.#e=x(j),this.#t=x(J),this.router=x(ee),this.COAInfo=b(null),this.checked=b(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(E("params"),R(e=>this.#e.getChartAccountById(e.get("id"))),T(e=>this.COAInfo.set(e)),E("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let t=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(t).pipe(T(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-info",8,"page"]],attrs:Yn,decls:5,vars:0,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["class","row justify-content-center mt-3",4,"ngIf"],[1,"row","justify-content-center","mt-3"],[1,"col","col-lg-8"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-3"],[1,"col"],[3,"onChange","ngModel"],[3,"ngClass"]],template:function(t,i){t&1&&(a(0,"app-main-panel",3),d(1,ni,6,5,"ng-template",null,0,y)(3,ri,1,1,"ng-template",null,1,y),r())},dependencies:[N,z,F,ve,Z,Qe,We,V,B,$,K,nt,oe,ie,ct,st,wn,kn],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var le=(()=>{class n{constructor(){this.httpService=x(Wt)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let t={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",t)}renameCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,t)}updateParentCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,t).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,t={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=qe({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var wt=n=>n?n.reduce((l,e)=>(l.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?l.push(...wt(e.children)):l.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),l),[]):[];var At=(n,l,e)=>{let t=Math.ceil(e/l),i=(n-1)*l+1,o=Math.min(n*l,e);return{start:i,end:o,totalRecords:e,totalPages:t}};var ai={filter:{RowCount:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2},options:{entities:[],categories:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},Et=Cn(bn(ai),vn("ChartOfAccount"),In(n=>({isAllChecked:Q(()=>n.data().every(l=>l.checked)),checkedItems:Q(()=>n.data().filter(l=>l.checked)),IDsChecked:Q(()=>n.data().filter(l=>l.checked).map(l=>l.id)),categories:Q(()=>wt(n.options.categories())),first:Q(()=>{let{start:l}=At(n.filter().PageNumber,n.filter().RowCount,n.count());return l}),last:Q(()=>{let{end:l}=At(n.filter().PageNumber,n.filter().RowCount,n.count());return l})})),yn(n=>{let l=x(j),e=x(le),t={updateFilter(i){W(n,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})});else{let o=i,u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})}},checkAllCheckbox(){let i=n.data().map(o=>I(C({},o),{checked:!o.checked}));W(n,{data:i})},fetchChartOfAccount:it(Be($e(()=>!!n.filter()),Dt(300),Rt(),R(i=>l.getPaginatedChartAccounts(i).pipe(G(o=>I(C({},o),{data:o.data.map(u=>I(C({},u),{checked:!1}))})),ot({next:o=>W(n,{data:o.data,count:o.count}),error:o=>{W(n,{data:[],count:0}),console.error(o)}}))))),fetchLoader:it(Be(R(()=>l.getChartOfAccountLoader().pipe(ot({next:i=>{W(n,{filter:I(C({},n.filter()),{RowCount:i.filter.rowCount,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),t.fetchChartOfAccount(n.filter)},error:i=>{console.error(i)}}))))),getCategories:it(Be(Ke(()=>e.fetchCOACategories().pipe(ot({next:i=>{W(n,{options:{entities:n.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return t}));var ci=["class","page"],mi=n=>["../account/",n],pi=n=>({"text-decoration-line-through":n}),ui=()=>["/pages/report/general-ledger"],di=n=>({id:n}),fi=()=>({width:"100%"}),_i=()=>({scrollHeight:"200px"});function gi(n,l){if(n&1){let e=w();a(0,"p-button",13),v("onClick",function(){_(e);let i=c(2);return g(i.deleteCOA())}),r()}}function hi(n,l){n&1&&h(0,"p-button",14)}function xi(n,l){if(n&1){let e=w();a(0,"p-button",15),v("onClick",function(){_(e);let i=c(2);return g(i.onExport())}),r()}}function Ci(n,l){n&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Ii(n,l){if(n&1&&(a(0,"div",8),d(1,gi,1,0,"p-button",9),a(2,"p-button-group"),d(3,hi,1,0,"p-button",10)(4,xi,1,0,"p-button",11),r(),d(5,Ci,3,0,"a",12),r()),n&2){let e=c();m(),s("ngIf",e.store.checkedItems().length&&e.roleService.coa.delete),m(2),s("ngIf",e.roleService.coa.create),m(),s("ngIf",e.roleService.global.export),m(),s("ngIf",e.roleService.coa.create)}}function yi(n,l){n&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function bi(n,l){if(n&1&&(a(0,"tr"),d(1,yi,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),n&2){let e=c(2);m(),s("ngIf",e.roleService.coa.delete)}}function vi(n,l){if(n&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),n&2){let e=c().$implicit;m(),s("value",e)}}function Si(n,l){if(n&1&&(a(0,"tr"),d(1,vi,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),Ht(14,"number"),r()()()),n&2){let e,t=l.$implicit,i=c(2);m(),s("ngIf",i.roleService.coa.delete),m(2),A(t.code),m(2),s("routerLink",S(12,mi,t.id))("ngClass",S(14,pi,t.bin)),m(),A(t.name),m(2),A(t.category),m(2),A(t.outletName),m(2),s("routerLink",D(16,ui))("queryParams",S(17,di,t.id)),m(),A(Ut(14,10,(e=t.balance)!==null&&e!==void 0?e:0))}}function Ti(n,l){if(n&1&&p(0),n&2){let e=c(2);zt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function wi(n,l){n&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function Ai(n,l){if(n&1){let e=w();a(0,"p-panel")(1,"p-table",18),v("onLazyLoad",function(i){_(e);let o=c();return g(o.loadData(i))})("onRowSelect",function(i){_(e);let o=c();return g(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=c();return g(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=c();return g(o.onSelectAll(i))})("onPage",function(i){_(e);let o=c();return g(o.onPageChange(i))}),d(2,bi,12,1,"ng-template",null,3,y)(4,Si,15,19,"ng-template",null,4,y)(6,Ti,1,3,"ng-template",null,5,y)(8,wi,4,0,"ng-template",null,6,y),r()()}if(n&2){let e=c();m(),s("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().RowCount)("totalRecords",e.store.count())}}function Ei(n,l){if(n&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),v("onFocus",function(){_(e);let i=c(2);return g(i.onCategoryFocus())}),r()(),a(9,"div",33)(10,"label",30),p(11,"Page Size"),r(),h(12,"input",34),r(),a(13,"div",33)(14,"label",30),p(15,"Discontinued"),r(),a(16,"div",35)(17,"div",36),h(18,"p-radiobutton",37),a(19,"label",38),p(20,"No"),r()(),a(21,"div",36),h(22,"p-radiobutton",39),a(23,"label",40),p(24,"Yes"),r()(),a(25,"div",36),h(26,"p-radiobutton",39),a(27,"label",40),p(28,"All"),r()()()()()}if(n&2){let e=c(2);s("formGroup",e.formFilter),m(4),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),m(4),_e(D(15,fi)),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",D(16,_i))("options",e.categoryNodes()),m(10),s("value",0),m(4),s("value",1),m(4),s("value",2)}}function Pi(n,l){if(n&1&&d(0,Ei,29,17,"form",27),n&2){let e=c();s("ngIf",e.formFilter)}}var Kn=(()=>{class n{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().RowCount),this.generateFilterForm()}#e;constructor(){this.routeInfo=qn,this.store=x(Et),this.#e=x(j),this.modalService=x(Jt),this.roleService=x(we),this.dialogVisible=b(!1),this.categoryNodes=b([]),this.fb=x(be),this.isDialogFilterVisible=b(!1),this.generateFilterForm()}generateFilterForm(){this.formFilter=this.fb.group({outletID:this.fb.control([]),categoryID:this.fb.control(null),pageSize:this.fb.control(this.store.filter().RowCount),discontinued:this.fb.control(2)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(I(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(T(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(I(C({},this.store.filter()),{Text:e}))}updateFilter(e,t){this.store.updateFilter(I(C({},this.store.filter()),{[e]:t}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(E("response"),T(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(I(C({},this.store.filter()),{Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:t,outletID:i,discontinued:o}=this.formFilter.value;this.store.updateFilter(I(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",RowCount:+t,Discontinued:o})),this.isDialogFilterVisible.update(u=>!u)}onExport(){let e=I(C({},this.store.filter()),{ExportPageNumber:1,ExportRowCount:1e4});this.#e.exportChartOfAccounts(e).pipe(T(t=>{let i=t.headers;console.log("All headers:",i.keys());let o=i.get("Content-Disposition"),u=i.get("content-disposition"),f=o??u,M="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(M=decodeURIComponent(q[1].replace(/"/g,"")))}let k=t.body;Vn(k,M,k.type)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-cash-of-account",8,"page"]],features:[he([Et])],attrs:ci,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["containerStyleClass","w-100","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",1,"w-100",3,"onFocus","showClear","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){if(t&1){let o=w();a(0,"app-main-panel",7),v("search",function(f){return _(o),g(i.onSearchEvent(f))}),Ze("isDialogFilterVisibleChange",function(f){return _(o),Ue(i.isDialogFilterVisible,f)||(i.isDialogFilterVisible=f),g(f)}),v("filterEmitted",function(){return _(o),g(i.onFilterEvent())})("filterConfirmed",function(){return _(o),g(i.onFilterOKEvent())}),d(1,Ii,6,4,"ng-template",null,0,y)(3,Ai,10,5,"ng-template",null,1,y)(5,Pi,1,1,"ng-template",null,2,y),r()}t&2&&(s("isSearchableInput",!0),He("isDialogFilterVisible",i.isDialogFilterVisible),s("isFilterable",!0)("scrollable",!0))},dependencies:[N,z,F,Qt,$,en,ct,st,mt,ve,Xt,te,Z,Ce,V,B,Se,Ie,ye,We,Mn,An,En,Pn,K,Sn,oe,ie,rt,et,Je,de,Fn,On,Ee,Ae,ae,re,lt,at],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return n})();var ki=["class","page"],Oi=()=>["../../"],Mt=n=>({"ng-invalid ng-dirty":n}),Fi=n=>({"ng-dirty ng-invalid":n});function Ni(n,l){if(n&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),v("onClick",function(){_(e);let i=c();return g(i.onSubmit())}),r()()}n&2&&(m(),s("routerLink",D(1,Oi)))}function Vi(n,l){n&1&&(a(0,"div",27),p(1," Name is required "),r())}function Li(n,l){if(n&1&&(a(0,"div"),d(1,Vi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Name.errors.required)}}function Di(n,l){n&1&&(a(0,"div",28)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Ri(n,l){if(n&1&&(a(0,"span",29),p(1),r()),n&2){let e=l.$implicit;s("pTooltip",e.name),m(),ge(" ",e.name," ")}}function Bi(n,l){n&1&&(a(0,"div",27),p(1," Code is required "),r())}function $i(n,l){if(n&1&&(a(0,"div"),d(1,Bi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Code.errors.required)}}function Ki(n,l){if(n&1&&p(0),n&2){let e=l.$implicit;ge(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function qi(n,l){n&1&&(a(0,"div",27),p(1," Category is required "),r())}function zi(n,l){if(n&1&&(a(0,"div"),d(1,qi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Category.errors.required)}}function Gi(n,l){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Hi(n,l){if(n&1&&(a(0,"div"),d(1,Gi,2,0,"div",26),r()),n&2){let e=c(2);m(),s("ngIf",e.form.controls.Note.errors.required)}}function Ui(n,l){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Zi(n,l){if(n&1&&(a(0,"div"),d(1,Ui,2,0,"div",26),r()),n&2){let e=c(3);m(),s("ngIf",e.form.controls.Note.errors.required)}}function ji(n,l){if(n&1&&(a(0,"div",12)(1,"div",13)(2,"label",14),p(3,"Discontinued"),r(),a(4,"div",30)(5,"div",31),h(6,"p-radiobutton",32),a(7,"label",33),p(8,"No"),r()(),a(9,"div",31),h(10,"p-radiobutton",34),a(11,"label",35),p(12,"Yes"),r()()(),d(13,Zi,2,1,"div",16),r()()),n&2){let e=c(2);m(6),s("value",!1),m(4),s("value",!0),m(3),s("ngIf",e.form.controls.Note.errors)}}function Qi(n,l){if(n&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"div",13)(6,"label",14),p(7,"Name"),r(),h(8,"input",15),d(9,Li,2,1,"div",16),r()(),a(10,"div",12)(11,"div",13)(12,"div")(13,"label",14),p(14,"Outlet"),r(),h(15,"p-button",17),d(16,Di,3,0,"ng-template",null,2,y),r(),a(18,"p-select",18),d(19,Ri,2,2,"ng-template",null,3,y),r()()(),a(21,"div",12)(22,"div",13)(23,"label",14),p(24,"Code"),r(),h(25,"input",19),d(26,$i,2,1,"div",16),r()(),a(27,"div",20)(28,"div",21)(29,"label",14),p(30,"Category"),r(),a(31,"p-treeselect",22),d(32,Ki,1,1,"ng-template",23),r(),d(33,zi,2,1,"div",16),r()(),a(34,"div",12)(35,"div",13)(36,"label",14),p(37,"Note"),r(),h(38,"textarea",24),d(39,Hi,2,1,"div",16),r()(),d(40,ji,14,3,"div",25),r()()()()),n&2){let e=X(17),t=c();m(),s("formGroup",t.form),m(7),s("ngClass",S(15,Mt,t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched))),m(),s("ngIf",t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched)),m(6),s("pTooltip",e)("rounded",!0)("text",!0),m(3),s("options",t.outlets()),m(7),s("ngClass",S(17,Mt,t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched))),m(),s("ngIf",t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched)),m(5),s("options",t.categoryOptions())("ngClass",S(19,Fi,t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched))),m(2),s("ngIf",t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched)),m(5),s("ngClass",S(21,Mt,t.form.controls.Note.invalid&&(t.form.controls.Note.dirty||t.form.controls.Note.touched))),m(),s("ngIf",t.form.controls.Note.errors),m(),s("ngIf",t.hasIdParam&&!t.coa_info().form.bin)}}var kt=(()=>{class n{constructor(){this.route=x(J),this.coa_service=x(j),this.coa_info=b(null),this.fb=x(be),this.isEdit=b(!1),this.categoryOptions=b([]),this.router=x(ee),this.outlets=Q(()=>this.coa_info()?this.coa_info().options.entities:[])}findParenChilds(e,t){function i(o,u=null){for(let f of o){if(f.key===t)return{parent:u,child:f};if(f.children){let M=i(f.children,f);if(M)return M}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new L(e.id||""),Name:new L(e.name||"",[ue.required]),Code:new L(e.code||"",[ue.required]),Note:new L(e.note||"",[]),Balance:new L(e.balance||0),Outlet:new L(e.outletID||""),AccessType:new L(e.accessTypeID||0),Category:new L(null,[ue.required]),Bin:new L(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(Ke(e=>{if(e.has("id")){this.isEdit.set(!0);let t=e.get("id");return this.coa_service.getChartAccountFormById(t)}else return this.coa_service.getChartAccountForm()}),E("response"),G(e=>I(C({},e),{form:I(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),T(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:t,Category:i,Code:o,Name:u,Note:f,Outlet:M}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:i.key,name:u,bin:this.form.value.Bin||!1,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:i.key,bin:this.form.value.Bin||!1,name:u,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),T(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),T(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(E("response"),T(e=>{this.categoryOptions.set(e);let t=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(t?.child)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-form",8,"page"]],attrs:ki,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"row","justify-content-center",3,"formGroup"],[1,"col"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["icon","fa-solid fa-circle-info",3,"pTooltip","rounded","text"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"co","col-lg-6"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"options","ngClass"],["pTemplate","value"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass"],["class","col col-lg-6",4,"ngIf"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){t&1&&(a(0,"app-main-panel",4),d(1,Ni,4,2,"ng-template",null,0,y)(3,Qi,41,23,"ng-template",null,1,y),r()),t&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,Se,te,Z,Ce,Ie,ye,mt,N,z,F,V,B,Ee,Ae,Te,K,et,Je,Dn,Ln,rt,Tn,de,tt,oe,ie,ae,re,lt,at],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return n})();var Wi=["sublist"],Yi=(n,l)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":l}),Xi=()=>({"p-contextmenu-item-link":!0}),Hn=()=>({class:"p-contextmenu-submenu-icon"}),Ji=()=>({exact:!1}),eo=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),to=n=>({$implicit:n});function no(n,l){if(n&1&&h(0,"li",8),n&2){let e=c().$implicit,t=c(2);_e(t.getItemProp(e,"style")),s("ngClass",t.getSeparatorItemClass(e)),P("id",t.getItemId(e))("data-pc-section","separator")}}function io(n,l){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);s("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function oo(n,l){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function ro(n,l){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);s("innerHTML",t.getItemLabel(e),Me),P("data-pc-section","label")}}function ao(n,l){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);s("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function lo(n,l){n&1&&h(0,"AngleRightIcon"),n&2&&(Oe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function so(n,l){}function co(n,l){n&1&&d(0,so,0,0,"ng-template",25),n&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function mo(n,l){if(n&1&&(se(0),d(1,lo,1,4,"AngleRightIcon",23)(2,co,1,2,null,24),ce()),n&2){let e=c(6);m(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),s("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",D(3,Hn))}}function po(n,l){if(n&1&&(a(0,"a",15),d(1,io,1,5,"span",16)(2,oo,2,2,"span",17)(3,ro,1,2,"ng-template",null,2,y)(5,ao,1,2,"p-badge",18)(6,mo,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);s("target",i.getItemProp(t,"target"))("ngClass",D(12,Xi)),P("href",i.getItemProp(t,"url"),Kt)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),m(),s("ngIf",i.getItemProp(t,"icon")),m(),s("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),s("ngIf",i.getItemProp(t,"badge")),m(),s("ngIf",i.isItemGroup(t))}}function uo(n,l){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);s("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function fo(n,l){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function _o(n,l){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);s("innerHTML",t.getItemLabel(e),Me),P("data-pc-section","label")}}function go(n,l){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);s("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ho(n,l){n&1&&h(0,"AngleRightIcon"),n&2&&(Oe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function xo(n,l){}function Co(n,l){n&1&&d(0,xo,0,0,"ng-template",25),n&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function Io(n,l){if(n&1&&(se(0),d(1,ho,1,4,"AngleRightIcon",23)(2,Co,1,2,null,24),ce()),n&2){let e=c(6);m(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),s("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",D(3,Hn))}}function yo(n,l){if(n&1&&(a(0,"a",26),d(1,uo,1,5,"span",16)(2,fo,2,2,"span",17)(3,_o,1,2,"ng-template",null,2,y)(5,go,1,2,"p-badge",18)(6,Io,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);s("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||D(20,Ji))("target",i.getItemProp(t,"target"))("ngClass",S(21,eo,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),P("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),m(),s("ngIf",i.getItemProp(t,"icon")),m(),s("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),s("ngIf",i.getItemProp(t,"badge")),m(),s("ngIf",i.isItemGroup(t))}}function bo(n,l){if(n&1&&(se(0),d(1,po,7,13,"a",13)(2,yo,7,23,"a",14),ce()),n&2){let e=c(2).$implicit,t=c(2);m(),s("ngIf",!t.getItemProp(e,"routerLink")),m(),s("ngIf",t.getItemProp(e,"routerLink"))}}function vo(n,l){}function So(n,l){n&1&&d(0,vo,0,0,"ng-template")}function To(n,l){if(n&1&&(se(0),d(1,So,1,0,null,24),ce()),n&2){let e=c(2).$implicit,t=c(2);m(),s("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",S(2,to,e.item))}}function wo(n,l){if(n&1){let e=w();a(0,"p-contextmenu-sub",27),v("itemClick",function(i){_(e);let o=c(4);return g(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=c(4);return g(o.onItemMouseEnter(i))}),r()}if(n&2){let e=c(2).$implicit,t=c(2);s("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Ao(n,l){if(n&1){let e=w();a(0,"li",9,1)(2,"div",10),v("click",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemMouseEnter({$event:i,processedItem:o}))}),d(3,bo,3,2,"ng-container",11)(4,To,2,4,"ng-container",11),r(),d(5,wo,1,7,"p-contextmenu-sub",12),r()}if(n&2){let e=c(),t=e.$implicit,i=e.index,o=c(2);Oe(o.getItemProp(t,"styleClass")),s("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),P("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),m(2),P("data-pc-section","content"),m(),s("ngIf",!o.itemTemplate),m(),s("ngIf",o.itemTemplate),m(),s("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Eo(n,l){if(n&1&&d(0,no,1,5,"li",6)(1,Ao,6,21,"li",7),n&2){let e=l.$implicit,t=c(2);s("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),m(),s("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Po(n,l){if(n&1){let e=w();a(0,"ul",4,0),v("@overlayAnimation.start",function(i){_(e);let o=X(1),u=c();return g(u.onEnter(i,o))})("keydown",function(i){_(e);let o=c();return g(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=c();return g(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=c();return g(o.menuBlur.emit(i))}),d(2,Eo,2,2,"ng-template",5),r()}if(n&2){let e=c();s("ngClass",Gt(10,Yi,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),m(2),s("ngForOf",e.items)}}var Mo=["item"],ko=["submenuicon"],Oo=["rootmenu"],Fo=["container"],No=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Vo=()=>({value:"visible"});function Lo(n,l){if(n&1){let e=w();a(0,"div",3,0),v("@overlayAnimation.start",function(i){_(e);let o=c();return g(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=c();return g(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),v("itemClick",function(i){_(e);let o=c();return g(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=c();return g(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=c();return g(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=c();return g(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=c();return g(o.onItemMouseEnter(i))}),r()()}if(n&2){let e=c();Oe(e.styleClass),s("ngClass",S(20,No,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",D(22,Vo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),m(2),s("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Do=({dt:n})=>`
|
|
2
2
|
.p-contextmenu {
|
|
3
3
|
position: absolute;
|
|
4
4
|
background: ${n("contextmenu.background")};
|
|
@@ -157,4 +157,4 @@ import{a as st,b as ct}from"./chunk-ABBBWSSO.js";import{a as mt}from"./chunk-BTD
|
|
|
157
157
|
}
|
|
158
158
|
`,Ro={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:n,processedItem:l})=>["p-contextmenu-item",{"p-contextmenu-item-active":n.isItemActive(l),"p-focus":n.isItemFocused(l),"p-disabled":n.isItemDisabled(l)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Gn=(()=>{class n extends fn{name="contextmenu";theme=Do;classes=Ro;static \u0275fac=(()=>{let e;return function(i){return(e||(e=ze(n)))(i||n)}})();static \u0275prov=qe({token:n,factory:n.\u0275fac})}return n})();var Bo=(()=>{class n extends bt{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new Y;itemMouseEnter=new Y;menuFocus=new Y;menuBlur=new Y;menuKeydown=new Y;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,t,i=null){return e&&e.item?yt(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return ne(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let t=e.parentElement.parentElement,i=an(e.parentElement.parentElement),o=ht(),u=e.offsetParent?e.offsetWidth:xt(e),f=tn(t.children[0]);e.style.top="0px",parseInt(i.left,10)+f+u>o.width-on()?e.style.left=-1*u+"px":e.style.left=f+"px"}static \u0275fac=function(t){return new(t||n)(dt(Bt(()=>ut)))};static \u0275cmp=O({type:n,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&me(Wi,5),t&2){let o;H(o=U())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",pe],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",pe],autoZIndex:[2,"autoZIndex","autoZIndex",pe],baseZIndex:[2,"baseZIndex","baseZIndex",xe],popup:[2,"popup","popup",pe],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",xe],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",xe]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[ke],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(t,i){t&1&&d(0,Po,3,13,"ul",3),t&2&&s("ngIf",i.root?!0:i.visible)},dependencies:[n,N,z,je,F,jt,ft,V,B,gn,de,tt,_n,St,xn,Le],encapsulation:2,data:{animation:[_t("overlayAnimation",[Ve(":enter",[Ne({opacity:0})]),Ve(":leave",[Ne({opacity:0})])])]}})}return n})(),ut=(()=>{class n extends bt{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new Y;onHide=new Y;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=b(!1);relativeAlign;window;focused=!1;activeItemPath=b([]);focusedItemInfo=b({index:-1,level:0,parentKey:"",item:null});submenuVisible=b(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(Gn);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${ne(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,Zt(()=>{let t=this.activeItemPath();ne(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||pn("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return sn()||ln()}bindTriggerEventListener(){Fe(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(Fe(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,t=0,i={},o=""){let u=[];return e&&e.forEach((f,M)=>{let k=(o!==""?o+"_":"")+M,q={item:f,index:M,level:t,key:k,parent:i,parentKey:o};q.items=this.createProcessedItems(f.items,t+1,q,k),u.push(q)}),u}bindMatchMediaListener(){if(Fe(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?yt(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&ne(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&ne(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:u,key:f,level:M,parentKey:k,item:q}=t;this.activeItemPath.set(this.activeItemPath().filter(Re=>f!==Re.key&&f.startsWith(Re.key))),this.focusedItemInfo.set({index:u,level:M,parentKey:k,item:q}),Xe(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&mn(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(f=>f.key===t.parentKey);Ct(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let u=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(u),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=Ye(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&Ye(t,'a[data-pc-section="action"]');i?i.click():t&&t.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:o}=e;if(Ct(i))return;let{index:u,key:f,level:M,parentKey:k,items:q}=i,Re=ne(q),Nt=this.activeItemPath().filter(Vt=>Vt.parentKey!==k&&Vt.parentKey!==f);Re&&(Nt.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:u,level:M,parentKey:k,item:i.item}),o&&Xe(this.rootmenu.sublistViewChild.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(Nt)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),Xe(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):nn(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&vt.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&vt.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:xt(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:rn(this.containerViewChild.nativeElement),u=ht();e+i-this.document.scrollingElement.scrollLeft>u.width&&(e-=i),t+o-this.document.scrollingElement.scrollTop>u.height&&(t-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(u=>this.isItemMatched(u)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return ne(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return It(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?It(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),o=this.focusedItemInfo();o.index!==t&&(this.focusedItemInfo.set(I(C({},o),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=Ye(this.rootmenu.el.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Fe(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):cn(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(t){return new(t||n)(dt(un))};static \u0275cmp=O({type:n,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,o){if(t&1&&(Ge(o,Mo,4),Ge(o,ko,4),Ge(o,Te,4)),t&2){let u;H(u=U())&&(i.itemTemplate=u.first),H(u=U())&&(i.submenuIconTemplate=u.first),H(u=U())&&(i.templates=u)}},viewQuery:function(t,i){if(t&1&&(me(Oo,5),me(Fo,5)),t&2){let o;H(o=U())&&(i.rootmenu=o.first),H(o=U())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",pe],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",pe],baseZIndex:[2,"baseZIndex","baseZIndex",xe],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",xe]},outputs:{onShow:"onShow",onHide:"onHide"},features:[he([Gn]),ke],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(t,i){t&1&&d(0,Lo,4,23,"div",2),t&2&&s("ngIf",i.visible())},dependencies:[N,z,F,ft,Bo,V,de,St,Le],encapsulation:2,data:{animation:[_t("overlayAnimation",[Ve(":enter",[Ne({opacity:0}),gt("250ms")]),Ve(":leave",[gt(".1s linear",Ne({opacity:0}))])])]},changeDetection:0})}return n})(),Un=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=qt({type:n});static \u0275inj=$t({imports:[ut,Le,Le]})}return n})();var Ko=["editInput"],qo=["tree"],zo=["class","page"],Go=()=>({height:"calc(100vh - 70px)"});function Ho(n,l){n&1&&(a(0,"a",7),h(1,"i",8),p(2," Add"),r())}function Uo(n,l){if(n&1&&d(0,Ho,3,0,"a",6),n&2){let e=c();s("ngIf",e.roleService.coa.create)}}function Zo(n,l){if(n&1){let e=w();a(0,"input",15,4),Ze("ngModelChange",function(i){let o=_(e).$implicit;return Ue(o.label,i)||(o.label=i),g(i)}),v("keydown",function(i){_(e);let o=c(2);return g(o.handleEditKeydown(i))})("blur",function(i){_(e);let o=c(2);return g(o.onNodeEditBlur(i))}),r()}if(n&2){let e=l.$implicit;He("ngModel",e.label)}}function jo(n,l){if(n&1){let e=w();a(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-tree",12,2),v("onNodeContextMenuSelect",function(i){_(e);let o=c();return g(o.onNodeContextMenuSelect(i))})("onNodeSelect",function(i){_(e);let o=c();return g(o.onNodeSelect(i))})("onNodeUnselect",function(i){_(e);let o=c();return g(o.onNodeUnselect(i))})("onNodeDrop",function(i){_(e);let o=c();return g(o.onNodeDrop(i))}),d(5,Zo,2,1,"ng-template",13),r(),h(6,"p-contextmenu",14,3),r()()()}if(n&2){let e=X(7),t=c();m(2),_e(D(14,Go)),s("showHeader",!1),m(),s("virtualScroll",!0)("virtualScrollItemSize",40)("scrollHeight","calc(100vh - 110px)")("value",t.categoryTree())("contextMenu",e)("selection",t.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),m(3),s("model",t.contextMenuItems())}}var Zn=(()=>{class n{constructor(){this._coaTypesService=x(le),this._router=x(ee),this.roleService=x(we),this.contextMenuItems=b([]),this.categoryTree=b([]),this.selectedCategory=null,this._shouldAutoFocus=b(!1)}ngOnInit(){this._loadCategories().subscribe(),this._initializeContextMenuItems(),this.expandAllNodes()}ngAfterViewChecked(){this.selectedCategory&&!this._shouldAutoFocus()&&this.editInputRef&&(this.editInputRef.nativeElement.focus(),this.editInputRef.nativeElement.select(),this._shouldAutoFocus.set(!0))}_loadCategories(){return this._coaTypesService.fetchCOACategories().pipe(E("COA Categories"),T(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(t=>{let i=!!t.children?.length;return I(C({},t),{icon:void 0,expandedIcon:i?"fa-solid fa-folder-open":void 0,collapsedIcon:i?"fa-solid fa-folder":"fa-solid fa-file",children:i?this._assignTreeIcons(t.children):[]})})}_initializeContextMenuItems(){this.contextMenuItems.set([{label:"Add",icon:"fa-light fa-plus",disabled:!1,command:()=>this._createChildCategory()},{label:"Edit",icon:"fa-light fa-pen-to-square",disabled:!1,command:()=>this._setSelectedNodeToEditMode()},{label:"Delete",icon:"fa-light fa-trash",disabled:!1,command:()=>this._deleteSelectedCategory()},{label:"Properties",icon:"fa-light fa-file",disabled:!1,command:()=>{this._router.navigate(["/pages/chart-of-account/coa-types/info"],{queryParams:{ID:this.selectedCategory?.key}})}}])}_findNodeByKey(e){return this.treeComponent.getNodeWithKey(e,this.categoryTree())??null}_setSelectedNodeToEditMode(){let e=this._findNodeByKey(this.selectedCategory?.key);e&&(this.selectedCategory=e,e.type="edit")}_createChildCategory(){this.selectedCategory?.parent?.key&&this._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(R(e=>this._loadCategories().pipe(G(()=>e))),T(e=>{let t=this._findNodeByKey(e.id);t&&(this.selectedCategory=t,this._shouldAutoFocus.set(!1),t.type="edit")}),E("Created COA Node")).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(R(()=>this._loadCategories())).subscribe()}renameNode(e,t=this.selectedCategory){this._coaTypesService.renameCategory(t.key,{Name:e}).pipe(R(()=>this._loadCategories())).subscribe()}onNodeSelect(e){this.selectedCategory=e.node,this._shouldAutoFocus.set(!1),e.node.children?.length&&(e.node.icon="fa-solid fa-folder-open")}onNodeUnselect(e){e.node.children?.length&&(e.node.icon="fa-solid fa-folder")}onNodeContextMenuSelect(e){this.selectedCategory=e.node,["Asset","Liability","Equity","Revenue","Expense"].includes(e.node.label)?this.contextMenuItems.set(this.contextMenuItems().map(i=>["Edit","Delete"].includes(i.label)?I(C({},i),{disabled:!0}):I(C({},i),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(i=>i.label==="Add"?I(C({},i),{disabled:!this.roleService.coa.create}):i.label==="Edit"?I(C({},i),{disabled:!this.roleService.coa.edit}):i.label==="Delete"?I(C({},i),{disabled:!this.roleService.coa.delete}):I(C({},i),{disabled:!1})))}onNodeDrop(e){let{dragNode:t,dropNode:i}=e;this._coaTypesService.updateParentCategory(t.key,{ParentID:i.key}).pipe(T(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let t=e.target;this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&delete i.type}handleEditKeydown(e){let t=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&(delete i.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,t){e.expanded=t,e.children?.forEach(i=>this._expandRecursive(i,t))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type",8,"page"]],viewQuery:function(t,i){if(t&1&&(me(Ko,5),me(qo,5)),t&2){let o;H(o=U())&&(i.editInputRef=o.first),H(o=U())&&(i.treeComponent=o.first)}},features:[he([dn])],attrs:zo,decls:5,vars:0,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
|
|
159
159
|
`],["class","p-button","routerLink","add",4,"ngIf"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center"],[1,"col"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","virtualScroll","virtualScrollItemSize","scrollHeight","value","contextMenu","selection","draggableNodes","droppableNodes","propagateSelectionUp","propagateSelectionDown"],["pTemplate","edit"],["appendTo","body",3,"model"],["type","text",1,"form-control",3,"ngModelChange","keydown","blur","ngModel"]],template:function(t,i){t&1&&(a(0,"app-main-panel",5),d(1,Uo,1,1,"ng-template",null,0,y)(3,jo,8,15,"ng-template",null,1,y),r())},dependencies:[$,Nn,V,B,Un,ut,Te,N,F,ve,te,Z,Qe,K,hn,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Qo=["class","page"],Ot=n=>({"is-invalid":n}),Wo=n=>({"ng-invalid ng-dirty":n});function Yo(n,l){if(n&1){let e=w();a(0,"div",3)(1,"p-button",4),v("onClick",function(){_(e);let i=c();return g(i.goBack())}),r(),a(2,"p-button",5),v("onClick",function(){_(e);let i=c();return g(i.onSubmit())}),r()()}}function Xo(n,l){n&1&&(a(0,"div",20),p(1," Name is required "),r())}function Jo(n,l){n&1&&(a(0,"div",20),p(1," Code is required "),r())}function er(n,l){n&1&&(a(0,"div",20),p(1," Note is required "),r())}function tr(n,l){if(n&1&&(a(0,"div")(1,"span",22),p(2),r()()),n&2){let e=l.$implicit;m(2),A(e)}}function nr(n,l){if(n&1&&(a(0,"div"),d(1,tr,3,1,"div",21),r()),n&2){let e=c(2);m(),s("ngForOf",e.getErrors("Category"))}}function ir(n,l){if(n&1){let e=w();a(0,"p-panel")(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"label",11),p(7,"Name"),r(),h(8,"input",12),d(9,Xo,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),d(15,Jo,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),d(21,er,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),v("onFocus",function(){_(e);let i=c();return g(i.loadCategories())}),r(),d(27,nr,2,1,"div",19),r()()()()()()}if(n&2){let e=c();m(3),s("formGroup",e.form),m(5),s("ngClass",S(10,Ot,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),m(),s("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),m(5),s("ngClass",S(12,Ot,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),m(),s("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),m(5),s("ngClass",S(14,Ot,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),m(),s("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),m(5),s("ngClass",S(16,Wo,e.isInvalid("Category")))("options",e.categories()),m(),s("ngIf",e.isInvalid("Category"))}}var Ft=(()=>{class n extends Rn{constructor(){super(...arguments),this.categories=b([]),this.COATypeService=x(le),this.COAService=x(j),this.info=b(null),this.route=x(J),this.router=x(ee),this.fb=x(be)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Lt([this.route.paramMap.pipe(G(e=>e.get("id")),$e(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(E("fetchCOACategories"),R(([e,t])=>{let i=this.findNodeByKeyInArray(t,e);return this.categories.set(t),this.COATypeService.getCOACategoryByID({ID:e}).pipe(T(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:i.parent}),["Asset","Liability","Equity","Revenue","Expense"].includes(o.name)&&this.form.controls.Category.disable()}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(T(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new Yt({Name:new L("",[ue.required]),Code:new L("",[]),Category:new L(null,[ue.required]),Note:new L("",[])})}findNodeByKeyInArray(e,t){for(let i of e){let o=this.findNodeByKey(i,t);if(o)return o}return null}findNodeByKey(e,t,i=null){if(e.key===t||e.label===t)return i&&(e.parent=i),e;if(e.children&&e.children.length>0)for(let o of e.children){let u=this.findNodeByKey(o,t,e);if(u)return u}return null}onSubmit(){let{Name:e,Code:t,Note:i,Category:o}=this.form.value,u=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(u=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i,ID:this.route.snapshot.params.id||null}):(u=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(E("response"),T(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=ze(n)))(i||n)}})()}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type-form",8,"page"]],features:[ke],attrs:Qo,decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Category Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["label","Cancel","variant","outlined","severity","secondary",3,"onClick"],["label","Submit",3,"onClick"],[1,"row","justify-content-center"],[1,"col"],[1,"row","row-gap-2",3,"formGroup"],[1,"ol-12","col-md-6","col-lg-6"],[1,"form-group","has-validation"],["for",""],["formControlName","Name",1,"form-control",3,"ngClass"],["id","validationServer03Feedback","class","invalid-feedback",4,"ngIf"],[1,"col-12","col-md-6","col-lg-6"],["formControlName","Code",1,"form-control",3,"ngClass"],["formControlName","Note","placeholder","Enter a description for this COA category","id","floatingTextarea2",1,"form-control",2,"height","100px",3,"ngClass"],[1,"form-group","has-validation","d-flex","flex-column"],["showClear","","placeholder","Select a Category","formControlName","Category",1,"ng-invalid","ng-dirty",3,"onFocus","ngClass","options"],[4,"ngIf"],["id","validationServer03Feedback",1,"invalid-feedback"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(t,i){t&1&&(a(0,"app-main-panel",2),d(1,Yo,3,0,"ng-template",null,0,y)(3,ir,28,18,"ng-template",null,1,y),r()),t&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,V,Ee,Ae,Se,te,Z,Ce,Ie,ye,N,z,je,F,K,oe,ie,ae,re],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return n})();var or=n=>[n];function rr(n,l){if(n&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),n&2){let e=c(2);s("routerLink",S(1,or,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function ar(n,l){if(n&1&&(a(0,"div",6)(1,"div",7)(2,"p-card")(3,"div",8)(4,"div",9)(5,"div",10),p(6,"Name"),r(),a(7,"div",11),p(8),r()(),a(9,"div",9)(10,"div",10),p(11,"Code"),r(),a(12,"div",11),p(13),r()(),a(14,"div",9)(15,"div",10),p(16,"Category"),r(),a(17,"div",11),p(18),r()(),a(19,"div",9)(20,"div",10),p(21,"Note"),r(),a(22,"div",11),h(23,"div",12),r()()()()()()),n&2){let e=c(2);m(8),A(e.info().name),m(5),A(e.info().code),m(5),A(e.info().parentName),m(5),s("innerHTML",e.info().note,Me)}}function lr(n,l){n&1&&(se(0),a(1,"app-main-panel",3),d(2,rr,4,3,"ng-template",null,0,y)(4,ar,24,4,"ng-template",null,1,y),r(),ce())}var jn=(()=>{class n{constructor(){this.COATypeService=x(le),this.route=x(J),this.info=b(null)}ngOnInit(){this.route.queryParamMap.pipe(G(e=>e.get("ID")),R(e=>this.COATypeService.getCOACategoryByID({ID:e})),E("getCOACategoryByID"),T(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type-info"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],[4,"ngIf"],["pageTitle",`Type of Account Info
|
|
160
|
-
`],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(t,i){t&1&&d(0,lr,6,0,"ng-container",2),t&2&&s("ngIf",i.info())},dependencies:[N,F,$,K,nt,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var xs=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:Kn},{path:"account/add",component:kt},{path:"account/import",loadComponent:()=>import("./chunk-
|
|
160
|
+
`],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(t,i){t&1&&d(0,lr,6,0,"ng-container",2),t&2&&s("ngIf",i.info())},dependencies:[N,F,$,K,nt,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var xs=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:Kn},{path:"account/add",component:kt},{path:"account/import",loadComponent:()=>import("./chunk-BPAXVUBR.js").then(n=>n.CoaImportComponent)},{path:"account/:id",component:Bn},{path:"account/:id/edit",component:kt},{path:"coa-types",component:Zn},{path:"coa-types/add",component:Ft},{path:"coa-types/info",component:jn},{path:"coa-types/:id/edit",component:Ft}]}],qn={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{xs as CHART_OF_ACCOUNT_ROUTES,qn as CHART_OF_ACCOUNT_ROUTE_PAGE};
|