dealposbooks 5.51.0 → 5.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-ELZ5FFFM.js → chunk-2UDDXT3B.js} +1 -1
- package/{chunk-VABCBO2E.js → chunk-2Z3VSENH.js} +1 -1
- package/{chunk-MHM3ED4J.js → chunk-3IOJJMQE.js} +1 -1
- package/{chunk-YMV3SC73.js → chunk-3PM6I5JR.js} +1 -1
- package/{chunk-B7TGZ7J3.js → chunk-4BAARBYV.js} +1 -1
- package/{chunk-D5WBKKO2.js → chunk-5MLCIFDJ.js} +1 -1
- package/{chunk-BT4SLG45.js → chunk-5SDFH3ZF.js} +1 -1
- package/{chunk-TOAH3PY3.js → chunk-6JWBYLFX.js} +1 -1
- package/{chunk-DAN3PD7R.js → chunk-7XSFPN5T.js} +1 -1
- package/{chunk-KBJ25I3J.js → chunk-BBR4SZ4S.js} +1 -1
- package/{chunk-ZLBNHUZF.js → chunk-E2PHUSPH.js} +1 -1
- package/{chunk-EDYUAYO2.js → chunk-EO32GXB6.js} +1 -1
- package/{chunk-QXE4YYQV.js → chunk-EZXX3QNG.js} +1 -1
- package/{chunk-KJM3M7Y3.js → chunk-FJM77N3D.js} +1 -1
- package/{chunk-ZOMQLK4A.js → chunk-FUYYSJF7.js} +1 -1
- package/{chunk-GN7VAGHH.js → chunk-G25BIGG3.js} +1 -1
- package/{chunk-F4PHXCVU.js → chunk-HR6W3DC4.js} +1 -1
- package/{chunk-3RODMLL2.js → chunk-I3DG6HPA.js} +1 -1
- package/{chunk-KU4BYYJE.js → chunk-IWB6L5HR.js} +1 -1
- package/{chunk-E57RWXDG.js → chunk-IYV5JRCZ.js} +1 -1
- package/{chunk-LF4HTMCE.js → chunk-JNPTKMYO.js} +1 -1
- package/{chunk-ILQI2X5T.js → chunk-JRHKJYE2.js} +1 -1
- package/{chunk-4GZGUASQ.js → chunk-KPSZN2UI.js} +1 -1
- package/{chunk-7F5JJ627.js → chunk-KU3G54A2.js} +2 -2
- package/{chunk-L27GCER2.js → chunk-LP4UYVTQ.js} +2 -2
- package/{chunk-GEYRJ2MR.js → chunk-LZCLNB3T.js} +1 -1
- package/{chunk-QSIXT7W7.js → chunk-MDE76CBT.js} +1 -1
- package/{chunk-MCR6MBS2.js → chunk-MGEVP222.js} +1 -1
- package/{chunk-7GORVGAV.js → chunk-N3AQU3B6.js} +1 -1
- package/{chunk-R45WWOYD.js → chunk-OW6NHTGL.js} +1 -1
- package/{chunk-7ET5ZE2L.js → chunk-OZYL2K6P.js} +1 -1
- package/{chunk-32QC4JFI.js → chunk-PQ2NDMDD.js} +1 -1
- package/{chunk-BVHTVDYP.js → chunk-PXAENMFN.js} +1 -1
- package/{chunk-OKT36WED.js → chunk-PZCAY2XI.js} +1 -1
- package/{chunk-GQ7SPEZH.js → chunk-QSZKELXB.js} +1 -1
- package/{chunk-2U3PIWWJ.js → chunk-RA2HD63W.js} +1 -1
- package/{chunk-WPHZJHC6.js → chunk-RCHTOR4U.js} +1 -1
- package/{chunk-5XVZW6BJ.js → chunk-RNMAINY3.js} +1 -1
- package/{chunk-MWRTPPEI.js → chunk-U52NCHP2.js} +1 -1
- package/{chunk-2RXAK5B6.js → chunk-U7I6X4QJ.js} +2 -2
- package/chunk-UMDFA3TV.js +1 -0
- package/{chunk-NTVIX4GB.js → chunk-UNKPZO2B.js} +1 -1
- package/{chunk-NSMNMKCV.js → chunk-VANY33VH.js} +1 -1
- package/{chunk-J346SEEU.js → chunk-VYR5D7SO.js} +1 -1
- package/{chunk-HYOAHRKW.js → chunk-VZHZFGQ2.js} +1 -1
- package/{chunk-DM42MH3E.js → chunk-WNEAYP2J.js} +1 -1
- package/{chunk-OILVKUFA.js → chunk-X7I6QMMX.js} +1 -1
- package/{chunk-JPNJTPYJ.js → chunk-Y4SHAFGQ.js} +1 -1
- package/{chunk-JPKZVL57.js → chunk-YI5IYWUO.js} +1 -1
- package/{chunk-VQ62YSFR.js → chunk-YZ76QE4R.js} +1 -1
- package/{chunk-KXWAD3X4.js → chunk-Z2MDQN57.js} +1 -1
- package/{chunk-RFHL2MJ4.js → chunk-ZM7C3PCP.js} +1 -1
- package/index.html +2 -2
- package/{main-ET3JU27S.js → main-ARGVLXJ4.js} +1 -1
- package/package.json +1 -1
- package/chunk-CPAPQNFC.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ze,b as et,c as tt,d as nt,e as ot,f as it}from"./chunk-TAN6GLIH.js";import{a as Xe}from"./chunk-YHLRDTIS.js";import{m as Y}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as fe,b as ge}from"./chunk-3VQUNDVT.js";import{b as se,c as Ke,g as qe,h as Qe,i as ie}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{a as le,b as me}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as j,b as U}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as Re,b as q}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as M}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as K,b as W}from"./chunk-ISIYG4D5.js";import{b as Z,c as Te,d as we,e as Me,f as De,g as Ae,h as Je}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{o as Ye,w as N,x as G}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as $,f as Pe,j as oe,k as be,m as Oe,n as Ee,o as He,p as Ie,v as Fe,x as J,y as pe}from"./chunk-MGIEURA2.js";import{b as re,d as ze,e as D,l as A}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import{a as ye}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{m as V,q as Ue,u as w}from"./chunk-DM2JLWKE.js";import{Dc as ve,Eb as f,Ec as H,Fc as ae,Ha as E,Mb as c,Oc as $e,Pb as X,Pc as We,Rb as B,Sb as P,Sc as u,Ub as b,Vb as O,Wb as r,Xb as a,Y as z,Yb as te,_ as F,ac as v,bd as ne,c as _e,ca as Se,cd as je,fc as y,gc as s,ia as C,ib as p,qa as h,ra as S,s as ee,sc as m,tc as g,uc as I,wc as Ve,yb as T}from"./chunk-6QJHEOXN.js";import{a as _,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=C(ye)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(k||{});var at={[k.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"},{typeID:31,side:"credit",label:"Sold Non-Inventory"}],[k.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[k.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[k.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[k.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:3,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[k.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[k.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[k.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[k.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.onSubmit())}),a()}}function xt(t,i){if(t&1&&(r(0,"div",5),f(1,gt,1,0,"p-button",6),a()),t&2){let e=s();p(),B(e.roleService.permissions().posSetup.edit?1:-1)}}function Ct(t,i){if(t&1&&(r(0,"p-tab",11),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),g(e.label)}}function ht(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function St(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",18),m(6),a()(),r(7,"p-select",19),f(8,ht,7,2,"ng-template",null,2,u)(10,St,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function yt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Pt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function bt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",21),m(6),a()(),r(7,"p-select",19),f(8,yt,7,2,"ng-template",null,2,u)(10,Pt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Ot(t,i){if(t&1&&(r(0,"p-tabpanel",11)(1,"div",12)(2,"div",13)(3,"div",14),b(4,vt,12,4,"div",15,P),a()(),r(6,"div",13)(7,"div",14),b(8,bt,12,4,"div",15,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Et(t,i){if(t&1){let e=v();r(0,"form",9),y("ngSubmit",function(){h(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",10)(2,"p-tablist"),b(3,Ct,2,2,"p-tab",11,P),a(),r(5,"p-tabpanels"),b(6,Ot,10,2,"p-tabpanel",11,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,i){if(t&1&&f(0,Et,8,3,"form",8),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var rt=(()=>{class t{constructor(){this.posConfigService=C(R),this.fb=C(Fe),this.roleService=C(Y),this.tab=E(k.POSGLOBAL_SELL),this.tabs=E(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=E(null),this.form=E([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return at[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let de=`${d}_${L}`;o.has(de)||(o.add(de),n.push({typeID:d,accountID:L||Xe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,xt,2,1,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),a())},dependencies:[M,it,ot,nt,tt,Ze,et,Ye,U,j,J,be,$,Pe,w,V,A,G,N,pe,Oe,Ie,Ee],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ft=t=>[t];function Tt(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),g(e.name.slice(0,10))}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Tt,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Mt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.accountName)}}function Dt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Mt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Ft,e.id)),p(),g(e.name),p(),O(e.accounts)}}function At(t,i){if(t&1&&(r(0,"p-table",5),f(1,wt,6,0,"ng-template",null,1,u)(3,Dt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Rt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){h(e);let l=s();return S(l.onSearch(o))}),f(1,At,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var lt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.paymentConfiguration=E(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&f(0,Rt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ie,se,Ke,w,V,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=Te(Ae(kt),we(t=>({first:ne(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ne(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),De(t=>{let i=C(R);return{updateFilter:n=>{Z(t,o=>x(_({},o),{filter:_(_({},o.filter),n)}))},getPOSOutlets:fe(_e(z(n=>i.fetchPOSOutletConfiguration(n).pipe(ge({next:o=>{Z(t,l=>x(_({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Me(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var Lt=t=>[t];function Nt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.value)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Nt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e)}}function Vt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Bt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Lt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,i){if(t&1&&m(0),t&2){let e=s(2);Ve(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function jt(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){h(e);let l=s();return S(l.onPage(o))}),f(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var mt=(()=>{class t{constructor(){this.store=C(Ge)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(_({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[ve([Ge])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return h(l),S(o.onSearch(L))}),f(1,jt,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,q,ie,se,A,D,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ut=()=>({height:"calc(100vh - 100px)"}),zt=()=>({height:"calc(100vh - 150px)"});function Ht(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOsOutletConfiguration())}),a()}}function Yt(t,i){if(t&1&&(r(0,"a",5),m(1,"Cancel"),a(),f(2,Ht,1,0,"p-button",6)),t&2){let e=s();p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function Jt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Kt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function qt(t,i){if(t&1&&(r(0,"div",13)(1,"span",15),m(2),a(),r(3,"p-select",16),f(4,Jt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),g((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Qt(t,i){t&1&&te(0,"hr")}function Xt(t,i){if(t&1&&(r(0,"div",10)(1,"h3",11),m(2),$e(3,"titlecase"),a(),r(4,"div",12),b(5,qt,8,3,"div",13,P),a()(),f(7,Qt,1,0,"hr",14)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),I(" ",We(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function Zt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",8)(3,"div",9),b(4,Xt,8,5,null,null,P),a()()()()),t&2){let e=s();X(H(5,Ut)),p(),X(H(6,zt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var st=(()=>{class t{constructor(){this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.outletForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.fb=C(Fe)}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["filter","","filterBy","code,name","formControlName","AccountID","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Yt,3,1,"ng-template",null,0,u)(3,Zt,6,7,"ng-template",null,1,u),a()),n&2&&c("hasMainWrapperPadding",!0)("pageTitle","Edit "+o.outletName)},dependencies:[M,w,V,Ue,q,pe,be,$,Pe,Oe,Ie,Ee,He,U,j,W,K,le,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=()=>({height:"calc(100vh - 100px)"}),on=()=>({width:"100%",height:"calc(100vh - 150px)"}),an=()=>({width:"100%"});function rn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(4);return S(o.updatePOSOutletConfiguration())}),a()}}function pn(t,i){if(t&1&&(r(0,"a",6),m(1,"Cancel"),a(),f(2,rn,1,0,"p-button",7)),t&2){let e=s(3);p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function ln(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function mn(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function sn(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"div",12)(3,"label",13),m(4),a()(),te(5,"div",14),r(6,"div",15)(7,"p-select",16),y("ngModelChange",function(o){let l=h(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),f(8,ln,7,2,"ng-template",null,2,u)(10,mn,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),g(e.outletName.slice(0,15)),p(3),X(H(7,an)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("options",o.paymentForm().options.chartOfAccount)("virtualScrollItemSize",50)("virtualScroll",!0)}}function cn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",9),b(3,sn,12,8,"div",10,P),a()()()),t&2){let e=s(3);X(H(4,nn)),p(),X(H(5,on)),p(2),O(e.paymentForm().form.accounts)}}function un(t,i){if(t&1&&(r(0,"app-main-panel",4),f(1,pn,3,1,"ng-template",null,0,u)(3,cn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("hasMainWrapperPadding",!0)("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")}}function dn(t,i){if(t&1&&f(0,un,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.paymentForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.router=C(ze)}ngOnInit(){this.route.paramMap.pipe(ee(e=>+e.get("id")),z(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Ne("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(_({},this.paymentForm()),{form:x(_({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ne("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],[3,"hasMainWrapperPadding","pageTitle",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","options","virtualScrollItemSize","virtualScroll"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&f(0,dn,1,1,"app-main-panel",4),n&2&&B(o.paymentForm()?0:-1)},dependencies:[q,Re,M,w,V,me,le,U,j,J,$,oe,A,D,G,N,W],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function _n(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSTaxConfiguration())}),a()}}function fn(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,_n,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function xn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Cn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),f(5,gn,7,2,"ng-template",null,2,u)(7,xn,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),g(e.name),p(),c("ngModel",o.taxForm().form[n].accountID)("options",o.taxForm().options.chartOfAccount)}}function hn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",11),b(4,Cn,9,3,"div",12,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ut=(()=>{class t{constructor(){this.taxForm=E(null),this.roleService=C(Y),this.POSSetupService=C(R)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(_({},this.taxForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,fn,4,1,"ng-template",null,0,u)(3,hn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,q,w,U,j,me,J,$,oe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Sn=()=>({"min-width":"50rem"}),vn=t=>[t];function yn(t,i){t&1&&te(0,"p-button",6)}function Pn(t,i){if(t&1&&f(0,yn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function bn(t,i){t&1&&(r(0,"tr")(1,"th",8),te(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function On(t,i){if(t&1&&(r(0,"tr")(1,"td"),te(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",ae(4,vn,e.id)),p(),g(e.name),p(2),g(e.description)}}function En(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){h(e);let l=s();return S(l.onSelectAll(o))}),f(2,bn,7,0,"ng-template",null,2,u)(4,On,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",H(2,Sn))}}var dt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.writeoffList=E(null),this.hasCheckedItems=ne(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(ee(e=>x(_({},e),{data:e.data.map(n=>x(_({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=x(_({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(_({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(_({},l),{checked:e.checked}));this.writeoffList.set(x(_({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Pn,1,1,"ng-template",null,0,u)(3,En,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,V,ie,se,qe,Qe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var In=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Fn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function Tn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function wn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function Mn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),f(5,Tn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),g(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),X(H(2,In)),p(4),O(e.writeOffForm().form)}}function An(t,i){if(t&1&&(r(0,"app-main-panel",5),f(1,Fn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var _t=(()=>{class t{constructor(){this.POSSetupService=C(R),this.route=C(re),this.writeOffForm=E(null)}ngOnInit(){this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(_({},this.writeOffForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&f(0,An,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,V,q,Re,me,le,U,j,J,$,oe,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=C(ye)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Rn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Be=Te(Ae(Rn),Je("POSExpenseOptionStore"),we(t=>({hasCheckedRows:ne(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ne(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),De(t=>{let i=C(Le);return{onRowSelect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!0}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!1}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>x(_({},d),{checked:n}));return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},getExpenseOptions:fe(_e(z(()=>i.getExpenseOptions().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(_({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:fe(_e(z(()=>i.getExpenseOptionsLoader().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Me({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function kn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSExpenseOptionConfiguration())}),a()}}function Ln(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,kn,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function Nn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Bn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateData(o,l))}),f(5,Nn,4,1,"ng-template",null,2,u)(7,Gn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),g(n.name),p(),c("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")("options",l.store.data().options.chartOfAccountOptions)}}function Vn(t,i){if(t&1&&b(0,Bn,9,3,"div",11,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function $n(t,i){t&1&&(r(0,"div",10)(1,"p"),m(2,"No expense options available."),a()())}function Wn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",9),f(4,Vn,2,0)(5,$n,3,0,"div",10),a()()()()),t&2){let e=s();p(4),B(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=C(Be),this.roleService=C(Y),this.expenseOptForm=E({ListData:[]}),this.expenseOptService=C(Le),this.originalData=E([]),je(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let de=n[L];return de&&d.AccountID!==de.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=x(_({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[ve([Be])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Ln,4,1,"ng-template",null,0,u)(3,Wn,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ie,W,K,G,N,w,D,U,j,pe,$,J,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nr=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:rt},{path:"outlets",component:mt},{path:"outlets/:id",component:st},{path:"payments",component:lt},{path:"payments/:id",component:ct},{path:"taxs",component:ut},{path:"writeoff",component:dt},{path:"writeoff/:id",component:_t},{path:"expense-option",component:ft}]}];export{nr as POS_SETUP_ROUTES};
|
|
1
|
+
import{a as Ze,b as et,c as tt,d as nt,e as ot,f as it}from"./chunk-TAN6GLIH.js";import{a as Xe}from"./chunk-YHLRDTIS.js";import{m as Y}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as fe,b as ge}from"./chunk-3VQUNDVT.js";import{b as se,c as Ke,g as qe,h as Qe,i as ie}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{a as le,b as me}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as j,b as U}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as Re,b as q}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as M}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as K,b as W}from"./chunk-ISIYG4D5.js";import{b as Z,c as Te,d as we,e as Me,f as De,g as Ae,h as Je}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{o as Ye,w as N,x as G}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as $,f as Pe,j as oe,k as be,m as Oe,n as Ee,o as He,p as Ie,v as Fe,x as J,y as pe}from"./chunk-MGIEURA2.js";import{b as re,d as ze,e as D,l as A}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import{a as ye}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{m as V,q as Ue,u as w}from"./chunk-DM2JLWKE.js";import{Dc as ve,Eb as f,Ec as H,Fc as ae,Ha as E,Mb as c,Oc as $e,Pb as X,Pc as We,Rb as B,Sb as P,Sc as u,Ub as b,Vb as O,Wb as r,Xb as a,Y as z,Yb as te,_ as F,ac as v,bd as ne,c as _e,ca as Se,cd as je,fc as y,gc as s,ia as C,ib as p,qa as h,ra as S,s as ee,sc as m,tc as g,uc as I,wc as Ve,yb as T}from"./chunk-6QJHEOXN.js";import{a as _,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=C(ye)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(k||{});var at={[k.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"},{typeID:31,side:"credit",label:"Sold Non-Inventory"}],[k.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[k.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[k.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[k.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:3,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[k.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[k.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[k.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[k.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.onSubmit())}),a()}}function xt(t,i){if(t&1&&(r(0,"div",5),f(1,gt,1,0,"p-button",6),a()),t&2){let e=s();p(),B(e.roleService.permissions().posSetup.edit?1:-1)}}function Ct(t,i){if(t&1&&(r(0,"p-tab",11),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),g(e.label)}}function ht(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function St(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",18),m(6),a()(),r(7,"p-select",19),f(8,ht,7,2,"ng-template",null,2,u)(10,St,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function yt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Pt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function bt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",21),m(6),a()(),r(7,"p-select",19),f(8,yt,7,2,"ng-template",null,2,u)(10,Pt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Ot(t,i){if(t&1&&(r(0,"p-tabpanel",11)(1,"div",12)(2,"div",13)(3,"div",14),b(4,vt,12,4,"div",15,P),a()(),r(6,"div",13)(7,"div",14),b(8,bt,12,4,"div",15,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Et(t,i){if(t&1){let e=v();r(0,"form",9),y("ngSubmit",function(){h(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",10)(2,"p-tablist"),b(3,Ct,2,2,"p-tab",11,P),a(),r(5,"p-tabpanels"),b(6,Ot,10,2,"p-tabpanel",11,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,i){if(t&1&&f(0,Et,8,3,"form",8),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var rt=(()=>{class t{constructor(){this.posConfigService=C(R),this.fb=C(Fe),this.roleService=C(Y),this.tab=E(k.POSGLOBAL_SELL),this.tabs=E(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=E(null),this.form=E([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return at[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let de=`${d}_${L}`;o.has(de)||(o.add(de),n.push({typeID:d,accountID:L||Xe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,xt,2,1,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),a())},dependencies:[M,it,ot,nt,tt,Ze,et,Ye,U,j,J,be,$,Pe,w,V,A,G,N,pe,Oe,Ie,Ee],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ft=t=>[t];function Tt(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),g(e.name.slice(0,10))}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Tt,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Mt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.accountName)}}function Dt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Mt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Ft,e.id)),p(),g(e.name),p(),O(e.accounts)}}function At(t,i){if(t&1&&(r(0,"p-table",5),f(1,wt,6,0,"ng-template",null,1,u)(3,Dt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Rt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){h(e);let l=s();return S(l.onSearch(o))}),f(1,At,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var lt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.paymentConfiguration=E(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&f(0,Rt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ie,se,Ke,w,V,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=Te(Ae(kt),we(t=>({first:ne(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ne(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),De(t=>{let i=C(R);return{updateFilter:n=>{Z(t,o=>x(_({},o),{filter:_(_({},o.filter),n)}))},getPOSOutlets:fe(_e(z(n=>i.fetchPOSOutletConfiguration(n).pipe(ge({next:o=>{Z(t,l=>x(_({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Me(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var Lt=t=>[t];function Nt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.value)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Nt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e)}}function Vt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Bt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Lt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,i){if(t&1&&m(0),t&2){let e=s(2);Ve(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function jt(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){h(e);let l=s();return S(l.onPage(o))}),f(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var mt=(()=>{class t{constructor(){this.store=C(Ge)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(_({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[ve([Ge])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return h(l),S(o.onSearch(L))}),f(1,jt,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,q,ie,se,A,D,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ut=()=>({height:"calc(100vh - 100px)"}),zt=()=>({height:"calc(100vh - 150px)"});function Ht(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOsOutletConfiguration())}),a()}}function Yt(t,i){if(t&1&&(r(0,"a",5),m(1,"Cancel"),a(),f(2,Ht,1,0,"p-button",6)),t&2){let e=s();p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function Jt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Kt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function qt(t,i){if(t&1&&(r(0,"div",13)(1,"span",15),m(2),a(),r(3,"p-select",16),f(4,Jt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),g((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Qt(t,i){t&1&&te(0,"hr")}function Xt(t,i){if(t&1&&(r(0,"div",10)(1,"h3",11),m(2),$e(3,"titlecase"),a(),r(4,"div",12),b(5,qt,8,3,"div",13,P),a()(),f(7,Qt,1,0,"hr",14)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),I(" ",We(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function Zt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",8)(3,"div",9),b(4,Xt,8,5,null,null,P),a()()()()),t&2){let e=s();X(H(5,Ut)),p(),X(H(6,zt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var st=(()=>{class t{constructor(){this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.outletForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.fb=C(Fe)}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["filter","","filterBy","code,name","formControlName","AccountID","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Yt,3,1,"ng-template",null,0,u)(3,Zt,6,7,"ng-template",null,1,u),a()),n&2&&c("hasMainWrapperPadding",!0)("pageTitle","Edit "+o.outletName)},dependencies:[M,w,V,Ue,q,pe,be,$,Pe,Oe,Ie,Ee,He,U,j,W,K,le,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=()=>({height:"calc(100vh - 100px)"}),on=()=>({width:"100%",height:"calc(100vh - 150px)"}),an=()=>({width:"100%"});function rn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(4);return S(o.updatePOSOutletConfiguration())}),a()}}function pn(t,i){if(t&1&&(r(0,"a",6),m(1,"Cancel"),a(),f(2,rn,1,0,"p-button",7)),t&2){let e=s(3);p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function ln(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function mn(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function sn(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"div",12)(3,"label",13),m(4),a()(),te(5,"div",14),r(6,"div",15)(7,"p-select",16),y("ngModelChange",function(o){let l=h(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),f(8,ln,7,2,"ng-template",null,2,u)(10,mn,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),g(e.outletName.slice(0,15)),p(3),X(H(7,an)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("options",o.paymentForm().options.chartOfAccount)("virtualScrollItemSize",50)("virtualScroll",!0)}}function cn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",9),b(3,sn,12,8,"div",10,P),a()()()),t&2){let e=s(3);X(H(4,nn)),p(),X(H(5,on)),p(2),O(e.paymentForm().form.accounts)}}function un(t,i){if(t&1&&(r(0,"app-main-panel",4),f(1,pn,3,1,"ng-template",null,0,u)(3,cn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("hasMainWrapperPadding",!0)("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")}}function dn(t,i){if(t&1&&f(0,un,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.paymentForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.router=C(ze)}ngOnInit(){this.route.paramMap.pipe(ee(e=>+e.get("id")),z(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Ne("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(_({},this.paymentForm()),{form:x(_({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ne("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],[3,"hasMainWrapperPadding","pageTitle",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","options","virtualScrollItemSize","virtualScroll"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&f(0,dn,1,1,"app-main-panel",4),n&2&&B(o.paymentForm()?0:-1)},dependencies:[q,Re,M,w,V,me,le,U,j,J,$,oe,A,D,G,N,W],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function _n(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSTaxConfiguration())}),a()}}function fn(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,_n,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function xn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Cn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),f(5,gn,7,2,"ng-template",null,2,u)(7,xn,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),g(e.name),p(),c("ngModel",o.taxForm().form[n].accountID)("options",o.taxForm().options.chartOfAccount)}}function hn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",11),b(4,Cn,9,3,"div",12,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ut=(()=>{class t{constructor(){this.taxForm=E(null),this.roleService=C(Y),this.POSSetupService=C(R)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(_({},this.taxForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,fn,4,1,"ng-template",null,0,u)(3,hn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,q,w,U,j,me,J,$,oe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Sn=()=>({"min-width":"50rem"}),vn=t=>[t];function yn(t,i){t&1&&te(0,"p-button",6)}function Pn(t,i){if(t&1&&f(0,yn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function bn(t,i){t&1&&(r(0,"tr")(1,"th",8),te(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function On(t,i){if(t&1&&(r(0,"tr")(1,"td"),te(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",ae(4,vn,e.id)),p(),g(e.name),p(2),g(e.description)}}function En(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){h(e);let l=s();return S(l.onSelectAll(o))}),f(2,bn,7,0,"ng-template",null,2,u)(4,On,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",H(2,Sn))}}var dt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.writeoffList=E(null),this.hasCheckedItems=ne(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(ee(e=>x(_({},e),{data:e.data.map(n=>x(_({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=x(_({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(_({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(_({},l),{checked:e.checked}));this.writeoffList.set(x(_({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Pn,1,1,"ng-template",null,0,u)(3,En,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,V,ie,se,qe,Qe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var In=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Fn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function Tn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function wn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function Mn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),f(5,Tn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),g(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),X(H(2,In)),p(4),O(e.writeOffForm().form)}}function An(t,i){if(t&1&&(r(0,"app-main-panel",5),f(1,Fn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var _t=(()=>{class t{constructor(){this.POSSetupService=C(R),this.route=C(re),this.writeOffForm=E(null)}ngOnInit(){this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(_({},this.writeOffForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&f(0,An,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,V,q,Re,me,le,U,j,J,$,oe,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=C(ye)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Rn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Be=Te(Ae(Rn),Je("POSExpenseOptionStore"),we(t=>({hasCheckedRows:ne(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ne(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),De(t=>{let i=C(Le);return{onRowSelect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!0}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!1}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>x(_({},d),{checked:n}));return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},getExpenseOptions:fe(_e(z(()=>i.getExpenseOptions().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(_({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:fe(_e(z(()=>i.getExpenseOptionsLoader().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Me({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function kn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSExpenseOptionConfiguration())}),a()}}function Ln(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,kn,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function Nn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Bn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateData(o,l))}),f(5,Nn,4,1,"ng-template",null,2,u)(7,Gn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),g(n.name),p(),c("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")("options",l.store.data().options.chartOfAccountOptions)}}function Vn(t,i){if(t&1&&b(0,Bn,9,3,"div",11,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function $n(t,i){t&1&&(r(0,"div",10)(1,"p"),m(2,"No expense options available."),a()())}function Wn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",9),f(4,Vn,2,0)(5,$n,3,0,"div",10),a()()()()),t&2){let e=s();p(4),B(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=C(Be),this.roleService=C(Y),this.expenseOptForm=E({ListData:[]}),this.expenseOptService=C(Le),this.originalData=E([]),je(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let de=n[L];return de&&d.AccountID!==de.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=x(_({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[ve([Be])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Ln,4,1,"ng-template",null,0,u)(3,Wn,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ie,W,K,G,N,w,D,U,j,pe,$,J,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nr=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:rt},{path:"outlets",component:mt},{path:"outlets/:id",component:st},{path:"payments",component:lt},{path:"payments/:id",component:ct},{path:"taxs",component:ut},{path:"writeoff",component:dt},{path:"writeoff/:id",component:_t},{path:"expense-option",component:ft}]}];export{nr as POS_SETUP_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-QSZKELXB.js";import{a}from"./chunk-G3BJCT7T.js";import{ca as o,ia as n}from"./chunk-6QJHEOXN.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ce,b as Et}from"./chunk-SOD2BIQR.js";import{f as kt}from"./chunk-TAN6GLIH.js";import"./chunk-GIRWHO6Q.js";import{b as Vt}from"./chunk-YHLRDTIS.js";import{m as Ke}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as Oe,b as ve}from"./chunk-3VQUNDVT.js";import{b as xt,g as It,h as Tt,i as St}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as st}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as wt}from"./chunk-OW2ND5HU.js";import{a as Ct}from"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import{a as lt}from"./chunk-FMAG3RQL.js";import{i as vt}from"./chunk-
|
|
1
|
+
import{a as ce,b as Et}from"./chunk-SOD2BIQR.js";import{f as kt}from"./chunk-TAN6GLIH.js";import"./chunk-GIRWHO6Q.js";import{b as Vt}from"./chunk-YHLRDTIS.js";import{m as Ke}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as Oe,b as ve}from"./chunk-3VQUNDVT.js";import{b as xt,g as It,h as Tt,i as St}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as st}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as wt}from"./chunk-OW2ND5HU.js";import{a as Ct}from"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import{a as lt}from"./chunk-FMAG3RQL.js";import{i as vt}from"./chunk-YI5IYWUO.js";import{a as ct}from"./chunk-VM56C6ZV.js";import{a as ht,b as mt}from"./chunk-ISIYG4D5.js";import{b as A,c as ft,d as gt,e as _t,f as bt,g as yt,h as Ot}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as ye,p as rt,r as pt,w as dt,x as ut}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{$ as Ze,Ba as et,E as We,Ea as tt,J as je,Ja as it,Ma as nt,N as Xe,Na as U,Oa as ot,R as Je,S as se,Va as at,Y as Ye,a as Ae,e as Be,f as He,i as ge,l as ze,m as qe,oa as le,ra as w,sa as M,ta as _e,v as Qe,wa as be,x as Ne,y as Ue}from"./chunk-MGIEURA2.js";import{d as De,e as Re}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as me,l as Ge,m as Q,n as $e,o as fe,u as N}from"./chunk-DM2JLWKE.js";import{$b as Z,$c as he,Aa as x,Cb as ue,Dc as ae,Eb as f,Ec as Me,Fc as q,Gc as Le,Ha as L,Lb as y,Mb as r,Qb as Y,Sc as T,Wb as d,Xb as u,Y as pe,Yb as S,Zb as D,_ as J,_b as R,_c as k,ac as V,ba as Ie,bd as G,c as re,ca as Te,cd as Pe,da as Se,fc as I,gc as p,ia as E,ib as c,lc as F,mc as z,nc as v,ob as de,oc as C,pa as Ve,qa as h,ra as m,rc as ee,s as xe,sc as b,tc as K,ua as ke,uc as te,wc as Fe,xc as ie,yb as H,yc as ne,zb as Ee,zc as oe}from"./chunk-6QJHEOXN.js";import{a as g,b as _}from"./chunk-YQFG5XE2.js";var Lt={data:[],count:0,meta:{filter:{pagination:1,pageSize:10,rolesID:null,text:""},options:{roles:[]}},filter:{pagination:1,pageSize:10,rolesID:null,text:""}},Ce=ft(yt(Lt),Ot("GroupStore"),gt(t=>({first:G(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:G(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:G(()=>t.data().some(s=>s.checked)),checkedData:G(()=>t.data().filter(s=>s.checked).map(s=>s.id))})),bt(t=>{let s=E(ce),e={setFilter(n){A(t,i=>_(g({},i),{filter:n}))},onRowSelect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!0}):a);return _(g({},i),{data:o})})},onRowUnselect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!1}):a);return _(g({},i),{data:o})})},onHeaderCheckboxToggle(n){A(t,i=>{let o=i.data.map(a=>_(g({},a),{checked:n}));return _(g({},i),{data:o})})},getGroupList:Oe(re(pe(n=>s.getGroupList(n).pipe(ve(i=>{A(t,o=>_(g({},o),{data:i.data,count:i.count}))},i=>{console.error("Error fetching group list:",i)}))))),getGroupLoader:Oe(re(pe(()=>s.getGroupLoader().pipe(ve({next:n=>{let i=n.options.roles.map(o=>_(g({},o),{id:Vt()}));A(t,o=>_(g({},o),{meta:_(g({},n),{options:_(g({},n.options),{roles:i})}),filter:n.filter})),e.getGroupList(t.filter)},error:n=>{console.error("Error fetching group loader:",n)}})))))};return e}),_t(t=>({onInit:()=>{t.getGroupLoader()}})));var $t=t=>({$implicit:t});function Dt(t,s){t&1&&Z(0)}function Rt(t,s){if(t&1&&(D(0),f(1,Dt,1,0,"ng-container",8),R()),t&2){let e=p().$implicit,n=p();c(),r("ngTemplateOutlet",n.optionTemplate)("ngTemplateOutletContext",q(2,$t,e==null?null:e.option))}}function Kt(t,s){if(t&1&&(d(0,"span",9),b(1),u()),t&2){let e=p().$implicit,n=p();y("data-pc-section","text"),c(),K(n.getOptionLabelToRender(e))}}function At(t,s){t&1&&S(0,"AngleRightIcon")}function Bt(t,s){}function Ht(t,s){t&1&&f(0,Bt,0,0,"ng-template")}function zt(t,s){if(t&1&&(d(0,"span",10),f(1,At,1,0,"AngleRightIcon",11)(2,Ht,1,0,null,12),u()),t&2){let e=p(2);y("data-pc-section","groupIcon"),c(),r("ngIf",!e.groupicon),c(),r("ngTemplateOutlet",e.groupicon)}}function qt(t,s){if(t&1){let e=V();d(0,"p-cascadeselect-sub",13),I("onChange",function(i){h(e);let o=p(2);return m(o.onChange.emit(i))})("onFocusChange",function(i){h(e);let o=p(2);return m(o.onFocusChange.emit(i))})("onFocusEnterChange",function(i){h(e);let o=p(2);return m(o.onFocusEnterChange.emit(i))}),u()}if(t&2){let e=p().$implicit,n=p();r("role","group")("selectId",n.selectId)("focusedOptionId",n.focusedOptionId)("activeOptionPath",n.activeOptionPath)("options",n.getOptionGroupChildren(e))("optionLabel",n.optionLabel)("optionValue",n.optionValue)("level",n.level+1)("optionGroupLabel",n.optionGroupLabel)("optionGroupChildren",n.optionGroupChildren)("dirty",n.dirty)("optionTemplate",n.optionTemplate)}}function Qt(t,s){if(t&1){let e=V();d(0,"li",3)(1,"div",4),I("click",function(i){let o=h(e).$implicit,a=p();return m(a.onOptionClick(i,o))})("mouseenter",function(i){let o=h(e).$implicit,a=p();return m(a.onOptionMouseEnter(i,o))})("mousemove",function(i){let o=h(e).$implicit,a=p();return m(a.onOptionMouseMove(i,o))}),f(2,Rt,2,4,"ng-container",5)(3,Kt,2,2,"ng-template",null,0,T)(5,zt,3,3,"span",6),u(),f(6,qt,1,12,"p-cascadeselect-sub",7),u()}if(t&2){let e=s.$implicit,n=s.index,i=ee(4),o=p();r("ngClass",o.getItemClass(e))("id",o.getOptionId(e)),y("aria-level",o.level+1)("aria-setsize",o.options.length)("data-pc-section","item")("aria-label",o.getOptionLabelToRender(e))("aria-selected",o.isOptionGroup(e)?void 0:o.isOptionSelected(e))("aria-posinset",n+1),c(),y("data-pc-section","content"),c(),r("ngIf",o.optionTemplate)("ngIfElse",i),c(3),r("ngIf",o.isOptionGroup(e)),c(),r("ngIf",o.isOptionGroup(e)&&o.isOptionActive(e))}}var Nt=["value"],Ut=["option"],Wt=["header"],jt=["footer"],Xt=["triggericon"],Jt=["loadingicon"],Yt=["optiongroupicon"],Zt=["clearicon"],ei=["focusInput"],ti=["container"],ii=["panel"],ni=["overlay"],oi=(t,s)=>({$implicit:t,placeholder:s}),ai=t=>({"p-cascadeselect-overlay p-component":!0,"p-cascadeselect-mobile-active":t});function si(t,s){t&1&&Z(0)}function li(t,s){if(t&1&&(D(0),f(1,si,1,0,"ng-container",16),R()),t&2){let e=p();c(),r("ngTemplateOutlet",e.valueTemplate||e._valueTemplate)("ngTemplateOutletContext",Le(2,oi,e.value,e.placeholder))}}function ci(t,s){if(t&1&&b(0),t&2){let e=p();te(" ",e.label()," ")}}function ri(t,s){if(t&1){let e=V();d(0,"TimesIcon",18),I("click",function(i){h(e);let o=p(2);return m(o.clear(i))}),u()}t&2&&y("data-pc-section","clearicon")("aria-hidden",!0)}function pi(t,s){}function di(t,s){t&1&&f(0,pi,0,0,"ng-template")}function ui(t,s){if(t&1){let e=V();d(0,"span",18),I("click",function(i){h(e);let o=p(2);return m(o.clear(i))}),f(1,di,1,0,null,19),u()}if(t&2){let e=p(2);y("data-pc-section","clearicon")("aria-hidden",!0),c(),r("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function hi(t,s){if(t&1&&(D(0),f(1,ri,1,2,"TimesIcon",17)(2,ui,2,3,"span",17),R()),t&2){let e=p();c(),r("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),r("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function mi(t,s){t&1&&Z(0)}function fi(t,s){if(t&1&&(D(0),f(1,mi,1,0,"ng-container",19),R()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function gi(t,s){if(t&1&&S(0,"span",22),t&2){let e=p(3);r("ngClass","p-cascadeselect-loading-icon pi-spin "+e.loadingIcon)}}function _i(t,s){t&1&&S(0,"span",23),t&2&&Y("p-cascadeselect-loading-icon pi pi-spinner pi-spin")}function bi(t,s){if(t&1&&(D(0),f(1,gi,1,1,"span",20)(2,_i,1,2,"span",21),R()),t&2){let e=p(2);c(),r("ngIf",e.loadingIcon),c(),r("ngIf",!e.loadingIcon)}}function yi(t,s){if(t&1&&(D(0),f(1,fi,2,1,"ng-container",12)(2,bi,3,2,"ng-container",12),R()),t&2){let e=p();c(),r("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),r("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function Oi(t,s){t&1&&S(0,"ChevronDownIcon",26),t&2&&r("styleClass","p-cascadeselect-dropdown-icon")}function vi(t,s){}function Ci(t,s){t&1&&f(0,vi,0,0,"ng-template")}function wi(t,s){if(t&1&&(d(0,"span",27),f(1,Ci,1,0,null,19),u()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.triggerIconTemplate||e._triggerIconTemplate)}}function xi(t,s){if(t&1&&f(0,Oi,1,1,"ChevronDownIcon",24)(1,wi,2,1,"span",25),t&2){let e=p();r("ngIf",!e.triggerIconTemplate&&!e._triggerIconTemplate),c(),r("ngIf",e.triggerIconTemplate||e._triggerIconTemplate)}}function Ii(t,s){}function Ti(t,s){t&1&&f(0,Ii,0,0,"ng-template")}function Si(t,s){}function Vi(t,s){t&1&&f(0,Si,0,0,"ng-template")}function ki(t,s){if(t&1){let e=V();d(0,"div",28,6),f(2,Ti,1,0,null,19),d(3,"div",29)(4,"p-cascadeselect-sub",30),I("onChange",function(i){h(e);let o=p();return m(o.onOptionClick(i))})("onFocusChange",function(i){h(e);let o=p();return m(o.onOptionMouseMove(i))})("onFocusEnterChange",function(i){h(e);let o=p();return m(o.onOptionMouseEnter(i))}),u()(),d(5,"span",14),b(6),u(),f(7,Vi,1,0,null,19),u()}if(t&2){let e=p();Y(e.panelStyleClass),r("ngClass",q(24,ai,e.queryMatches()))("ngStyle",e.panelStyle),y("data-pc-section","panel"),c(2),r("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),y("data-pc-section","wrapper"),c(),r("options",e.processedOptions)("selectId",e.id)("focusedOptionId",e.focused?e.focusedOptionId:void 0)("activeOptionPath",e.activeOptionPath())("optionLabel",e.optionLabel)("optionValue",e.optionValue)("level",0)("optionTemplate",e.optionTemplate||e._optionTemplate)("groupicon",e.groupIconTemplate||e.groupIconTemplate)("optionGroupLabel",e.optionGroupLabel)("optionGroupChildren",e.optionGroupChildren)("optionDisabled",e.optionDisabled)("root",!0)("dirty",e.dirty)("role","tree"),c(2),te(" ",e.selectedMessageText," "),c(),r("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var Ei=({dt:t})=>`
|
|
2
2
|
.p-cascadeselect {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as J}from"./chunk-
|
|
1
|
+
import{a as y,b as J}from"./chunk-UNKPZO2B.js";import"./chunk-Y4SHAFGQ.js";import{m as j}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as R,b as O}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import{a as V}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as x,Ec as S,Mb as c,Oc as l,Pb as C,Pc as s,Rb as T,Sc as b,W as k,Wb as n,Xb as o,Y as A,Yb as u,_ as B,ac as h,fc as v,gc as a,h as M,ia as m,ib as r,qa as g,ra as _,s as d,sa as P,ta as w,yb as $}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,f){if(t&1){let e=h();n(0,"p-button",6),v("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,f){if(t&1){let e=h();n(0,"p-button",7),l(1,"async"),l(2,"async"),v("onClick",function(){g(e);let p=a(2);return _(p.onMigrate())}),o()}if(t&2){let e=a(2);c("disabled",s(1,2,e.countInBooks$)!==0)("pTooltip",s(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,f){if(t&1&&(n(0,"div",3),x(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),T(e.roleService.permissions().migrate.delete?1:-1),r(),T(e.roleService.permissions().migrate.create?2:-1)}}function X(t,f){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),l(4,"async"),P(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),l(8,"async"),o()()()),t&2){let e=a();C(S(12,K)),r(),C(S(13,K)),r(2),c("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),c("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var xe=(()=>{class t{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new M(void 0),this.pageTitle="Tax Account",this.roleService=m(j)}ngOnInit(){let e=this.refresh$.pipe(A(()=>this.migrateService.getTaxAccountCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(d(i=>Number(i.pos))),this.countInBooks$=e.pipe(d(i=>Number(i.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(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-tax-account"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),x(1,W,3,2,"ng-template",null,0,b)(3,X,9,14,"ng-template",null,1,b),o()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[z,I,E,O,R,H,G,q,L,J,N,D],encapsulation:2})}}return t})();export{xe as TaxAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we}from"./chunk-B7TGZ7J3.js";import"./chunk-GQ7SPEZH.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-X6KL7VKV.js";import{a as ye,b as Ve,c as Se}from"./chunk-3O7NQ6AZ.js";import"./chunk-WL6ZZCYW.js";import{b as _e,d as ue,e as fe,f as xe,i as ge}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as ce,b as de}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as pe,f as me,i as se}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as le}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as oe,x as re}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import{d as ne}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as X,m as Y,r as Z,s as ee,u as te}from"./chunk-DM2JLWKE.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
|
|
1
|
+
import{a as we}from"./chunk-4BAARBYV.js";import"./chunk-QSZKELXB.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-X6KL7VKV.js";import{a as ye,b as Ve,c as Se}from"./chunk-3O7NQ6AZ.js";import"./chunk-WL6ZZCYW.js";import{b as _e,d as ue,e as fe,f as xe,i as ge}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as ce,b as de}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as pe,f as me,i as se}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as le}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as oe,x as re}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import{d as ne}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as X,m as Y,r as Z,s as ee,u as te}from"./chunk-DM2JLWKE.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as p}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{i as d}from"./chunk-
|
|
1
|
+
import{m as p}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{i as d}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-YZ76QE4R.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-DM2JLWKE.js";import{Eb as l,Sc as c,Wb as t,Xb as n,Yb as m,ia as r,sc as i,yb as a}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";function f(e,u){e&1&&(t(0,"div",2),m(1,"img",3),t(2,"h1",4),i(3,"You are not authorized"),n(),t(4,"p",5),i(5," This page require "),t(6,"span",6),i(7,"Journal"),n(),i(8," role. Please contact your Administrator to gain access! "),n()())}var y=(()=>{class e{constructor(){this.roleService=r(p)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-forbidden"]],decls:3,vars:0,consts:[["content",""],["pageTitle","Unauthorized"],[1,"h-100","d-flex","flex-column","justify-content-center","align-items-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg","alt","Forbidden"],[1,"fs-6","fw-semibold"],[1,"fs-3"],[1,"fw-semibold"]],template:function(o,g){o&1&&(t(0,"app-main-panel",1),l(1,f,9,0,"ng-template",null,0,c),n())},dependencies:[d],encapsulation:2})}}return e})();export{y as ForbiddenComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-TAN6GLIH.js";import"./chunk-7L5IAWG2.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-II7KELI4.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.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-TAN6GLIH.js";import"./chunk-7L5IAWG2.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-II7KELI4.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import{i as w}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as S}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-YZ76QE4R.js";import{a as P}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{u as M}from"./chunk-DM2JLWKE.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 K}from"./chunk-H7YYGW7V.js";import{b as q}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-H7YYGW7V.js";import{b as q}from"./chunk-Y4SHAFGQ.js";import{a as z,b as H}from"./chunk-KARG227P.js";import{a as J}from"./chunk-XKI7WLHE.js";import{a as O,b as W}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as I}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as G,b as A}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{o as j,w as k,x as B}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as y,e as D,f as M,k as T,m as w,p as N,v as V,y as R}from"./chunk-MGIEURA2.js";import{d as P}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{u as F}from"./chunk-DM2JLWKE.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-
|
|
1
|
+
import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-PQ2NDMDD.js").then(o=>o.UserPageComponent)},{path:"groups",loadComponent:()=>import("./chunk-5MLCIFDJ.js").then(o=>o.GroupPageComponent)},{path:"groups/forms",loadComponent:()=>import("./chunk-OW6NHTGL.js").then(o=>o.GroupFormComponent)}]}];export{t as USERS_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,b as J}from"./chunk-
|
|
1
|
+
import{a as T,b as J}from"./chunk-UNKPZO2B.js";import"./chunk-Y4SHAFGQ.js";import{m as j}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as R,b as O}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import{a as V}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as C,Ec as v,Mb as m,Oc as c,Pb as y,Pc as l,Rb as h,Sc as S,W as M,Wb as n,Xb as o,Y as k,Yb as u,_ as A,ac as x,fc as P,gc as a,h as b,ia as s,ib as r,qa as g,ra as _,s as f,sa as B,ta as w,yb as $}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,d){if(t&1){let e=x();n(0,"p-button",6),P("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,d){if(t&1){let e=x();n(0,"p-button",7),c(1,"async"),c(2,"async"),P("onClick",function(){g(e);let p=a(2);return _(p.migratePaymentAccount())}),o()}if(t&2){let e=a(2);m("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,d){if(t&1&&(n(0,"div",3),C(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function X(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),c(4,"async"),B(),n(5,"svg",10),u(6,"path",11),o(),w(),u(7,"app-migration-cards",12),c(8,"async"),o()()()),t&2){let e=a();y(v(12,K)),r(),y(v(13,K)),r(2),m("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),m("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var Ce=(()=>{class t{constructor(){this.migrateService=s(T),this.toastr=s(V),this.refresh$=new b(void 0),this.pageTitle="Payment Account",this.roleService=s(j)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getPaymentMethodAccountCount()),A(i=>console.log("API response:",i)),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}migratePaymentAccount(){this.migrateService.migratePaymentMethod().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatPaymentAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-payment-account"]],features:[F([T])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),C(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),o()),i&2&&m("pageTitle",p.pageTitle)},dependencies:[z,I,E,O,R,H,G,q,L,J,N,D],encapsulation:2})}}return t})();export{Ce as PaymentAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-QSZKELXB.js";import"./chunk-WL6ZZCYW.js";import{d as e}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import"./chunk-DM2JLWKE.js";import{ia as n}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var a=(t,u)=>{let o=n(r),i=n(e),p=o.isAuthenticated(),m=!o.isTokenExpired(),h=o.checkAuthKeysExists();return p&&m&&h?(i.navigateByUrl("/pages/dashboard"),!1):!0};var A=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-Z2MDQN57.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-JRBGNG24.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-OOCLTY27.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6DTQWLB3.js").then(t=>t.TimeoutComponent)},{path:"unauthorized",loadComponent:()=>import("./chunk-3IOJJMQE.js").then(t=>t.FullComponent),children:[{path:"",loadComponent:()=>import("./chunk-7XSFPN5T.js").then(t=>t.ForbiddenComponent)}]}];export{A as AuthenticationRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-QSZKELXB.js";import{d as r}from"./chunk-DZCJWJUG.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};
|