dealposbooks 5.49.3 → 5.49.4
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/style.scss +2 -4
- package/{chunk-ATFRJZK3.js → chunk-23PWXRYN.js} +1 -1
- package/{chunk-BJMEZV24.js → chunk-2RRP7JK7.js} +1 -1
- package/{chunk-V2P3PRZY.js → chunk-5JNGJ6UW.js} +1 -1
- package/{chunk-KJCHFIF4.js → chunk-672TXWSC.js} +1 -1
- package/{chunk-L3CQJPFS.js → chunk-6EIUS53G.js} +1 -1
- package/{chunk-DTAREQVV.js → chunk-7B7LNBD5.js} +1 -1
- package/{chunk-ES2YST7G.js → chunk-AVSCJ22B.js} +1 -1
- package/{chunk-UK5OOIPU.js → chunk-BEZIBXGN.js} +1 -1
- package/{chunk-PW4Y2UWU.js → chunk-BF6PW4QM.js} +1 -1
- package/{chunk-QFFI46W6.js → chunk-BMM5YFHU.js} +1 -1
- package/chunk-BP4OMNR2.js +8 -0
- package/{chunk-4G57L7HS.js → chunk-CFUVIXAX.js} +1 -1
- package/{chunk-QJ5XIVKM.js → chunk-CNMK2GSA.js} +1 -1
- package/{chunk-N6LQW4C4.js → chunk-DIG4FYVW.js} +1 -1
- package/chunk-ETNPJTRI.js +1 -0
- package/{chunk-ME4V3YFW.js → chunk-FOPCQ346.js} +1 -1
- package/{chunk-DJTQ4KQ7.js → chunk-FSJNWH2Y.js} +1 -1
- package/{chunk-XWXTYJHR.js → chunk-FZS2ZX6Y.js} +1 -1
- package/chunk-GEFAWOOV.js +129 -0
- package/{chunk-4OZIHMKI.js → chunk-GTMCB3SL.js} +1 -1
- package/{chunk-I2IEFBTX.js → chunk-H6FEO7T3.js} +1 -1
- package/{chunk-XJFNZBHG.js → chunk-HOAF22JI.js} +1 -1
- package/chunk-HU4J3ABZ.js +1 -0
- package/{chunk-YIEUIWT7.js → chunk-I33QA736.js} +1 -1
- package/{chunk-C5EDHVD7.js → chunk-IPOA3SOW.js} +1 -1
- package/{chunk-LOMHQKQX.js → chunk-IWAIAUMO.js} +1 -1
- package/chunk-JDRK7YG6.js +1 -0
- package/{chunk-RX37I2ZC.js → chunk-JIFUQXVH.js} +1 -1
- package/{chunk-UD23HDLE.js → chunk-KBR5PEJ3.js} +1 -1
- package/{chunk-OFLGX5N4.js → chunk-KNBVJM2U.js} +2 -2
- package/{chunk-OBT3IJJQ.js → chunk-L3GNPRRN.js} +1 -1
- package/{chunk-LUS3QGR4.js → chunk-OMLO5E65.js} +1 -1
- package/{chunk-VMI7LQOW.js → chunk-PK7RYZ5A.js} +1 -1
- package/{chunk-4UVBCZJG.js → chunk-PSSATQO3.js} +1 -1
- package/{chunk-OFI2JX7N.js → chunk-QC7NAJZG.js} +1 -1
- package/{chunk-D2CH2T3I.js → chunk-RAF7SWW4.js} +4 -4
- package/{chunk-26LXGKDF.js → chunk-RDQ7RWJC.js} +1 -1
- package/{chunk-A7OYELWP.js → chunk-RRL6OTRO.js} +1 -1
- package/{chunk-CTINUVLP.js → chunk-SLD2HX2B.js} +1 -1
- package/{chunk-NXJQMUGV.js → chunk-U5YVZKME.js} +1 -1
- package/{chunk-PZZCPZ6Q.js → chunk-URSKOWIQ.js} +1 -1
- package/{chunk-5LGAO5J4.js → chunk-V7EXGBKT.js} +1 -1
- package/{chunk-KGNH5JRZ.js → chunk-VFKJMUGN.js} +1 -1
- package/chunk-VQKIYDID.js +1 -0
- package/{chunk-C7ZPOAWO.js → chunk-W6US3XIE.js} +1 -1
- package/{chunk-IHKBTP2Y.js → chunk-WPJG57AR.js} +1 -1
- package/{chunk-E3SH454T.js → chunk-WSQPSWDS.js} +1 -1
- package/{chunk-IQ4SHFOC.js → chunk-X3FAXRYR.js} +1 -1
- package/{chunk-V65ONV6D.js → chunk-YIG2I6WR.js} +1 -1
- package/{chunk-SUWUVFH4.js → chunk-YRW7AH7I.js} +1 -1
- package/chunk-ZIQBCB5X.js +7 -0
- package/chunk-ZY4AYAWJ.js +202 -0
- package/index.html +2 -2
- package/{main-WMHNA6IG.js → main-VIRQJVUE.js} +1 -1
- package/package.json +1 -1
- package/{styles-FYY2LVCE.css → styles-T5RGO2FA.css} +1 -1
- package/chunk-3KEAMVYI.js +0 -202
- package/chunk-A3P24MDP.js +0 -129
- package/chunk-FQRRGJBE.js +0 -1
- package/chunk-LG5TMEPP.js +0 -1
- package/chunk-Q4KG7LH6.js +0 -1
- package/chunk-S6S265JY.js +0 -7
- package/chunk-WRTIQGAC.js +0 -8
- package/chunk-ZZEOPBUT.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=[{key:0,value:"Unknown"},{key:1,value:"Sales Order"},{key:2,value:"Purchase Order"},{key:5,value:"OutDelivery"},{key:6,value:"InDelivery"},{key:7,value:"Adjustment"},{key:8,value:"AR Collection"},{key:9,value:"Manufacture"},{key:10,value:"End of Shift"},{key:12,value:"Opening Balance"},{key:13,value:"AP Collection"},{key:14,value:"InTransfer"},{key:15,value:"OutTransfer"},{key:16,value:"Prepaid"}];function l(r){let e=null,u=s.map(i=>i.key).filter(i=>![0,12].includes(i)),a=r?.referenceTypeID?r?.referenceTypeID:r?.sourceTypeID;if(!u.includes(a))return null;let n=r.referenceID??r.id;switch(r.referenceText!=null&&r.referenceText!==void 0&&(r.referenceText.includes("#")?n=r.referenceID??r.id:n=r.id),a){case 1:e=`/menu/Orders/Orders/Customer_Invoice/Info?ID=${n}`;break;case 2:e=`/menu/Orders/Orders/Supplier_Bill/Info?ID=${n}`;break;case 5:e=`/menu/Logistics/Archive/Outbound_Logistics/Info?ID=${n}`;break;case 6:e=`/menu/Logistics/Archive/Inbound_Logistics/Info?ID=${n}`;break;case 7:e=`/menu/Adjustment/Adjustment/Archive/Info?ID=${n}`;break;case 8:e=`/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID=${n}`;break;case 9:e=`/menu/Manufacture/Job_Order/Archive/Info?ID=${n}`;break;case 10:e=`/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID=${n}`;break;case 12:e="#";break;case 13:e=`/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID=${n}`;break;case 14:e=`/menu/Logistics/Archive/Transfer_Order/Info?ID=${n}`;break;case 15:e=`/menu/Logistics/Archive/Transfer_Order/Info?ID=${n}`;break;case 16:e=`/menu/Prepaid_Package/Dashboard/Prepaid_History/Info?ID=${n}`;break;default:console.warn("Unknown reference type ID:",a),e=null}return e}export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-RM5HLXNW.js";import"./chunk-UPSNJEHO.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import{i as w}from"./chunk-
|
|
1
|
+
import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-RM5HLXNW.js";import"./chunk-UPSNJEHO.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import{i as w}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as S}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-VFKJMUGN.js";import{a as P}from"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{s as M}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as h,Ec as _,Ha as u,Pb as v,Sb as m,Sc as C,Ub as c,Vb as s,Wb as o,Xb as r,_ as f,ca as d,gc as g,ia as l,ib as n,sc as p,tc as x,uc as y,yb as b}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var D=(()=>{class e{constructor(){this.httpService=l(P)}getUserProfile(){return this.httpService.get(void 0,"api/MyProfile")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var A=()=>({height:"calc(100vh - 70px)"});function B(e,a){if(e&1&&(o(0,"div",10)(1,"div",11)(2,"p",12),p(3),r()()()),e&2){let t=a.$implicit;n(3),y(" ",t.roleName," ")}}function L(e,a){if(e&1&&(o(0,"div",4)(1,"div",5)(2,"div",6)(3,"span",7),p(4),r()()(),o(5,"div",8)(6,"div",9),c(7,B,4,1,"div",10,m),r()()()),e&2){let t=a.$implicit;n(4),x(t.roleGroupName),n(3),s(t.listRole)}}function $(e,a){if(e&1&&(o(0,"p-panel")(1,"p-tabs",2)(2,"p-tablist")(3,"p-tab",2),p(4,"Roles"),r()(),o(5,"p-tabpanels")(6,"p-tabpanel",2)(7,"div",3),c(8,L,9,1,"div",4,m),r()()()()()),e&2){let t,i=g();v(_(2,A)),n(8),s((t=i.roles())==null?null:t.Roles)}}var N=(()=>{class e{constructor(){this.profileService=l(D),this.roles=u(null)}ngOnInit(){this.profileService.getUserProfile().pipe(E("response"),f(t=>this.roles.set(t))).subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-my-profile"]],decls:3,vars:0,consts:[["content",""],["pageTitle","My Profile"],["value","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","50px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],[1,"col"],["formArrayName","roles",1,"row","h-100"],[1,"col-3","border-top","border-bottom","border-end","p-0","bg-white"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],[1,"fs-2","text-dark","m-0"]],template:function(i,G){i&1&&(o(0,"app-main-panel",1),h(1,$,10,3,"ng-template",null,0,C),r())},dependencies:[w,S,O,R,j,F,I,k,M,T],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding-top:0!important}"],changeDetection:0})}}return e})();var le=[{path:"",redirectTo:"my-profile",pathMatch:"full"},{path:"",children:[{path:"my-profile",component:N}]}];export{le as PROFILE_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as H}from"./chunk-
|
|
1
|
+
import{a as O,b as H}from"./chunk-PSSATQO3.js";import"./chunk-WPJG57AR.js";import{a as I,b as E}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as G}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as j,b as R}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as V,x as A,y as D,z as N}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-VFKJMUGN.js";import"./chunk-5DRALZZF.js";import{a as F}from"./chunk-2BI7WNJP.js";import{n as W,s as $}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as P,Eb as B,Ec as C,Mb as p,Oc as s,Pb as h,Pc as m,Sc as x,W as y,Wb as o,Xb as n,Y as T,Yb as c,_ as S,ac as w,fc as _,gc as l,h as v,ia as u,ib as a,qa as g,ra as d,s as f,sa as b,ta as k,yb as M}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();o(0,"div",3)(1,"p-button",4),_("onClick",function(){g(e);let r=l();return d(r.onFormat())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),_("onClick",function(){g(e);let r=l();return d(r.migrateWriteoffOutlet())}),n()()}if(i&2){let e=l();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function J(i,q){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),s(4,"async"),b(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let e=l();h(C(12,L)),a(),h(C(13,L)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var fe=(()=>{class i{constructor(){this.migrateService=u(O),this.toastr=u(F),this.refresh$=new v(void 0),this.pageTitle="Write-Off Outlet"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getWriteOffOutletAccountCount()),S(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(f(t=>Number(t.pos))),this.countInBooks$=e.pipe(f(t=>Number(t.books)))}migrateWriteoffOutlet(){this.migrateService.migrateWriteOffOutlet().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatWriteOff().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-writeoff-outlet"]],features:[P([O])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,z,5,6,"ng-template",null,0,x)(3,J,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,$,W,E,I,R,j,N,D,H,A,V],encapsulation:2})}}return i})();export{fe as WriteOffOutletComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-PKO36DGM.js";import{b as q}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-PKO36DGM.js";import{b as q}from"./chunk-WPJG57AR.js";import{a as z,b as H}from"./chunk-PGOSR3RI.js";import{a as J}from"./chunk-XKI7WLHE.js";import{a as O,b as W}from"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{i as I}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as G,b as A}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{o as j,w as k,x as B}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as y,e as D,f as M,k as T,l as w,o as N,u as V,x as R}from"./chunk-VMI3QWC6.js";import{d as P}from"./chunk-F7PVAVLQ.js";import"./chunk-VFKJMUGN.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{s as F}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as S,Eb as p,Mb as c,Sc as a,Wb as i,Xb as t,Yb as f,_ as C,ac as b,fc as E,gc as u,ia as m,ib as _,qa as x,ra as h,sc as l,yb as v}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";function L(e,d){if(e&1){let o=b();i(0,"p-button",4),E("onClick",function(){x(o);let n=u();return h(n.onSubmit())}),t()}}function Q(e,d){e&1&&(i(0,"div",13)(1,"h3",14),l(2,"General"),t(),i(3,"span",15),l(4,"Enter your closing Fiscal Date"),t()())}function U(e,d){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,Q,5,0,"ng-template",null,2,a),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),l(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),l(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=u();_(7),c("formGroup",o.form)}}var he=(()=>{class e extends J{constructor(){super(),this.closingEntriesService=m(K),this.dayjsService=m(q),this.fb=m(V),this.router=m(P)}ngOnInit(){this.initForm()}initForm(){this.form=this.fb.group({Period:this.fb.control(new Date),Note:this.fb.control("")})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{Period:o}=this.form.getRawValue(),r=Object.entries(this.form.getRawValue()).reduce((n,[s,g])=>(s==="Period"?n[s]=this.dayjsService.from(o)?this.dayjsService.format(g):"":n[s]=g,n),{});this.closingEntriesService.createClosingEntry(r).pipe(C(()=>{this.router.navigate(["/pages/accounting-setup/closing-entries"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-closing-form"]],features:[S],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Closing Entries Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"col-4"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","Period","fluid",""],["formControlName","Note","rows","5","cols","30","pTextarea",""],[1,"d-flex","flex-column","mx-2"],[1,"fs-5","m-0"],[1,"fs-3"]],template:function(r,n){r&1&&(i(0,"app-main-panel",3),p(1,L,1,0,"ng-template",null,0,a)(3,U,16,1,"ng-template",null,1,a),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[I,F,A,G,W,O,j,H,z,B,k,R,T,y,D,M,w,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{he as ClosingFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-JIFUQXVH.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-YIG2I6WR.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-SLD2HX2B.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-H6FEO7T3.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-IPOA3SOW.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-GTMCB3SL.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-BEZIBXGN.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-QC7NAJZG.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-RRL6OTRO.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b as L}from"./chunk-
|
|
1
|
+
import{a as C,b as L}from"./chunk-PSSATQO3.js";import"./chunk-WPJG57AR.js";import{a as E,b as V}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as H}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as R,b as D}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as j,x as O,y as N,z as G}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-VFKJMUGN.js";import"./chunk-5DRALZZF.js";import{a as I}from"./chunk-2BI7WNJP.js";import{n as $,s as F}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as w,Eb as A,Ec as _,Mb as p,Oc as c,Pb as x,Pc as l,Sc as T,W as y,Wb as n,Xb as o,Y as M,Yb as m,_ as S,ac as P,fc as h,gc as s,h as v,ia as f,ib as a,qa as g,ra as d,s as u,sa as b,ta as k,yb as B}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),m(3,"app-migration-cards",7),c(4,"async"),b(),n(5,"svg",8),m(6,"path",9),o(),k(),m(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,q)),a(),x(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(C),this.toastr=f(I),this.refresh$=new v(void 0),this.pageTitle="Tax Account"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getTaxAccountCount()),S(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatTaxAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-tax-account"]],features:[w([C])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,T)(3,K,9,14,"ng-template",null,1,T),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as TaxAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-672TXWSC.js";import{d as r}from"./chunk-F7PVAVLQ.js";import{ia as e}from"./chunk-6QJHEOXN.js";var f=(a,o)=>{let t=e(i),s=e(r),n=t.isAuthenticated(),u=!t.isTokenExpired(),c=t.checkAuthKeysExists();return!n||!u||!c?(s.navigate(["/"],{queryParams:{returnUrl:o.url}}),!1):!0};export{f as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _t}from"./chunk-ARJ7OCQO.js";import{a as qi,b as zi}from"./chunk-PGOSR3RI.js";import{a as Gi}from"./chunk-XKI7WLHE.js";import{a as Di}from"./chunk-B4C3ZPN6.js";import{a as $i,b as Ee,c as Pe,d as Ki}from"./chunk-HCJK6VTO.js";import{a as Ri,b as Bi}from"./chunk-ELMSU4U7.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import{a as ut,b as ft}from"./chunk-2VZ7JZIO.js";import{a as we}from"./chunk-6WWXJJID.js";import"./chunk-U2VDC52W.js";import{a as lt,b as st}from"./chunk-3VQUNDVT.js";import{a as pt,b as dt,c as Oi,d as Fi,i as Li,j as Ni,k as Vi}from"./chunk-DGACZ747.js";import"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as X}from"./chunk-CAS5GLLU.js";import{a as V}from"./chunk-BT7Y4ADP.js";import{b as Si}from"./chunk-DJXQKSLT.js";import{a as bi}from"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import{a as ct,b as mt}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{a as at,b as K}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{f as Mi,i as $}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as se,b as ce}from"./chunk-AD247LWQ.js";import{b as J,c as Ai,d as wi,f as Ei,g as Pi,h as ki}from"./chunk-BKTBVFNX.js";import{c as et,d as li,f as si}from"./chunk-ZFNIPERQ.js";import{a as wt,f as Et,n as nt,o as ot,p as vi,t as Ti,u as Pt,w as ae,x as le,y as rt,z as _e}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Aa as hi,D as bt,Da as xi,I as ci,Ia as Ci,K as mi,La as Ae,M as pi,Ma as De,Oa as yi,Q as tt,R as it,Ua as Ii,W as di,X as vt,_ as ui,b as oe,c as fe,da as fi,e as Y,f as ye,g as ri,ga as _i,i as N,j as Je,k as ai,ka as gi,l as Ie,na as St,o as be,qa as re,u as ve,va as Tt,w as Se,wa as At,x as Te}from"./chunk-VMI3QWC6.js";import{b as ie,d as ne,e as B,l as L}from"./chunk-F7PVAVLQ.js";import"./chunk-KGNH5JRZ.js";import{a as oi}from"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as z,j as Ye,k as O,l as Ct,m as ii,p as ni,q as Xe,s as F,t as Le}from"./chunk-ZK43JB4A.js";import{c as yt,d as It,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{$c as Ce,Aa as ee,Cb as Oe,D as Ke,Dc as he,Eb as u,Ec as R,Fc as T,Gc as ei,Ha as v,J as qe,L as qt,Lb as P,Mb as l,Oc as de,P as zt,Pb as He,Pc as xe,Qb as Fe,Qc as ti,Rb as Qt,Sb as Wt,Sc as I,Ub as Yt,Vb as Xt,Wb as a,Xb as r,Y as D,Yb as h,Zb as H,_ as A,_b as U,_c as ue,ac as w,ba as Gt,bd as W,c as $e,ca as ze,cd as We,da as Ht,db as Me,eb as jt,fc as S,gc as m,ia as x,ib as c,lc as Ue,mc as pe,nc as j,ob as xt,oc as Z,qa as _,ra as g,rc as te,s as G,sc as p,t as Kt,tc as E,ua as Ge,uc as Q,wa as Ut,wc as Jt,xc as je,yb as M,yc as Ze,zb as Zt,zc as Qe}from"./chunk-6QJHEOXN.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var on=["class","page"],rn=t=>({id:t}),an=()=>({"overflow-x":"auto"}),ln=t=>({"table-borderless":t}),sn=t=>["fa-solid",t],cn=t=>["/pages/journal/journal-entry/",t];function mn(t,s){t&1&&h(0,"p-button",8)}function pn(t,s){if(t&1){let e=w();a(0,"p-button",9),S("onClick",function(){_(e);let n=m(2);return g(n.onDelete())}),r()}}function dn(t,s){if(t&1&&(a(0,"div",4)(1,"p-button-group"),u(2,mn,1,0,"p-button",5)(3,pn,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,i=m();c(2),l("ngIf",i.roleService.coa().edit),c(),l("ngIf",i.roleService.coa().delete),c(),l("queryParams",T(3,rn,(e=i.COAInfo())==null?null:e.id))}}function un(t,s){if(t&1&&h(0,"i",25),t&2){let e=s.checked;l("ngClass",T(1,sn,e?"fa-check":"fa-xmark"))}}function fn(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.debitAmount)," ")}}function _n(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.creditAmount)," ")}}function gn(t,s){if(t&1&&(a(0,"tr")(1,"td"),p(2),de(3,"date"),r(),a(4,"td")(5,"div",26)(6,"a",27),p(7),r()()(),a(8,"td",28),u(9,fn,3,3,"ng-container",29),r(),a(10,"td",30),u(11,_n,3,3,"ng-container",29),r(),a(12,"td",31),p(13),de(14,"number"),r()()),t&2){let e=s.$implicit;c(2),E(ti(3,6,e.date,"dd MMM yyyy")),c(4),l("routerLink",T(11,cn,e.id)),c(),E(e.number),c(2),l("ngIf",e.debitAmount!==0),c(2),l("ngIf",e.creditAmount!==0),c(2),Q(" ",xe(14,9,e.balance)," ")}}function hn(t,s){t&1&&(a(0,"tr")(1,"td",32)(2,"div",33),h(3,"img",34),a(4,"div",26)(5,"span",35),p(6,"No Data Available"),r(),a(7,"span",35),p(8,"Your data will be shown here once it's available"),r()()()()())}function xn(t,s){if(t&1){let e=w();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Tag"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),S("onChange",function(n){_(e);let o=m(2);return g(o.onDiscontinued(n))}),u(34,un,1,3,"ng-template",null,2,I),r()()(),a(36,"div",16)(37,"div",17),p(38,"Access Type"),r(),a(39,"div",18),p(40),r()()()()(),a(41,"div",20)(42,"p-card",21)(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),p(47,"Date"),r(),a(48,"th",23),p(49,"Number"),r(),a(50,"th",24),p(51,"Debit"),r(),a(52,"th",24),p(53,"Credit"),r(),a(54,"th",24),p(55,"Balance"),r()()(),a(56,"tbody"),Yt(57,gn,15,13,"tr",null,Wt),u(59,hn,9,0,"tr"),r()()()()()}if(t&2){let e,i,n,o,d,f,b=m(2);c(8),E((e=b.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),E((i=b.COAInfo().code)!==null&&i!==void 0?i:"-"),c(5),E((n=b.COAInfo().category)!==null&&n!==void 0?n:"-"),c(5),E((o=b.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),E((d=b.COAInfo().outletName)!==null&&d!==void 0?d:"-"),c(5),l("ngModel",b.COAInfo().bin),c(7),E((f=b.COAInfo().accessType)!==null&&f!==void 0?f:"-"),c(2),He(R(11,an)),c(),l("ngClass",T(12,ln,b.COAInfo().transactions.length===0)),c(14),Xt(b.COAInfo().transactions),c(2),Qt(b.COAInfo().transactions.length===0?59:-1)}}function Cn(t,s){if(t&1&&(a(0,"div",10),u(1,xn,60,14,"div",11),r()),t&2){let e=m();c(),l("ngIf",e.COAInfo())}}var Hi=(()=>{class t{constructor(){this.#e=x(X),this.#t=x(ie),this.router=x(ne),this.COAInfo=v(null),this.checked=v(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(V("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),A(e=>this.COAInfo.set(e)),V("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let i=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(i).pipe(A(()=>{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(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:on,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[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"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-5"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-4"],[1,"col"],[3,"onChange","ngModel"],[1,"col","col-lg-7"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],["scope","col",1,"text-end"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-success","text-end"],[4,"ngIf"],[1,"text-danger","text-end"],[1,"text-end"],["colspan","5",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://resc.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(i,n){i&1&&(a(0,"app-main-panel",3),u(1,dn,6,5,"ng-template",null,0,I)(3,Cn,2,1,"ng-template",null,1,I),r()),i&2&&l("overflowScroll",!0)},dependencies:[F,z,O,Xe,ni,Se,Y,Je,et,L,B,$,K,at,le,ae,ft,ut,Oi,Di],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var me=(()=>{class t{constructor(){this.httpService=x(oi)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let i={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",i)}renameCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,i)}updateParentCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,i).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,i={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Mt=t=>t?t.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...Mt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var Ot=(t,s,e)=>{let i=Math.ceil(e/s),n=(t-1)*s+1,o=Math.min(t*s,e);return{start:n,end:o,totalRecords:e,totalPages:i}};var yn={filter:{PageSize:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2,AccessLevel:-1},options:{entities:[],categories:[],accessLevels:[]},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"}]},Ft=Ai(Pi(yn),ki("ChartOfAccount"),wi(t=>({isAllChecked:W(()=>t.data().every(s=>s.checked)),checkedItems:W(()=>t.data().filter(s=>s.checked)),IDsChecked:W(()=>t.data().filter(s=>s.checked).map(s=>s.id)),categories:W(()=>Mt(t.options.categories())),first:W(()=>{let{start:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s}),last:W(()=>{let{end:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s})})),Ei(t=>{let s=x(X),e=x(me),i={updateFilter(n){J(t,{filter:C({},n)})},checkedItem(n){if(Array.isArray(n))n.forEach(o=>{let d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})});else{let o=n,d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})}},checkAllCheckbox(){let n=t.data().map(o=>y(C({},o),{checked:!o.checked}));J(t,{data:n})},fetchChartOfAccount:lt($e(Ke(()=>!!t.filter()),qt(300),zt(),D(n=>s.getPaginatedChartAccounts(n).pipe(G(o=>y(C({},o),{data:o.data.map(d=>y(C({},d),{checked:!1}))})),st({next:o=>J(t,{data:o.data,count:o.count}),error:o=>{J(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:lt($e(D(()=>s.getChartOfAccountLoader().pipe(st({next:n=>{J(t,{filter:y(C({},t.filter()),{PageSize:n.filter.pageSize,PageNumber:1,CategoryID:n.filter.categoryID||null,Text:"",listOutletID:[],AccessLevel:n.filter.accessLevel!==void 0?n.filter.accessLevel:t.filter().AccessLevel}),options:n.options}),i.fetchChartOfAccount(t.filter)},error:n=>{console.error(n)}}))))),getCategories:lt($e(qe(()=>e.fetchCOACategories().pipe(st({next:n=>{J(t,{options:y(C({},t.options()),{entities:t.options.entities(),categories:n})})},error:n=>{console.error(n)}})))))};return i}));var Sn=["class","page"],Tn=t=>["../account/",t],An=t=>({"text-decoration-line-through":t}),wn=()=>["/pages/report/general-ledger"],En=t=>({id:t});function Pn(t,s){if(t&1){let e=w();a(0,"p-button",13),S("onClick",function(){_(e);let n=m(2);return g(n.deleteCOA())}),r()}}function kn(t,s){t&1&&h(0,"p-button",14)}function Mn(t,s){if(t&1){let e=w();a(0,"p-button",15),S("onClick",function(){_(e);let n=m(2);return g(n.onExport())}),r()}}function On(t,s){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Fn(t,s){if(t&1&&(a(0,"div",8),u(1,Pn,1,0,"p-button",9),a(2,"p-button-group"),u(3,kn,1,0,"p-button",10)(4,Mn,1,0,"p-button",11),r(),u(5,On,3,0,"a",12),r()),t&2){let e=m();c(),l("ngIf",e.store.checkedItems().length&&e.roleService.coa().delete),c(2),l("ngIf",e.roleService.coa().create),c(),l("ngIf",e.roleService.global().export),c(),l("ngIf",e.roleService.coa().create)}}function Ln(t,s){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Nn(t,s){if(t&1&&(a(0,"tr"),u(1,Ln,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,"Tag"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),l("ngIf",e.roleService.coa().delete)}}function Vn(t,s){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),l("value",e)}}function Dn(t,s){if(t&1&&(a(0,"tr"),u(1,Vn,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),de(14,"number"),r()()()),t&2){let e,i=s.$implicit,n=m(2);c(),l("ngIf",n.roleService.coa().delete),c(2),E(i.code),c(2),l("routerLink",T(12,Tn,i.id))("ngClass",T(14,An,i.bin)),c(),E(i.name),c(2),E(i.category),c(2),E(i.outletName),c(2),l("routerLink",R(16,wn))("queryParams",T(17,En,i.id)),c(),E(xe(14,10,(e=i.balance)!==null&&e!==void 0?e:0))}}function Rn(t,s){if(t&1&&p(0),t&2){let e=m(2);Jt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Bn(t,s){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function $n(t,s){if(t&1){let e=w();a(0,"p-panel")(1,"p-table",18),S("onLazyLoad",function(n){_(e);let o=m();return g(o.loadData(n))})("onRowSelect",function(n){_(e);let o=m();return g(o.onRowSelect(n))})("onRowUnselect",function(n){_(e);let o=m();return g(o.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){_(e);let o=m();return g(o.onSelectAll(n))})("onPage",function(n){_(e);let o=m();return g(o.onPageChange(n))}),u(2,Nn,12,1,"ng-template",null,3,I)(4,Dn,15,19,"ng-template",null,4,I)(6,Rn,1,3,"ng-template",null,5,I)(8,Bn,4,0,"ng-template",null,6,I),r()()}if(t&2){let e=m();c(),l("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.count())}}function Kn(t,s){if(t&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Tag"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),S("onFocus",function(){_(e);let n=m(2);return g(n.onCategoryFocus())}),r()(),a(9,"div",29)(10,"label",30),p(11,"Access Level"),r(),h(12,"p-select",33),r(),a(13,"div",34)(14,"label",30),p(15,"Page Size"),r(),h(16,"input",35),r(),a(17,"div",34)(18,"label",30),p(19,"Discontinued"),r(),a(20,"div",36)(21,"div",37),h(22,"p-radiobutton",38),a(23,"label",39),p(24,"No"),r()(),a(25,"div",37),h(26,"p-radiobutton",40),a(27,"label",41),p(28,"Yes"),r()(),a(29,"div",37),h(30,"p-radiobutton",40),a(31,"label",41),p(32,"All"),r()()()()()}if(t&2){let e=m(2);l("formGroup",e.formFilter),c(4),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),l("fluid",!0)("showClear",!0)("options",e.categoryNodes()),c(4),l("showClear",!0)("options",e.store.options().accessLevels),c(10),l("value",0),c(4),l("value",1),c(4),l("value",2)}}function qn(t,s){if(t&1&&u(0,Kn,33,13,"form",27),t&2){let e=m();l("ngIf",e.formFilter)}}var ji=(()=>{class t{ngOnInit(){this.initializeFilterEffect(),this.store.fetchLoader()}#e;constructor(){this.routeInfo=Zi,this.store=x(Ft),this.#e=x(X),this.modalService=x(li),this.roleService=x(we),this.dialogVisible=v(!1),this.categoryNodes=v([]),this.fb=x(ve),this.injector=x(Ut),this.isDialogFilterVisible=v(!1)}initializeFilterEffect(){We(()=>{this.store.filter()&&this.generateFilterForm()},{injector:this.injector})}generateFilterForm(){let e=this.store.filter();this.formFilter=this.fb.group({outletID:this.fb.control(e.listOutletID||[]),categoryID:this.fb.control(null),pageSize:this.fb.control(e.PageSize),discontinued:this.fb.control(e.Discontinued),accessLevel:this.fb.control(e.AccessLevel)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(A(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(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,i){this.store.updateFilter(y(C({},this.store.filter()),{[e]:i}))}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(V("response"),A(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:1,Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:i,outletID:n,discontinued:o,accessLevel:d}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:n,CategoryID:e?e.key:"",PageSize:+i,Discontinued:o,AccessLevel:d})),this.isDialogFilterVisible.update(f=>!f)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportPageSize:1e4});this.#e.exportChartOfAccounts(e).pipe(A(i=>{let n=i.headers;console.log("All headers:",n.keys());let o=n.get("Content-Disposition"),d=n.get("content-disposition"),f=o??d,b="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(b=decodeURIComponent(q[1].replace(/"/g,"")))}let k=i.body;Ki(k,b,k.type)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[he([Ft])],attrs:Sn,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 Tags",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["scrollHeight","300px","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",3,"onFocus","fluid","showClear","options"],["appendTo","body","formControlName","accessLevel","optionLabel","value","optionValue","key","placeholder","Select an Access Level",3,"showClear","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(i,n){if(i&1){let o=w();a(0,"app-main-panel",7),S("search",function(f){return _(o),g(n.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(n.isDialogFilterVisible,f)||(n.isDialogFilterVisible=f),g(f)}),S("filterEmitted",function(){return _(o),g(n.onFilterEvent())})("filterConfirmed",function(){return _(o),g(n.onFilterOKEvent())}),u(1,Fn,6,4,"ng-template",null,0,I)(3,$n,10,5,"ng-template",null,1,I)(5,qn,1,1,"ng-template",null,2,I),r()}i&2&&(l("isSearchableInput",!0),je("isDialogFilterVisible",n.isDialogFilterVisible),l("isFilterable",!0)("scrollable",!0))},dependencies:[F,z,O,Xe,$,si,ft,ut,_t,Se,ai,oe,Y,ye,L,B,Te,Ie,be,et,Vi,Fi,Li,Ni,K,Mi,le,ae,mt,ct,ot,nt,_e,Bi,Ri,Pe,Ee,ce,se,dt,pt],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 t})();var Gn=["class","page"],Hn=()=>["../../"],Nt=t=>({"ng-invalid ng-dirty":t}),Un=t=>({"ng-dirty ng-invalid":t});function jn(t,s){if(t&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}t&2&&(c(),l("routerLink",R(1,Hn)))}function Zn(t,s){t&1&&(a(0,"div",34),p(1," Name is required "),r())}function Qn(t,s){if(t&1&&(a(0,"div"),u(1,Zn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Name.errors.required)}}function Wn(t,s){t&1&&(a(0,"div",35)(1,"p"),p(2," If you assign an tags for this account, it is only visible for users who has access to that tags. "),r()())}function Yn(t,s){if(t&1&&(a(0,"span",36),p(1),r()),t&2){let e=s.$implicit;l("pTooltip",e.name),c(),Q(" ",e.name," ")}}function Xn(t,s){t&1&&(a(0,"div",34),p(1," Code is required "),r())}function Jn(t,s){if(t&1&&(a(0,"div"),u(1,Xn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Code.errors.required)}}function eo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function to(t,s){if(t&1&&(a(0,"div"),u(1,eo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function io(t,s){if(t&1&&p(0),t&2){let e=s.$implicit;Q(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function no(t,s){t&1&&(a(0,"div",34),p(1," Category is required "),r())}function oo(t,s){if(t&1&&(a(0,"div"),u(1,no,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Category.errors.required)}}function ro(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function ao(t,s){if(t&1&&(a(0,"div"),u(1,ro,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function lo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function so(t,s){if(t&1&&(a(0,"div"),u(1,lo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function co(t,s){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"label",13),p(6,"Name"),r(),h(7,"input",14),u(8,Qn,2,1,"div",15),r()(),a(9,"div",11)(10,"div",16)(11,"label",13),p(12,"Tag"),r(),a(13,"span",17),h(14,"i",18),r(),u(15,Wn,3,0,"ng-template",null,2,I),r(),a(17,"p-select",19),u(18,Yn,2,2,"ng-template",null,3,I),r()()(),a(20,"div",10)(21,"div",11)(22,"div",12)(23,"label",13),p(24,"Code"),r(),h(25,"input",20),u(26,Jn,2,1,"div",15),r()(),a(27,"div",11)(28,"div",12)(29,"label",13),p(30,"Discontinued"),r(),a(31,"div",10)(32,"div",21),h(33,"p-radiobutton",22),a(34,"label",23),p(35,"No"),r()(),a(36,"div",24),h(37,"p-radiobutton",25),a(38,"label",26),p(39,"Yes"),r()()(),u(40,to,2,1,"div",15),r()()(),a(41,"div",10)(42,"div",11)(43,"div",27)(44,"label",13),p(45,"Category"),r(),a(46,"p-treeselect",28),u(47,io,1,1,"ng-template",29),r(),u(48,oo,2,1,"div",15),r()(),a(49,"div",11)(50,"div",12)(51,"label",13),p(52,"Access Type"),r(),a(53,"div",10)(54,"div",30),h(55,"p-select",31),r()(),u(56,ao,2,1,"div",15),r()()(),a(57,"div",10)(58,"div",11)(59,"div",12)(60,"label",13),p(61,"Note"),r(),h(62,"textarea",32),u(63,so,2,1,"div",15),r()(),h(64,"div",11),r()()()),t&2){let e=te(16),i=m();l("formGroup",i.form),c(7),l("ngClass",T(21,Nt,i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched))),c(),l("ngIf",i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched)),c(5),l("pTooltip",e),c(4),l("fluid",!0)("options",i.outlets()),c(8),l("ngClass",T(23,Nt,i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched))),c(),l("ngIf",i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched)),c(7),l("value",!1),c(4),l("value",!0),c(3),l("ngIf",i.form.controls.Note.errors),c(6),l("fluid",!0)("options",i.categoryOptions())("ngClass",T(25,Un,i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched))),c(2),l("ngIf",i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched)),c(7),l("options",i.accessTypes())("fluid",!0),c(),l("ngIf",i.form.controls.Note.errors),c(6),l("ngClass",T(27,Nt,i.form.controls.Note.invalid&&(i.form.controls.Note.dirty||i.form.controls.Note.touched)))("autoResize",!0),c(),l("ngIf",i.form.controls.Note.errors)}}var Vt=(()=>{class t{constructor(){this.route=x(ie),this.coa_service=x(X),this.coa_info=v(null),this.fb=x(ve),this.isEdit=v(!1),this.categoryOptions=v([]),this.router=x(ne),this.outlets=W(()=>this.coa_info()?this.coa_info().options.entities:[]),this.accessTypes=W(()=>{let e=["This Chart of Account can be viewed by all users.","Restricted access, only visible to users with the private role"];return this.coa_info()?this.coa_info().options.coaAccessType.map((i,n)=>y(C({},i),{description:e[n]})):[]})}findParenChilds(e,i){function n(o,d=null){for(let f of o){if(f.key===i)return{parent:d,child:f};if(f.children){let b=n(f.children,f);if(b)return b}}return null}return n(e)}generateForm(e){this.form=this.fb.group({ID:new N(e.id||""),Name:new N(e.name||"",[fe.required]),Code:new N(e.code||"",[fe.required]),Note:new N(e.note||"",[]),Balance:new N(e.balance||0),Outlet:new N(e.outletID||""),AccessType:new N(e.accessTypeID||0),Category:new N(null,[fe.required]),Bin:new N(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(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let i=e.get("id");return this.coa_service.getChartAccountFormById(i)}else return this.coa_service.getChartAccountForm()}),V("response"),G(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),A(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:i,Category:n,Code:o,Name:d,Note:f,Outlet:b}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:n.key,name:d,bin:this.form.value.Bin||!1,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:n.key,bin:this.form.value.Bin||!1,name:d,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(V("response"),A(e=>{this.categoryOptions.set(e);let i=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(i?.child)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:Gn,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",3,"formGroup"],[1,"d-flex","flex-column","gap-2"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],[1,"d-flex","align-items-baseline","gap-2"],[3,"pTooltip"],[1,"fa-solid","fa-circle-info"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"fluid","options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"col-3","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[1,"col","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"fluid","options","ngClass"],["pTemplate","value"],[1,"col"],["optionLabel","value","optionValue","key","formControlName","AccessType","placeholder","Select Access Type",3,"options","fluid"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass","autoResize"],["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"]],template:function(i,n){i&1&&(a(0,"app-main-panel",4),u(1,jn,4,2,"ng-template",null,0,I)(3,co,65,29,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,Te,oe,Y,ye,Ie,be,_t,F,z,O,L,B,Pe,Ee,Ae,K,ot,nt,zi,qi,mt,ct,_e,rt,le,ae,ce,se,dt,pt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var mo=["sublist"],po=(t,s)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":s}),uo=()=>({"p-contextmenu-item-link":!0}),Yi=()=>({class:"p-contextmenu-submenu-icon"}),fo=()=>({exact:!1}),_o=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),go=t=>({$implicit:t});function ho(t,s){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,i=m(2);He(i.getItemProp(e,"style")),l("ngClass",i.getSeparatorItemClass(e)),P("id",i.getItemId(e))("data-pc-section","separator")}}function xo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Co(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function yo(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function Io(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function bo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function vo(t,s){}function So(t,s){t&1&&u(0,vo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function To(t,s){if(t&1&&(H(0),u(1,bo,1,4,"AngleRightIcon",23)(2,So,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function Ao(t,s){if(t&1&&(a(0,"a",15),u(1,xo,1,5,"span",16)(2,Co,2,2,"span",17)(3,yo,1,2,"ng-template",null,2,I)(5,Io,1,2,"p-badge",18)(6,To,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("target",n.getItemProp(i,"target"))("ngClass",R(12,uo)),P("href",n.getItemProp(i,"url"),jt)("aria-hidden",!0)("data-automationid",n.getItemProp(i,"automationId"))("data-pc-section","action")("tabindex",-1),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function wo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Eo(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function Po(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function ko(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function Mo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Oo(t,s){}function Fo(t,s){t&1&&u(0,Oo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function Lo(t,s){if(t&1&&(H(0),u(1,Mo,1,4,"AngleRightIcon",23)(2,Fo,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function No(t,s){if(t&1&&(a(0,"a",26),u(1,wo,1,5,"span",16)(2,Eo,2,2,"span",17)(3,Po,1,2,"ng-template",null,2,I)(5,ko,1,2,"p-badge",18)(6,Lo,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("routerLink",n.getItemProp(i,"routerLink"))("queryParams",n.getItemProp(i,"queryParams"))("routerLinkActiveOptions",n.getItemProp(i,"routerLinkActiveOptions")||R(20,fo))("target",n.getItemProp(i,"target"))("ngClass",T(21,_o,n.getItemProp(i,"disabled")))("fragment",n.getItemProp(i,"fragment"))("queryParamsHandling",n.getItemProp(i,"queryParamsHandling"))("preserveFragment",n.getItemProp(i,"preserveFragment"))("skipLocationChange",n.getItemProp(i,"skipLocationChange"))("replaceUrl",n.getItemProp(i,"replaceUrl"))("state",n.getItemProp(i,"state")),P("data-automationid",n.getItemProp(i,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function Vo(t,s){if(t&1&&(H(0),u(1,Ao,7,13,"a",13)(2,No,7,23,"a",14),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngIf",!i.getItemProp(e,"routerLink")),c(),l("ngIf",i.getItemProp(e,"routerLink"))}}function Do(t,s){}function Ro(t,s){t&1&&u(0,Do,0,0,"ng-template")}function Bo(t,s){if(t&1&&(H(0),u(1,Ro,1,0,null,24),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",T(2,go,e.item))}}function $o(t,s){if(t&1){let e=w();a(0,"p-contextmenu-sub",27),S("itemClick",function(n){_(e);let o=m(4);return g(o.itemClick.emit(n))})("itemMouseEnter",function(n){_(e);let o=m(4);return g(o.onItemMouseEnter(n))}),r()}if(t&2){let e=m(2).$implicit,i=m(2);l("items",e.items)("itemTemplate",i.itemTemplate)("menuId",i.menuId)("visible",i.isItemActive(e)&&i.isItemGroup(e))("activeItemPath",i.activeItemPath)("focusedItemId",i.focusedItemId)("level",i.level+1)}}function Ko(t,s){if(t&1){let e=w();a(0,"li",9,1)(2,"div",10),S("click",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemClick(n,o))})("mouseenter",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemMouseEnter({$event:n,processedItem:o}))}),u(3,Vo,3,2,"ng-container",11)(4,Bo,2,4,"ng-container",11),r(),u(5,$o,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),i=e.$implicit,n=e.index,o=m(2);Fe(o.getItemProp(i,"styleClass")),l("ngStyle",o.getItemProp(i,"style"))("ngClass",o.getItemClass(i))("tooltipOptions",o.getItemProp(i,"tooltipOptions")),P("id",o.getItemId(i))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(i))("data-p-focused",o.isItemFocused(i))("data-p-disabled",o.isItemDisabled(i))("aria-label",o.getItemLabel(i))("aria-disabled",o.isItemDisabled(i)||void 0)("aria-haspopup",o.isItemGroup(i)&&!o.getItemProp(i,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(i)?o.isItemActive(i):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(n)),c(2),P("data-pc-section","content"),c(),l("ngIf",!o.itemTemplate),c(),l("ngIf",o.itemTemplate),c(),l("ngIf",o.isItemVisible(i)&&o.isItemGroup(i))}}function qo(t,s){if(t&1&&u(0,ho,1,5,"li",6)(1,Ko,6,21,"li",7),t&2){let e=s.$implicit,i=m(2);l("ngIf",i.isItemVisible(e)&&i.getItemProp(e,"separator")),c(),l("ngIf",i.isItemVisible(e)&&!i.getItemProp(e,"separator"))}}function zo(t,s){if(t&1){let e=w();a(0,"ul",4,0),S("@overlayAnimation.start",function(n){_(e);let o=te(1),d=m();return g(d.onEnter(n,o))})("keydown",function(n){_(e);let o=m();return g(o.menuKeydown.emit(n))})("focus",function(n){_(e);let o=m();return g(o.menuFocus.emit(n))})("blur",function(n){_(e);let o=m();return g(o.menuBlur.emit(n))}),u(2,qo,2,2,"ng-template",5),r()}if(t&2){let e=m();l("ngClass",ei(10,po,!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"),c(2),l("ngForOf",e.items)}}var Go=["item"],Ho=["submenuicon"],Uo=["rootmenu"],jo=["container"],Zo=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),Qo=()=>({value:"visible"});function Wo(t,s){if(t&1){let e=w();a(0,"div",3,0),S("@overlayAnimation.start",function(n){_(e);let o=m();return g(o.onOverlayAnimationStart(n))})("@overlayAnimation.done",function(n){_(e);let o=m();return g(o.onOverlayAnimationEnd(n))}),a(2,"p-contextmenu-sub",4,1),S("itemClick",function(n){_(e);let o=m();return g(o.onItemClick(n))})("menuFocus",function(n){_(e);let o=m();return g(o.onMenuFocus(n))})("menuBlur",function(n){_(e);let o=m();return g(o.onMenuBlur(n))})("menuKeydown",function(n){_(e);let o=m();return g(o.onKeyDown(n))})("itemMouseEnter",function(n){_(e);let o=m();return g(o.onItemMouseEnter(n))}),r()()}if(t&2){let e=m();Fe(e.styleClass),l("ngClass",T(20,Zo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",R(22,Qo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),l("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 Yo=({dt:t})=>`
|
|
1
|
+
import{a as _t}from"./chunk-ARJ7OCQO.js";import{a as qi,b as zi}from"./chunk-PGOSR3RI.js";import{a as Gi}from"./chunk-XKI7WLHE.js";import{a as Di}from"./chunk-B4C3ZPN6.js";import{a as $i,b as Ee,c as Pe,d as Ki}from"./chunk-HCJK6VTO.js";import{a as Ri,b as Bi}from"./chunk-ELMSU4U7.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import{a as ut,b as ft}from"./chunk-2VZ7JZIO.js";import{a as we}from"./chunk-6WWXJJID.js";import"./chunk-U2VDC52W.js";import{a as lt,b as st}from"./chunk-3VQUNDVT.js";import{a as pt,b as dt,c as Oi,d as Fi,i as Li,j as Ni,k as Vi}from"./chunk-DGACZ747.js";import"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as X}from"./chunk-CAS5GLLU.js";import{a as V}from"./chunk-BT7Y4ADP.js";import{b as Si}from"./chunk-DJXQKSLT.js";import{a as bi}from"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import{a as ct,b as mt}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{a as at,b as K}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{f as Mi,i as $}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as se,b as ce}from"./chunk-AD247LWQ.js";import{b as J,c as Ai,d as wi,f as Ei,g as Pi,h as ki}from"./chunk-BKTBVFNX.js";import{c as et,d as li,f as si}from"./chunk-ZFNIPERQ.js";import{a as wt,f as Et,n as nt,o as ot,p as vi,t as Ti,u as Pt,w as ae,x as le,y as rt,z as _e}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Aa as hi,D as bt,Da as xi,I as ci,Ia as Ci,K as mi,La as Ae,M as pi,Ma as De,Oa as yi,Q as tt,R as it,Ua as Ii,W as di,X as vt,_ as ui,b as oe,c as fe,da as fi,e as Y,f as ye,g as ri,ga as _i,i as N,j as Je,k as ai,ka as gi,l as Ie,na as St,o as be,qa as re,u as ve,va as Tt,w as Se,wa as At,x as Te}from"./chunk-VMI3QWC6.js";import{b as ie,d as ne,e as B,l as L}from"./chunk-F7PVAVLQ.js";import"./chunk-VFKJMUGN.js";import{a as oi}from"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as z,j as Ye,k as O,l as Ct,m as ii,p as ni,q as Xe,s as F,t as Le}from"./chunk-ZK43JB4A.js";import{c as yt,d as It,f as Ne,h as Ve}from"./chunk-F2X3VGZZ.js";import{$c as Ce,Aa as ee,Cb as Oe,D as Ke,Dc as he,Eb as u,Ec as R,Fc as T,Gc as ei,Ha as v,J as qe,L as qt,Lb as P,Mb as l,Oc as de,P as zt,Pb as He,Pc as xe,Qb as Fe,Qc as ti,Rb as Qt,Sb as Wt,Sc as I,Ub as Yt,Vb as Xt,Wb as a,Xb as r,Y as D,Yb as h,Zb as H,_ as A,_b as U,_c as ue,ac as w,ba as Gt,bd as W,c as $e,ca as ze,cd as We,da as Ht,db as Me,eb as jt,fc as S,gc as m,ia as x,ib as c,lc as Ue,mc as pe,nc as j,ob as xt,oc as Z,qa as _,ra as g,rc as te,s as G,sc as p,t as Kt,tc as E,ua as Ge,uc as Q,wa as Ut,wc as Jt,xc as je,yb as M,yc as Ze,zb as Zt,zc as Qe}from"./chunk-6QJHEOXN.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var on=["class","page"],rn=t=>({id:t}),an=()=>({"overflow-x":"auto"}),ln=t=>({"table-borderless":t}),sn=t=>["fa-solid",t],cn=t=>["/pages/journal/journal-entry/",t];function mn(t,s){t&1&&h(0,"p-button",8)}function pn(t,s){if(t&1){let e=w();a(0,"p-button",9),S("onClick",function(){_(e);let n=m(2);return g(n.onDelete())}),r()}}function dn(t,s){if(t&1&&(a(0,"div",4)(1,"p-button-group"),u(2,mn,1,0,"p-button",5)(3,pn,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,i=m();c(2),l("ngIf",i.roleService.coa().edit),c(),l("ngIf",i.roleService.coa().delete),c(),l("queryParams",T(3,rn,(e=i.COAInfo())==null?null:e.id))}}function un(t,s){if(t&1&&h(0,"i",25),t&2){let e=s.checked;l("ngClass",T(1,sn,e?"fa-check":"fa-xmark"))}}function fn(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.debitAmount)," ")}}function _n(t,s){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.creditAmount)," ")}}function gn(t,s){if(t&1&&(a(0,"tr")(1,"td"),p(2),de(3,"date"),r(),a(4,"td")(5,"div",26)(6,"a",27),p(7),r()()(),a(8,"td",28),u(9,fn,3,3,"ng-container",29),r(),a(10,"td",30),u(11,_n,3,3,"ng-container",29),r(),a(12,"td",31),p(13),de(14,"number"),r()()),t&2){let e=s.$implicit;c(2),E(ti(3,6,e.date,"dd MMM yyyy")),c(4),l("routerLink",T(11,cn,e.id)),c(),E(e.number),c(2),l("ngIf",e.debitAmount!==0),c(2),l("ngIf",e.creditAmount!==0),c(2),Q(" ",xe(14,9,e.balance)," ")}}function hn(t,s){t&1&&(a(0,"tr")(1,"td",32)(2,"div",33),h(3,"img",34),a(4,"div",26)(5,"span",35),p(6,"No Data Available"),r(),a(7,"span",35),p(8,"Your data will be shown here once it's available"),r()()()()())}function xn(t,s){if(t&1){let e=w();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Tag"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),S("onChange",function(n){_(e);let o=m(2);return g(o.onDiscontinued(n))}),u(34,un,1,3,"ng-template",null,2,I),r()()(),a(36,"div",16)(37,"div",17),p(38,"Access Type"),r(),a(39,"div",18),p(40),r()()()()(),a(41,"div",20)(42,"p-card",21)(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),p(47,"Date"),r(),a(48,"th",23),p(49,"Number"),r(),a(50,"th",24),p(51,"Debit"),r(),a(52,"th",24),p(53,"Credit"),r(),a(54,"th",24),p(55,"Balance"),r()()(),a(56,"tbody"),Yt(57,gn,15,13,"tr",null,Wt),u(59,hn,9,0,"tr"),r()()()()()}if(t&2){let e,i,n,o,d,f,b=m(2);c(8),E((e=b.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),E((i=b.COAInfo().code)!==null&&i!==void 0?i:"-"),c(5),E((n=b.COAInfo().category)!==null&&n!==void 0?n:"-"),c(5),E((o=b.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),E((d=b.COAInfo().outletName)!==null&&d!==void 0?d:"-"),c(5),l("ngModel",b.COAInfo().bin),c(7),E((f=b.COAInfo().accessType)!==null&&f!==void 0?f:"-"),c(2),He(R(11,an)),c(),l("ngClass",T(12,ln,b.COAInfo().transactions.length===0)),c(14),Xt(b.COAInfo().transactions),c(2),Qt(b.COAInfo().transactions.length===0?59:-1)}}function Cn(t,s){if(t&1&&(a(0,"div",10),u(1,xn,60,14,"div",11),r()),t&2){let e=m();c(),l("ngIf",e.COAInfo())}}var Hi=(()=>{class t{constructor(){this.#e=x(X),this.#t=x(ie),this.router=x(ne),this.COAInfo=v(null),this.checked=v(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(V("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),A(e=>this.COAInfo.set(e)),V("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let i=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(i).pipe(A(()=>{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(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:on,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[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"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-5"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-4"],[1,"col"],[3,"onChange","ngModel"],[1,"col","col-lg-7"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],["scope","col",1,"text-end"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-success","text-end"],[4,"ngIf"],[1,"text-danger","text-end"],[1,"text-end"],["colspan","5",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://resc.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(i,n){i&1&&(a(0,"app-main-panel",3),u(1,dn,6,5,"ng-template",null,0,I)(3,Cn,2,1,"ng-template",null,1,I),r()),i&2&&l("overflowScroll",!0)},dependencies:[F,z,O,Xe,ni,Se,Y,Je,et,L,B,$,K,at,le,ae,ft,ut,Oi,Di],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var me=(()=>{class t{constructor(){this.httpService=x(oi)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let i={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",i)}renameCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,i)}updateParentCategory(e,i){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,i).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,i={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Mt=t=>t?t.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...Mt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var Ot=(t,s,e)=>{let i=Math.ceil(e/s),n=(t-1)*s+1,o=Math.min(t*s,e);return{start:n,end:o,totalRecords:e,totalPages:i}};var yn={filter:{PageSize:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2,AccessLevel:-1},options:{entities:[],categories:[],accessLevels:[]},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"}]},Ft=Ai(Pi(yn),ki("ChartOfAccount"),wi(t=>({isAllChecked:W(()=>t.data().every(s=>s.checked)),checkedItems:W(()=>t.data().filter(s=>s.checked)),IDsChecked:W(()=>t.data().filter(s=>s.checked).map(s=>s.id)),categories:W(()=>Mt(t.options.categories())),first:W(()=>{let{start:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s}),last:W(()=>{let{end:s}=Ot(t.filter().PageNumber,t.filter().PageSize,t.count());return s})})),Ei(t=>{let s=x(X),e=x(me),i={updateFilter(n){J(t,{filter:C({},n)})},checkedItem(n){if(Array.isArray(n))n.forEach(o=>{let d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})});else{let o=n,d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})}},checkAllCheckbox(){let n=t.data().map(o=>y(C({},o),{checked:!o.checked}));J(t,{data:n})},fetchChartOfAccount:lt($e(Ke(()=>!!t.filter()),qt(300),zt(),D(n=>s.getPaginatedChartAccounts(n).pipe(G(o=>y(C({},o),{data:o.data.map(d=>y(C({},d),{checked:!1}))})),st({next:o=>J(t,{data:o.data,count:o.count}),error:o=>{J(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:lt($e(D(()=>s.getChartOfAccountLoader().pipe(st({next:n=>{J(t,{filter:y(C({},t.filter()),{PageSize:n.filter.pageSize,PageNumber:1,CategoryID:n.filter.categoryID||null,Text:"",listOutletID:[],AccessLevel:n.filter.accessLevel!==void 0?n.filter.accessLevel:t.filter().AccessLevel}),options:n.options}),i.fetchChartOfAccount(t.filter)},error:n=>{console.error(n)}}))))),getCategories:lt($e(qe(()=>e.fetchCOACategories().pipe(st({next:n=>{J(t,{options:y(C({},t.options()),{entities:t.options.entities(),categories:n})})},error:n=>{console.error(n)}})))))};return i}));var Sn=["class","page"],Tn=t=>["../account/",t],An=t=>({"text-decoration-line-through":t}),wn=()=>["/pages/report/general-ledger"],En=t=>({id:t});function Pn(t,s){if(t&1){let e=w();a(0,"p-button",13),S("onClick",function(){_(e);let n=m(2);return g(n.deleteCOA())}),r()}}function kn(t,s){t&1&&h(0,"p-button",14)}function Mn(t,s){if(t&1){let e=w();a(0,"p-button",15),S("onClick",function(){_(e);let n=m(2);return g(n.onExport())}),r()}}function On(t,s){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Fn(t,s){if(t&1&&(a(0,"div",8),u(1,Pn,1,0,"p-button",9),a(2,"p-button-group"),u(3,kn,1,0,"p-button",10)(4,Mn,1,0,"p-button",11),r(),u(5,On,3,0,"a",12),r()),t&2){let e=m();c(),l("ngIf",e.store.checkedItems().length&&e.roleService.coa().delete),c(2),l("ngIf",e.roleService.coa().create),c(),l("ngIf",e.roleService.global().export),c(),l("ngIf",e.roleService.coa().create)}}function Ln(t,s){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Nn(t,s){if(t&1&&(a(0,"tr"),u(1,Ln,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,"Tag"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),l("ngIf",e.roleService.coa().delete)}}function Vn(t,s){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),l("value",e)}}function Dn(t,s){if(t&1&&(a(0,"tr"),u(1,Vn,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),de(14,"number"),r()()()),t&2){let e,i=s.$implicit,n=m(2);c(),l("ngIf",n.roleService.coa().delete),c(2),E(i.code),c(2),l("routerLink",T(12,Tn,i.id))("ngClass",T(14,An,i.bin)),c(),E(i.name),c(2),E(i.category),c(2),E(i.outletName),c(2),l("routerLink",R(16,wn))("queryParams",T(17,En,i.id)),c(),E(xe(14,10,(e=i.balance)!==null&&e!==void 0?e:0))}}function Rn(t,s){if(t&1&&p(0),t&2){let e=m(2);Jt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Bn(t,s){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function $n(t,s){if(t&1){let e=w();a(0,"p-panel")(1,"p-table",18),S("onLazyLoad",function(n){_(e);let o=m();return g(o.loadData(n))})("onRowSelect",function(n){_(e);let o=m();return g(o.onRowSelect(n))})("onRowUnselect",function(n){_(e);let o=m();return g(o.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){_(e);let o=m();return g(o.onSelectAll(n))})("onPage",function(n){_(e);let o=m();return g(o.onPageChange(n))}),u(2,Nn,12,1,"ng-template",null,3,I)(4,Dn,15,19,"ng-template",null,4,I)(6,Rn,1,3,"ng-template",null,5,I)(8,Bn,4,0,"ng-template",null,6,I),r()()}if(t&2){let e=m();c(),l("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.count())}}function Kn(t,s){if(t&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Tag"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),S("onFocus",function(){_(e);let n=m(2);return g(n.onCategoryFocus())}),r()(),a(9,"div",29)(10,"label",30),p(11,"Access Level"),r(),h(12,"p-select",33),r(),a(13,"div",34)(14,"label",30),p(15,"Page Size"),r(),h(16,"input",35),r(),a(17,"div",34)(18,"label",30),p(19,"Discontinued"),r(),a(20,"div",36)(21,"div",37),h(22,"p-radiobutton",38),a(23,"label",39),p(24,"No"),r()(),a(25,"div",37),h(26,"p-radiobutton",40),a(27,"label",41),p(28,"Yes"),r()(),a(29,"div",37),h(30,"p-radiobutton",40),a(31,"label",41),p(32,"All"),r()()()()()}if(t&2){let e=m(2);l("formGroup",e.formFilter),c(4),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),l("fluid",!0)("showClear",!0)("options",e.categoryNodes()),c(4),l("showClear",!0)("options",e.store.options().accessLevels),c(10),l("value",0),c(4),l("value",1),c(4),l("value",2)}}function qn(t,s){if(t&1&&u(0,Kn,33,13,"form",27),t&2){let e=m();l("ngIf",e.formFilter)}}var ji=(()=>{class t{ngOnInit(){this.initializeFilterEffect(),this.store.fetchLoader()}#e;constructor(){this.routeInfo=Zi,this.store=x(Ft),this.#e=x(X),this.modalService=x(li),this.roleService=x(we),this.dialogVisible=v(!1),this.categoryNodes=v([]),this.fb=x(ve),this.injector=x(Ut),this.isDialogFilterVisible=v(!1)}initializeFilterEffect(){We(()=>{this.store.filter()&&this.generateFilterForm()},{injector:this.injector})}generateFilterForm(){let e=this.store.filter();this.formFilter=this.fb.group({outletID:this.fb.control(e.listOutletID||[]),categoryID:this.fb.control(null),pageSize:this.fb.control(e.PageSize),discontinued:this.fb.control(e.Discontinued),accessLevel:this.fb.control(e.AccessLevel)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(A(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(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,i){this.store.updateFilter(y(C({},this.store.filter()),{[e]:i}))}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(V("response"),A(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:1,Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:i,outletID:n,discontinued:o,accessLevel:d}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:n,CategoryID:e?e.key:"",PageSize:+i,Discontinued:o,AccessLevel:d})),this.isDialogFilterVisible.update(f=>!f)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportPageSize:1e4});this.#e.exportChartOfAccounts(e).pipe(A(i=>{let n=i.headers;console.log("All headers:",n.keys());let o=n.get("Content-Disposition"),d=n.get("content-disposition"),f=o??d,b="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(b=decodeURIComponent(q[1].replace(/"/g,"")))}let k=i.body;Ki(k,b,k.type)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[he([Ft])],attrs:Sn,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 Tags",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["scrollHeight","300px","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",3,"onFocus","fluid","showClear","options"],["appendTo","body","formControlName","accessLevel","optionLabel","value","optionValue","key","placeholder","Select an Access Level",3,"showClear","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(i,n){if(i&1){let o=w();a(0,"app-main-panel",7),S("search",function(f){return _(o),g(n.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(n.isDialogFilterVisible,f)||(n.isDialogFilterVisible=f),g(f)}),S("filterEmitted",function(){return _(o),g(n.onFilterEvent())})("filterConfirmed",function(){return _(o),g(n.onFilterOKEvent())}),u(1,Fn,6,4,"ng-template",null,0,I)(3,$n,10,5,"ng-template",null,1,I)(5,qn,1,1,"ng-template",null,2,I),r()}i&2&&(l("isSearchableInput",!0),je("isDialogFilterVisible",n.isDialogFilterVisible),l("isFilterable",!0)("scrollable",!0))},dependencies:[F,z,O,Xe,$,si,ft,ut,_t,Se,ai,oe,Y,ye,L,B,Te,Ie,be,et,Vi,Fi,Li,Ni,K,Mi,le,ae,mt,ct,ot,nt,_e,Bi,Ri,Pe,Ee,ce,se,dt,pt],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 t})();var Gn=["class","page"],Hn=()=>["../../"],Nt=t=>({"ng-invalid ng-dirty":t}),Un=t=>({"ng-dirty ng-invalid":t});function jn(t,s){if(t&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}t&2&&(c(),l("routerLink",R(1,Hn)))}function Zn(t,s){t&1&&(a(0,"div",34),p(1," Name is required "),r())}function Qn(t,s){if(t&1&&(a(0,"div"),u(1,Zn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Name.errors.required)}}function Wn(t,s){t&1&&(a(0,"div",35)(1,"p"),p(2," If you assign an tags for this account, it is only visible for users who has access to that tags. "),r()())}function Yn(t,s){if(t&1&&(a(0,"span",36),p(1),r()),t&2){let e=s.$implicit;l("pTooltip",e.name),c(),Q(" ",e.name," ")}}function Xn(t,s){t&1&&(a(0,"div",34),p(1," Code is required "),r())}function Jn(t,s){if(t&1&&(a(0,"div"),u(1,Xn,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Code.errors.required)}}function eo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function to(t,s){if(t&1&&(a(0,"div"),u(1,eo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function io(t,s){if(t&1&&p(0),t&2){let e=s.$implicit;Q(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function no(t,s){t&1&&(a(0,"div",34),p(1," Category is required "),r())}function oo(t,s){if(t&1&&(a(0,"div"),u(1,no,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Category.errors.required)}}function ro(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function ao(t,s){if(t&1&&(a(0,"div"),u(1,ro,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function lo(t,s){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function so(t,s){if(t&1&&(a(0,"div"),u(1,lo,2,0,"div",33),r()),t&2){let e=m(2);c(),l("ngIf",e.form.controls.Note.errors.required)}}function co(t,s){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"label",13),p(6,"Name"),r(),h(7,"input",14),u(8,Qn,2,1,"div",15),r()(),a(9,"div",11)(10,"div",16)(11,"label",13),p(12,"Tag"),r(),a(13,"span",17),h(14,"i",18),r(),u(15,Wn,3,0,"ng-template",null,2,I),r(),a(17,"p-select",19),u(18,Yn,2,2,"ng-template",null,3,I),r()()(),a(20,"div",10)(21,"div",11)(22,"div",12)(23,"label",13),p(24,"Code"),r(),h(25,"input",20),u(26,Jn,2,1,"div",15),r()(),a(27,"div",11)(28,"div",12)(29,"label",13),p(30,"Discontinued"),r(),a(31,"div",10)(32,"div",21),h(33,"p-radiobutton",22),a(34,"label",23),p(35,"No"),r()(),a(36,"div",24),h(37,"p-radiobutton",25),a(38,"label",26),p(39,"Yes"),r()()(),u(40,to,2,1,"div",15),r()()(),a(41,"div",10)(42,"div",11)(43,"div",27)(44,"label",13),p(45,"Category"),r(),a(46,"p-treeselect",28),u(47,io,1,1,"ng-template",29),r(),u(48,oo,2,1,"div",15),r()(),a(49,"div",11)(50,"div",12)(51,"label",13),p(52,"Access Type"),r(),a(53,"div",10)(54,"div",30),h(55,"p-select",31),r()(),u(56,ao,2,1,"div",15),r()()(),a(57,"div",10)(58,"div",11)(59,"div",12)(60,"label",13),p(61,"Note"),r(),h(62,"textarea",32),u(63,so,2,1,"div",15),r()(),h(64,"div",11),r()()()),t&2){let e=te(16),i=m();l("formGroup",i.form),c(7),l("ngClass",T(21,Nt,i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched))),c(),l("ngIf",i.form.controls.Name.invalid&&(i.form.controls.Name.dirty||i.form.controls.Name.touched)),c(5),l("pTooltip",e),c(4),l("fluid",!0)("options",i.outlets()),c(8),l("ngClass",T(23,Nt,i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched))),c(),l("ngIf",i.form.controls.Code.invalid&&(i.form.controls.Code.dirty||i.form.controls.Code.touched)),c(7),l("value",!1),c(4),l("value",!0),c(3),l("ngIf",i.form.controls.Note.errors),c(6),l("fluid",!0)("options",i.categoryOptions())("ngClass",T(25,Un,i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched))),c(2),l("ngIf",i.form.controls.Category.invalid&&(i.form.controls.Category.dirty||i.form.controls.Category.touched)),c(7),l("options",i.accessTypes())("fluid",!0),c(),l("ngIf",i.form.controls.Note.errors),c(6),l("ngClass",T(27,Nt,i.form.controls.Note.invalid&&(i.form.controls.Note.dirty||i.form.controls.Note.touched)))("autoResize",!0),c(),l("ngIf",i.form.controls.Note.errors)}}var Vt=(()=>{class t{constructor(){this.route=x(ie),this.coa_service=x(X),this.coa_info=v(null),this.fb=x(ve),this.isEdit=v(!1),this.categoryOptions=v([]),this.router=x(ne),this.outlets=W(()=>this.coa_info()?this.coa_info().options.entities:[]),this.accessTypes=W(()=>{let e=["This Chart of Account can be viewed by all users.","Restricted access, only visible to users with the private role"];return this.coa_info()?this.coa_info().options.coaAccessType.map((i,n)=>y(C({},i),{description:e[n]})):[]})}findParenChilds(e,i){function n(o,d=null){for(let f of o){if(f.key===i)return{parent:d,child:f};if(f.children){let b=n(f.children,f);if(b)return b}}return null}return n(e)}generateForm(e){this.form=this.fb.group({ID:new N(e.id||""),Name:new N(e.name||"",[fe.required]),Code:new N(e.code||"",[fe.required]),Note:new N(e.note||"",[]),Balance:new N(e.balance||0),Outlet:new N(e.outletID||""),AccessType:new N(e.accessTypeID||0),Category:new N(null,[fe.required]),Bin:new N(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(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let i=e.get("id");return this.coa_service.getChartAccountFormById(i)}else return this.coa_service.getChartAccountForm()}),V("response"),G(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),A(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:i,Category:n,Code:o,Name:d,Note:f,Outlet:b}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:n.key,name:d,bin:this.form.value.Bin||!1,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:n.key,bin:this.form.value.Bin||!1,name:d,code:o,note:f,outletID:b||null,balance:i,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(V("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(V("response"),A(e=>{this.categoryOptions.set(e);let i=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(i?.child)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:Gn,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",3,"formGroup"],[1,"d-flex","flex-column","gap-2"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],[1,"d-flex","align-items-baseline","gap-2"],[3,"pTooltip"],[1,"fa-solid","fa-circle-info"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"fluid","options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"col-3","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[1,"col","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"fluid","options","ngClass"],["pTemplate","value"],[1,"col"],["optionLabel","value","optionValue","key","formControlName","AccessType","placeholder","Select Access Type",3,"options","fluid"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass","autoResize"],["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"]],template:function(i,n){i&1&&(a(0,"app-main-panel",4),u(1,jn,4,2,"ng-template",null,0,I)(3,co,65,29,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,Te,oe,Y,ye,Ie,be,_t,F,z,O,L,B,Pe,Ee,Ae,K,ot,nt,zi,qi,mt,ct,_e,rt,le,ae,ce,se,dt,pt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var mo=["sublist"],po=(t,s)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":s}),uo=()=>({"p-contextmenu-item-link":!0}),Yi=()=>({class:"p-contextmenu-submenu-icon"}),fo=()=>({exact:!1}),_o=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),go=t=>({$implicit:t});function ho(t,s){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,i=m(2);He(i.getItemProp(e,"style")),l("ngClass",i.getSeparatorItemClass(e)),P("id",i.getItemId(e))("data-pc-section","separator")}}function xo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Co(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function yo(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function Io(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function bo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function vo(t,s){}function So(t,s){t&1&&u(0,vo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function To(t,s){if(t&1&&(H(0),u(1,bo,1,4,"AngleRightIcon",23)(2,So,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function Ao(t,s){if(t&1&&(a(0,"a",15),u(1,xo,1,5,"span",16)(2,Co,2,2,"span",17)(3,yo,1,2,"ng-template",null,2,I)(5,Io,1,2,"p-badge",18)(6,To,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("target",n.getItemProp(i,"target"))("ngClass",R(12,uo)),P("href",n.getItemProp(i,"url"),jt)("aria-hidden",!0)("data-automationid",n.getItemProp(i,"automationId"))("data-pc-section","action")("tabindex",-1),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function wo(t,s){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,i=m(2);l("ngClass",i.getItemProp(e,"icon"))("ngStyle",i.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Eo(t,s){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,i=m(2);P("data-pc-section","label"),c(),Q(" ",i.getItemLabel(e)," ")}}function Po(t,s){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,i=m(2);l("innerHTML",i.getItemLabel(e),Me),P("data-pc-section","label")}}function ko(t,s){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,i=m(2);l("styleClass",i.getItemProp(e,"badgeStyleClass"))("value",i.getItemProp(e,"badge"))}}function Mo(t,s){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Oo(t,s){}function Fo(t,s){t&1&&u(0,Oo,0,0,"ng-template",25),t&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function Lo(t,s){if(t&1&&(H(0),u(1,Mo,1,4,"AngleRightIcon",23)(2,Fo,1,2,null,24),U()),t&2){let e=m(6);c(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yi))}}function No(t,s){if(t&1&&(a(0,"a",26),u(1,wo,1,5,"span",16)(2,Eo,2,2,"span",17)(3,Po,1,2,"ng-template",null,2,I)(5,ko,1,2,"p-badge",18)(6,Lo,3,4,"ng-container",11),r()),t&2){let e=te(4),i=m(3).$implicit,n=m(2);l("routerLink",n.getItemProp(i,"routerLink"))("queryParams",n.getItemProp(i,"queryParams"))("routerLinkActiveOptions",n.getItemProp(i,"routerLinkActiveOptions")||R(20,fo))("target",n.getItemProp(i,"target"))("ngClass",T(21,_o,n.getItemProp(i,"disabled")))("fragment",n.getItemProp(i,"fragment"))("queryParamsHandling",n.getItemProp(i,"queryParamsHandling"))("preserveFragment",n.getItemProp(i,"preserveFragment"))("skipLocationChange",n.getItemProp(i,"skipLocationChange"))("replaceUrl",n.getItemProp(i,"replaceUrl"))("state",n.getItemProp(i,"state")),P("data-automationid",n.getItemProp(i,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),l("ngIf",n.getItemProp(i,"icon")),c(),l("ngIf",n.getItemProp(i,"escape"))("ngIfElse",e),c(3),l("ngIf",n.getItemProp(i,"badge")),c(),l("ngIf",n.isItemGroup(i))}}function Vo(t,s){if(t&1&&(H(0),u(1,Ao,7,13,"a",13)(2,No,7,23,"a",14),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngIf",!i.getItemProp(e,"routerLink")),c(),l("ngIf",i.getItemProp(e,"routerLink"))}}function Do(t,s){}function Ro(t,s){t&1&&u(0,Do,0,0,"ng-template")}function Bo(t,s){if(t&1&&(H(0),u(1,Ro,1,0,null,24),U()),t&2){let e=m(2).$implicit,i=m(2);c(),l("ngTemplateOutlet",i.itemTemplate)("ngTemplateOutletContext",T(2,go,e.item))}}function $o(t,s){if(t&1){let e=w();a(0,"p-contextmenu-sub",27),S("itemClick",function(n){_(e);let o=m(4);return g(o.itemClick.emit(n))})("itemMouseEnter",function(n){_(e);let o=m(4);return g(o.onItemMouseEnter(n))}),r()}if(t&2){let e=m(2).$implicit,i=m(2);l("items",e.items)("itemTemplate",i.itemTemplate)("menuId",i.menuId)("visible",i.isItemActive(e)&&i.isItemGroup(e))("activeItemPath",i.activeItemPath)("focusedItemId",i.focusedItemId)("level",i.level+1)}}function Ko(t,s){if(t&1){let e=w();a(0,"li",9,1)(2,"div",10),S("click",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemClick(n,o))})("mouseenter",function(n){_(e);let o=m().$implicit,d=m(2);return g(d.onItemMouseEnter({$event:n,processedItem:o}))}),u(3,Vo,3,2,"ng-container",11)(4,Bo,2,4,"ng-container",11),r(),u(5,$o,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),i=e.$implicit,n=e.index,o=m(2);Fe(o.getItemProp(i,"styleClass")),l("ngStyle",o.getItemProp(i,"style"))("ngClass",o.getItemClass(i))("tooltipOptions",o.getItemProp(i,"tooltipOptions")),P("id",o.getItemId(i))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(i))("data-p-focused",o.isItemFocused(i))("data-p-disabled",o.isItemDisabled(i))("aria-label",o.getItemLabel(i))("aria-disabled",o.isItemDisabled(i)||void 0)("aria-haspopup",o.isItemGroup(i)&&!o.getItemProp(i,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(i)?o.isItemActive(i):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(n)),c(2),P("data-pc-section","content"),c(),l("ngIf",!o.itemTemplate),c(),l("ngIf",o.itemTemplate),c(),l("ngIf",o.isItemVisible(i)&&o.isItemGroup(i))}}function qo(t,s){if(t&1&&u(0,ho,1,5,"li",6)(1,Ko,6,21,"li",7),t&2){let e=s.$implicit,i=m(2);l("ngIf",i.isItemVisible(e)&&i.getItemProp(e,"separator")),c(),l("ngIf",i.isItemVisible(e)&&!i.getItemProp(e,"separator"))}}function zo(t,s){if(t&1){let e=w();a(0,"ul",4,0),S("@overlayAnimation.start",function(n){_(e);let o=te(1),d=m();return g(d.onEnter(n,o))})("keydown",function(n){_(e);let o=m();return g(o.menuKeydown.emit(n))})("focus",function(n){_(e);let o=m();return g(o.menuFocus.emit(n))})("blur",function(n){_(e);let o=m();return g(o.menuBlur.emit(n))}),u(2,qo,2,2,"ng-template",5),r()}if(t&2){let e=m();l("ngClass",ei(10,po,!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"),c(2),l("ngForOf",e.items)}}var Go=["item"],Ho=["submenuicon"],Uo=["rootmenu"],jo=["container"],Zo=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),Qo=()=>({value:"visible"});function Wo(t,s){if(t&1){let e=w();a(0,"div",3,0),S("@overlayAnimation.start",function(n){_(e);let o=m();return g(o.onOverlayAnimationStart(n))})("@overlayAnimation.done",function(n){_(e);let o=m();return g(o.onOverlayAnimationEnd(n))}),a(2,"p-contextmenu-sub",4,1),S("itemClick",function(n){_(e);let o=m();return g(o.onItemClick(n))})("menuFocus",function(n){_(e);let o=m();return g(o.onMenuFocus(n))})("menuBlur",function(n){_(e);let o=m();return g(o.onMenuBlur(n))})("menuKeydown",function(n){_(e);let o=m();return g(o.onKeyDown(n))})("itemMouseEnter",function(n){_(e);let o=m();return g(o.onItemMouseEnter(n))}),r()()}if(t&2){let e=m();Fe(e.styleClass),l("ngClass",T(20,Zo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",R(22,Qo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),l("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 Yo=({dt:t})=>`
|
|
2
2
|
.p-contextmenu {
|
|
3
3
|
position: absolute;
|
|
4
4
|
background: ${t("contextmenu.background")};
|
|
@@ -157,4 +157,4 @@ import{a as _t}from"./chunk-ARJ7OCQO.js";import{a as qi,b as zi}from"./chunk-PGO
|
|
|
157
157
|
}
|
|
158
158
|
`,Xo={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:t,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":t.isItemActive(s),"p-focus":t.isItemFocused(s),"p-disabled":t.isItemDisabled(s)}],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"},Wi=(()=>{class t extends Ii{name="contextmenu";theme=Yo;classes=Xo;static \u0275fac=(()=>{let e;return function(n){return(e||(e=Ge(t)))(n||t)}})();static \u0275prov=ze({token:t,factory:t.\u0275fac})}return t})();var Jo=(()=>{class t extends wt{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new ee;itemMouseEnter=new ee;menuFocus=new ee;menuBlur=new ee;menuKeydown=new ee;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,i,n=null){return e&&e.item?At(e.item[i],n):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 y(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 y(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(i=>this.isItemVisible(i)&&this.getItemProp(i,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(i=>i.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return re(e.items)}onItemMouseEnter(e){let{event:i,processedItem:n}=e;this.itemMouseEnter.emit({originalEvent:i,processedItem:n})}onItemClick(e,i){this.getItemProp(i,"command",{originalEvent:e,item:i.item}),this.itemClick.emit({originalEvent:e,processedItem:i,isFocus:!0})}onEnter(e,i){if(e.fromState==="void"&&e.toState){let n=e.element;this.position(n)}}position(e){let i=e.parentElement.parentElement,n=ui(e.parentElement.parentElement),o=bt(),d=e.offsetParent?e.offsetWidth:vt(e),f=ci(i.children[0]);e.style.top="0px",parseInt(n.left,10)+f+d>o.width-pi()?e.style.left=-1*d+"px":e.style.left=f+"px"}static \u0275fac=function(i){return new(i||t)(xt(Gt(()=>ht)))};static \u0275cmp=M({type:t,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(i,n){if(i&1&&pe(mo,5),i&2){let o;j(o=Z())&&(n.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",ue],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",ue],autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",Ce],popup:[2,"popup","popup",ue],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Ce],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Ce]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Oe],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(i,n){i&1&&u(0,zo,3,13,"ul",3),i&2&&l("ngIf",n.root?!0:n.visible)},dependencies:[t,F,z,Ye,O,ii,Ct,L,B,vi,_e,rt,bi,Pt,Ti,De],encapsulation:2,data:{animation:[yt("overlayAnimation",[Ve(":enter",[Ne({opacity:0})]),Ve(":leave",[Ne({opacity:0})])])]}})}return t})(),ht=(()=>{class t extends wt{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 ee;onHide=new ee;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=v(!1);relativeAlign;window;focused=!1;activeItemPath=v([]);focusedItemInfo=v({index:-1,level:0,parentKey:"",item:null});submenuVisible=v(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(Wi);get visibleItems(){let e=this.activeItemPath().find(i=>i.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}${re(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,We(()=>{let i=this.activeItemPath();re(i)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||xi("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return _i()||fi()}bindTriggerEventListener(){Le(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(Le(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",i=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(i)&&!i.ctrlKey&&i.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,i=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(i)&&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,i=0,n={},o=""){let d=[];return e&&e.forEach((f,b)=>{let k=(o!==""?o+"_":"")+b,q={item:f,index:b,level:i,key:k,parent:n,parentKey:o};q.items=this.createProcessedItems(f.items,i+1,q,k),d.push(q)}),d}bindMatchMediaListener(){if(Le(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,i){return e?At(e[i]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&re(e.items)}isSelected(e){return this.activeItemPath().some(i=>i.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&&re(e.items)}onItemClick(e){let{processedItem:i}=e,n=this.isProcessedItemGroup(i);if(this.isSelected(i)){let{index:d,key:f,level:b,parentKey:k,item:q}=i;this.activeItemPath.set(this.activeItemPath().filter(Be=>f!==Be.key&&f.startsWith(Be.key))),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:q}),it(this.rootmenu.sublistViewChild.nativeElement)}else n?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let i=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:!i&&hi(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let i=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}onArrowRightKey(e){let i=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:e,processedItem:i}),this.focusedItemInfo.set({index:-1,parentKey:i.key,item:i.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let i=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(i)&&this.onItemChange({originalEvent:e,processedItem:i})}this.hide(),e.preventDefault()}else{let i=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,i),e.preventDefault()}}onArrowLeftKey(e){let i=this.visibleItems[this.focusedItemInfo().index],n=this.activeItemPath().find(f=>f.key===i.parentKey);St(i.parent)||(this.focusedItemInfo.set({index:-1,parentKey:n?n.parentKey:"",item:i.item}),this.searchValue="",this.onArrowDownKey(e));let d=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(d),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 i=this.findVisibleItem(this.findFirstFocusedItemIndex()),n=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},n),{index:this.findFirstFocusedItemIndex(),item:i.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let i=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(i)&&this.onItemChange({originalEvent:e,processedItem:i})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let i=tt(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),n=i&&tt(i,'a[data-pc-section="action"]');n?n.click():i&&i.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,i){let{processedItem:n,isFocus:o}=e;if(St(n))return;let{index:d,key:f,level:b,parentKey:k,items:q}=n,Be=re(q),Bt=this.activeItemPath().filter($t=>$t.parentKey!==k&&$t.parentKey!==f);Be&&(Bt.push(n),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:n.item}),o&&it(this.rootmenu.sublistViewChild.nativeElement),!(i==="hover"&&this.queryMatches)&&this.activeItemPath.set(Bt)}onMenuFocus(e){this.focused=!0;let i=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(i)}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(),it(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):mi(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&Et.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&Et.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,i=this.pageY+1,n=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:vt(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:di(this.containerViewChild.nativeElement),d=bt();e+n-this.document.scrollingElement.scrollLeft>d.width&&(e-=n),i+o-this.document.scrollingElement.scrollTop>d.height&&(i-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),i<this.document.scrollingElement.scrollTop&&(i=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=i+"px"}searchItems(e,i){this.searchValue=(this.searchValue||"")+i;let n=-1,o=!1;return this.focusedItemInfo().index!==-1?(n=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)),n=n===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)):n+this.focusedItemInfo().index):n=this.visibleItems.findIndex(d=>this.isItemMatched(d)),n!==-1&&(o=!0),n===-1&&this.focusedItemInfo().index===-1&&(n=this.findFirstFocusedItemIndex()),n!==-1&&this.changeFocusedItemIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return re(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return Tt(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let i=e>0?Tt(this.visibleItems.slice(0,e),n=>this.isValidItem(n)):-1;return i>-1?i:e}findNextItemIndex(e){let i=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(n=>this.isValidItem(n)):-1;return i>-1?i+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,i){let n=this.findVisibleItem(i),o=this.focusedItemInfo();o.index!==i&&(this.focusedItemInfo.set(y(C({},o),{index:i,item:n.item})),this.scrollInView())}scrollInView(e=-1){let i=e!==-1?`${this.id}_${e}`:this.focusedItemId,n=tt(this.rootmenu.el.nativeElement,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Le(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):gi(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(i){return new(i||t)(xt(Ci))};static \u0275cmp=M({type:t,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(i,n,o){if(i&1&&(Ue(o,Go,4),Ue(o,Ho,4),Ue(o,Ae,4)),i&2){let d;j(d=Z())&&(n.itemTemplate=d.first),j(d=Z())&&(n.submenuIconTemplate=d.first),j(d=Z())&&(n.templates=d)}},viewQuery:function(i,n){if(i&1&&(pe(Uo,5),pe(jo,5)),i&2){let o;j(o=Z())&&(n.rootmenu=o.first),j(o=Z())&&(n.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",ue],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",Ce],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Ce]},outputs:{onShow:"onShow",onHide:"onHide"},features:[he([Wi]),Oe],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(i,n){i&1&&u(0,Wo,4,23,"div",2),i&2&&l("ngIf",n.visible())},dependencies:[F,z,O,Ct,Jo,L,_e,Pt,De],encapsulation:2,data:{animation:[yt("overlayAnimation",[Ve(":enter",[Ne({opacity:0}),It("250ms")]),Ve(":leave",[It(".1s linear",Ne({opacity:0}))])])]},changeDetection:0})}return t})(),Xi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Zt({type:t});static \u0275inj=Ht({imports:[ht,De,De]})}return t})();var tr=["editInput"],ir=["tree"],nr=["class","page"];function or(t,s){t&1&&(a(0,"a",7),h(1,"i",8),p(2," Add"),r())}function rr(t,s){if(t&1&&u(0,or,3,0,"a",6),t&2){let e=m();l("ngIf",e.roleService.coa().create)}}function ar(t,s){if(t&1){let e=w();a(0,"input",15,4),Qe("ngModelChange",function(n){let o=_(e).$implicit;return Ze(o.label,n)||(o.label=n),g(n)}),S("keydown",function(n){_(e);let o=m(2);return g(o.handleEditKeydown(n))})("blur",function(n){_(e);let o=m(2);return g(o.onNodeEditBlur(n))}),r()}if(t&2){let e=s.$implicit;je("ngModel",e.label)}}function lr(t,s){if(t&1){let e=w();a(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-tree",12,2),S("onNodeContextMenuSelect",function(n){_(e);let o=m();return g(o.onNodeContextMenuSelect(n))})("onNodeSelect",function(n){_(e);let o=m();return g(o.onNodeSelect(n))})("onNodeUnselect",function(n){_(e);let o=m();return g(o.onNodeUnselect(n))})("onNodeDrop",function(n){_(e);let o=m();return g(o.onNodeDrop(n))}),u(5,ar,2,1,"ng-template",13),r(),h(6,"p-contextmenu",14,3),r()()()}if(t&2){let e=te(7),i=m();c(2),l("showHeader",!1),c(),l("value",i.categoryTree())("contextMenu",e)("selection",i.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),c(3),l("model",i.contextMenuItems())}}var Ji=(()=>{class t{constructor(){this._coaTypesService=x(me),this._router=x(ne),this.roleService=x(we),this.contextMenuItems=v([]),this.categoryTree=v([]),this.selectedCategory=null,this._shouldAutoFocus=v(!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(A(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(i=>{let n=!!i.children?.length;return y(C({},i),{icon:void 0,expandedIcon:n?"fa-solid fa-folder-open":void 0,collapsedIcon:n?"fa-solid fa-folder":"fa-solid fa-file",children:n?this._assignTreeIcons(i.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._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(D(e=>this._loadCategories().pipe(G(()=>e))),A(e=>{let i=this._findNodeByKey(e.id);i&&(this.selectedCategory=i,this._shouldAutoFocus.set(!1),i.type="edit")})).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(D(()=>this._loadCategories())).subscribe()}renameNode(e,i=this.selectedCategory){this._coaTypesService.renameCategory(i.key,{Name:e}).pipe(D(()=>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(n=>["Edit","Delete"].includes(n.label)?y(C({},n),{disabled:!0}):y(C({},n),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(n=>n.label==="Add"?y(C({},n),{disabled:!this.roleService.coa().create}):n.label==="Edit"?y(C({},n),{disabled:!this.roleService.coa().edit}):n.label==="Delete"?y(C({},n),{disabled:!this.roleService.coa().delete}):y(C({},n),{disabled:!1})))}onNodeDrop(e){let{dragNode:i,dropNode:n}=e;this._coaTypesService.updateParentCategory(i.key,{ParentID:n.key}).pipe(A(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let i=e.target;this.renameNode(i.value);let n=this._findNodeByKey(this.selectedCategory?.key);n&&delete n.type}handleEditKeydown(e){let i=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(i.value);let n=this._findNodeByKey(this.selectedCategory?.key);n&&(delete n.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,i){e.expanded=i,e.children?.forEach(n=>this._expandRecursive(n,i))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type",8,"page"]],viewQuery:function(i,n){if(i&1&&(pe(tr,5),pe(ir,5)),i&2){let o;j(o=Z())&&(n.editInputRef=o.first),j(o=Z())&&(n.treeComponent=o.first)}},features:[he([yi])],attrs:nr,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
|
|
159
159
|
`,3,"scrollable"],["class","p-button","routerLink","add",4,"ngIf"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center","m-0"],[1,"col","p-0"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",1,"custom-tree-spacing",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","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(i,n){i&1&&(a(0,"app-main-panel",5),u(1,rr,1,1,"ng-template",null,0,I)(3,lr,8,9,"ng-template",null,1,I),r()),i&2&&l("scrollable",!0)},dependencies:[$,$i,L,B,Xi,ht,Ae,F,O,Se,oe,Y,Je,K,Si,ce,se],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var sr=["class","page"],Dt=t=>({"is-invalid":t}),cr=t=>({"ng-invalid ng-dirty":t});function mr(t,s){if(t&1){let e=w();a(0,"div",3)(1,"p-button",4),S("onClick",function(){_(e);let n=m();return g(n.goBack())}),r(),a(2,"p-button",5),S("onClick",function(){_(e);let n=m();return g(n.onSubmit())}),r()()}}function pr(t,s){t&1&&(a(0,"div",20),p(1," Name is required "),r())}function dr(t,s){t&1&&(a(0,"div",20),p(1," Code is required "),r())}function ur(t,s){t&1&&(a(0,"div",20),p(1," Note is required "),r())}function fr(t,s){if(t&1&&(a(0,"div")(1,"span",22),p(2),r()()),t&2){let e=s.$implicit;c(2),E(e)}}function _r(t,s){if(t&1&&(a(0,"div"),u(1,fr,3,1,"div",21),r()),t&2){let e=m(2);c(),l("ngForOf",e.getErrors("Category"))}}function gr(t,s){if(t&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),u(9,pr,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),u(15,dr,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),u(21,ur,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),S("onFocus",function(){_(e);let n=m();return g(n.loadCategories())}),r(),u(27,_r,2,1,"div",19),r()()()()()()}if(t&2){let e=m();c(3),l("formGroup",e.form),c(5),l("ngClass",T(10,Dt,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),c(),l("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),c(5),l("ngClass",T(12,Dt,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),c(),l("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),c(5),l("ngClass",T(14,Dt,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),c(),l("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),c(5),l("ngClass",T(16,cr,e.isInvalid("Category")))("options",e.categories()),c(),l("ngIf",e.isInvalid("Category"))}}var Rt=(()=>{class t extends Gi{constructor(){super(...arguments),this.categories=v([]),this.COATypeService=x(me),this.COAService=x(X),this.info=v(null),this.route=x(ie),this.router=x(ne),this.fb=x(ve)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Kt([this.route.paramMap.pipe(G(e=>e.get("id")),Ke(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(V("fetchCOACategories"),D(([e,i])=>{let n=this.findNodeByKeyInArray(i,e);return this.categories.set(i),this.COATypeService.getCOACategoryByID({ID:e}).pipe(A(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:n.parent}),["Asset","Liability","Equity","Revenue","Expense"].includes(o.name)&&this.form.controls.Category.disable()}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(A(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new ri({Name:new N("",[fe.required]),Code:new N("",[]),Category:new N(null,[fe.required]),Note:new N("",[])})}findNodeByKeyInArray(e,i){for(let n of e){let o=this.findNodeByKey(n,i);if(o)return o}return null}findNodeByKey(e,i,n=null){if(e.key===i||e.label===i)return n&&(e.parent=n),e;if(e.children&&e.children.length>0)for(let o of e.children){let d=this.findNodeByKey(o,i,e);if(d)return d}return null}onSubmit(){let{Name:e,Code:i,Note:n,Category:o}=this.form.value,d=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(d=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:i,ParentID:d&&d.parent?d.parent.key:d.key,Note:n,ID:this.route.snapshot.params.id||null}):(d=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:i,ParentID:d&&d.parent?d.parent.key:d.key,Note:n}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(V("response"),A(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=Ge(t)))(n||t)}})()}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type-form",8,"page"]],features:[Oe],attrs:sr,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(i,n){i&1&&(a(0,"app-main-panel",2),u(1,mr,3,0,"ng-template",null,0,I)(3,gr,28,18,"ng-template",null,1,I),r()),i&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,L,Pe,Ee,Te,oe,Y,ye,Ie,be,F,z,Ye,O,K,le,ae,ce,se],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return t})();var hr=t=>[t];function xr(t,s){if(t&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),t&2){let e=m(2);l("routerLink",T(1,hr,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function Cr(t,s){if(t&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()()()()()()),t&2){let e=m(2);c(8),E(e.info().name),c(5),E(e.info().code),c(5),E(e.info().parentName),c(5),l("innerHTML",e.info().note,Me)}}function yr(t,s){t&1&&(H(0),a(1,"app-main-panel",3),u(2,xr,4,3,"ng-template",null,0,I)(4,Cr,24,4,"ng-template",null,1,I),r(),U())}var en=(()=>{class t{constructor(){this.COATypeService=x(me),this.route=x(ie),this.info=v(null)}ngOnInit(){this.route.queryParamMap.pipe(G(e=>e.get("ID")),D(e=>this.COATypeService.getCOACategoryByID({ID:e})),V("getCOACategoryByID"),A(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,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(i,n){i&1&&u(0,yr,6,0,"ng-container",2),i&2&&l("ngIf",n.info())},dependencies:[F,O,$,K,at,L,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ps=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:ji},{path:"account/add",component:Vt},{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(i,n){i&1&&u(0,yr,6,0,"ng-container",2),i&2&&l("ngIf",n.info())},dependencies:[F,O,$,K,at,L,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ps=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:ji},{path:"account/add",component:Vt},{path:"account/import",loadComponent:()=>import("./chunk-WSQPSWDS.js").then(t=>t.CoaImportComponent)},{path:"account/:id",component:Hi},{path:"account/:id/edit",component:Vt},{path:"coa-types",component:Ji},{path:"coa-types/add",component:Rt},{path:"coa-types/info",component:en},{path:"coa-types/:id/edit",component:Rt}]}],Zi={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{Ps as CHART_OF_ACCOUNT_ROUTES,Zi as CHART_OF_ACCOUNT_ROUTE_PAGE};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as un}from"./chunk-
|
|
1
|
+
import{a as un}from"./chunk-672TXWSC.js";import{a as qn}from"./chunk-ARJ7OCQO.js";import{a as Xn}from"./chunk-6WWXJJID.js";import"./chunk-U2VDC52W.js";import{a as Fn}from"./chunk-AMGBUOC4.js";import{a as $n}from"./chunk-UPSNJEHO.js";import{b as Wn}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{b as jn}from"./chunk-WXIG4CXY.js";import{a as Vn}from"./chunk-QPPFPDWZ.js";import{a as Dn}from"./chunk-WMZF4DQK.js";import"./chunk-S27Z7D3D.js";import{b as Gn}from"./chunk-AD247LWQ.js";import{c as Mn}from"./chunk-ZFNIPERQ.js";import{a as et,c as An,f as ai,o as Bn,p as Rn,t as Hn,u as Si,w as Nn,x as oi,y as Yn,z as Ti}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Da as si,G as Sn,Ia as Ln,J as Tn,Ja as kn,K as Pn,Ka as zn,La as ri,Ma as ge,P as Ie,Q as _t,R as Nt,S as En,Ua as Je,b as mn,e as fn,f as gn,h as hn,ia as On,j as vn,k as wn,ma as In,p as bn,q as yn,r as _n,s as Cn,w as ni,x as xn}from"./chunk-VMI3QWC6.js";import{b as rn,d as an,e as on,f as ln,l as Ht}from"./chunk-F7PVAVLQ.js";import{b as Mi}from"./chunk-VFKJMUGN.js";import{a as cn}from"./chunk-5DRALZZF.js";import{a as pn}from"./chunk-2BI7WNJP.js";import{A as nn,I as sn,h as ct,j as ii,k as Ft,l as Bt,m as Rt,n as tn,s as we,t as Oe}from"./chunk-ZK43JB4A.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{$b as Me,$c as Vt,Aa as We,Ba as Wi,Bb as Qi,Cb as Ke,Da as qi,Dc as Ze,Ea as xe,Eb as X,Ec as Ji,Fa as wt,Fc as pe,Gc as Be,Ha as Ee,Hc as ti,La as Ui,Lb as Z,Mb as $,Ob as Ki,Oc as Dt,Pb as Qt,Pc as $t,Qb as ye,Rb as Kt,Sb as Zt,Sc as dt,Ub as Jt,Vb as ei,W as Xi,Wb as G,Xb as N,Yb as te,Zb as at,_b as ot,_c as pt,ac as ve,ba as Yi,bd as en,ca as Ye,da as je,db as bi,eb as qe,fc as ie,gc as H,hc as bt,ia as ae,ib as R,ic as lt,lc as fe,mc as yt,nc as ne,ob as Ue,oc as se,pa as ji,qa as U,ra as Q,rc as Lt,s as wi,sc as le,t as Gi,tb as Ut,tc as Fe,ua as Ae,uc as yi,vc as Zi,xc as kt,yb as he,yc as zt,zb as Qe,zc as At}from"./chunk-6QJHEOXN.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
|
|
2
2
|
.p-inputgroup,
|
|
3
3
|
.p-inputgroup .p-floatlabel,
|
|
4
4
|
.p-inputgroup .p-iftalabel {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-ETNPJTRI.js";import{a as q}from"./chunk-2VZ7JZIO.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{i as w}from"./chunk-RAF7SWW4.js";import"./chunk-S27Z7D3D.js";import{a as k}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as P}from"./chunk-ME4ALIS7.js";import{b as M}from"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{b as I,d as E,e as D}from"./chunk-F7PVAVLQ.js";import"./chunk-VFKJMUGN.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{D as f,Eb as u,Ec as J,Fc as b,Mb as m,Rb as h,Sc as s,Wb as n,Xb as o,Y as _,Yb as j,_ as x,ac as y,fc as S,gc as a,ia as l,ib as p,qa as T,ra as v,sc as r,tc as c,yb as C}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var V=()=>["/pages/accounting-setup/journal-tag/form"],B=t=>({id:t});function L(t,d){if(t&1){let e=y();n(0,"div",3)(1,"p-button-group"),j(2,"p-button",4),n(3,"p-button",5),S("onClick",function(){T(e);let g=a();return v(g.onJournalTagDelete())}),o()()()}if(t&2){let e=a();p(2),m("routerLink",J(2,V))("queryParams",b(3,B,e.journalTag().id))}}function W(t,d){if(t&1&&(n(0,"div",6)(1,"div",7)(2,"p-panel",8)(3,"div",9)(4,"div",6)(5,"div",10),r(6,"Name"),o(),n(7,"div",10),r(8),o()(),n(9,"div",6)(10,"div",10),r(11,"Description"),o(),n(12,"div",10),r(13),o()()()()()()),t&2){let e=a(2);p(8),c(e.journalTag().name),p(5),c(e.journalTag().description)}}function A(t,d){if(t&1&&u(0,W,14,2,"div",6),t&2){let e=a();h(e.journalTag()?0:-1)}}var tt=(()=>{class t{constructor(){this.journalTagService=l(F),this.route=l(I),this.router=l(E),this.journalTag=M(this.route.queryParamMap.pipe(f(e=>e.has("id")),_(e=>this.journalTagService.journalTagInfo(e.get("id"))),R("Journal Tag Info ")),{initialValue:null})}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTag().id).pipe(x(()=>this.router.navigate(["/pages/accounting-setup/journal-tag"]))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-journal-tag-info"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",3,"routerLink","queryParams"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"row"],[1,"col-6"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2"],[1,"col"]],template:function(i,g){i&1&&(n(0,"app-main-panel",2),u(1,L,4,5,"ng-template",null,0,s)(3,A,1,1,"ng-template",null,1,s),o()),i&2&&m("hasMainWrapperPadding",!0)},dependencies:[w,k,q,P,D],encapsulation:2})}}return t})();export{tt as JournalTagInfoComponent};
|