dealposbooks 5.44.0 → 5.44.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-6OCDD2VV.js → chunk-34ZDIPLQ.js} +1 -1
- package/{chunk-F6H2QCCJ.js → chunk-3GMNWQ4O.js} +1 -1
- package/{chunk-JHEM227I.js → chunk-3PE357LH.js} +1 -1
- package/{chunk-KUIMS2IF.js → chunk-4WZNT7HU.js} +2 -2
- package/chunk-5AYZWIY7.js +129 -0
- package/{chunk-FNFO6AVF.js → chunk-66GNKXBN.js} +1 -1
- package/{chunk-4T6QN2RE.js → chunk-67QDIMSX.js} +1 -1
- package/{chunk-5KEWUV6Y.js → chunk-6U4GCBVE.js} +1 -1
- package/{chunk-LM4RIIMP.js → chunk-AJJKE2BQ.js} +1 -1
- package/{chunk-SNW33PYU.js → chunk-ANSKAR27.js} +1 -1
- package/{chunk-4I3BWHCX.js → chunk-CVZD55KC.js} +1 -1
- package/{chunk-3VHF335G.js → chunk-DEHET2VB.js} +1 -1
- package/{chunk-4HHIZRO6.js → chunk-DVYNSZMT.js} +1 -1
- package/{chunk-YJMDDXR4.js → chunk-E7I5DMET.js} +1 -1
- package/{chunk-3W5UW35D.js → chunk-EAY4MSAG.js} +1 -1
- package/{chunk-JOG6C23J.js → chunk-EZYKQ37F.js} +1 -1
- package/{chunk-5B67ZBOZ.js → chunk-EZYXC3XG.js} +1 -1
- package/{chunk-FFBSSXIQ.js → chunk-F2YCPTZP.js} +1 -1
- package/chunk-FQRRGJBE.js +1 -0
- package/{chunk-3O5IG2I5.js → chunk-GKLYTLRU.js} +1 -1
- package/{chunk-QESM5Q2K.js → chunk-GVGBHSSG.js} +1 -1
- package/{chunk-WHKSOIEB.js → chunk-JMQ6F5OE.js} +1 -1
- package/{chunk-RTKLMAD2.js → chunk-JWYIOQAK.js} +1 -1
- package/{chunk-3OIEMO4M.js → chunk-K2R75JPS.js} +1 -1
- package/{chunk-YA2SSBKC.js → chunk-KIHQBEUB.js} +1 -1
- package/{chunk-4HHJ5R7N.js → chunk-KJIXCKL5.js} +1 -1
- package/{chunk-RLMIWX2X.js → chunk-KTLUPG4K.js} +1 -1
- package/chunk-LCMRIBIT.js +1 -0
- package/{chunk-AXKR3XWH.js → chunk-LS6TAF6F.js} +1 -1
- package/{chunk-KA2VVOAZ.js → chunk-N5TXIUZC.js} +1 -1
- package/{chunk-KJSQM6QV.js → chunk-NXR3V2JV.js} +1 -1
- package/{chunk-44DWYEN2.js → chunk-OU4FTAZJ.js} +1 -1
- package/{chunk-JDAKCHP7.js → chunk-PEWRMO2G.js} +1 -1
- package/{chunk-4APMBPRQ.js → chunk-PJ6CKD3W.js} +1 -1
- package/{chunk-37JYZ6OY.js → chunk-PWTXFW37.js} +1 -1
- package/{chunk-74IKP6MW.js → chunk-QQYL4NZQ.js} +1 -1
- package/{chunk-VLMTLTJW.js → chunk-RA4DQS2E.js} +1 -1
- package/{chunk-GS5EH3PP.js → chunk-SYQTPTNH.js} +1 -1
- package/{chunk-OZLITDAS.js → chunk-TF653LAA.js} +1 -1
- package/{chunk-RAWRL4SB.js → chunk-TXWGV6T4.js} +1 -1
- package/{chunk-DAAN6KOH.js → chunk-UBBPXJOO.js} +1 -1
- package/{chunk-Q5SW5O7M.js → chunk-UBI7GIQ2.js} +1 -1
- package/{chunk-FNSSFA2E.js → chunk-UCBXC762.js} +1 -1
- package/{chunk-GWQC7WDM.js → chunk-WGAGVPIF.js} +1 -1
- package/{chunk-FYNUXFI4.js → chunk-WNER2DF6.js} +1 -1
- package/{chunk-2OKUDKGZ.js → chunk-XPLRGNGB.js} +1 -1
- package/{chunk-NL2ZRT3O.js → chunk-YCFPNVDF.js} +1 -1
- package/{chunk-TIKX2ROV.js → chunk-ZKTPC2K6.js} +1 -1
- package/{chunk-E7GFPYZR.js → chunk-ZLMF4J3Y.js} +2 -2
- package/index.html +2 -2
- package/{main-VL5G6E3C.js → main-EXNLIQFS.js} +1 -1
- package/package.json +1 -1
- package/chunk-5K6M5QIJ.js +0 -129
- package/chunk-F3HWMSRB.js +0 -1
- package/chunk-SMZ363LC.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-OB46Z7ZH.js";import{a as Te,b as Fe}from"./chunk-NHZLS6JU.js";import{d as te,e as qe,i as we,j as Me,k as ne}from"./chunk-VPQDUC77.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import{a as Ae}from"./chunk-KXE3J4PK.js";import{a as re,b as pe}from"./chunk-E3QNEH3B.js";import"./chunk-JUCJGYST.js";import{a as Y,b as K}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{a as Ee,b as z}from"./chunk-WXT6EZ2V.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{h as F}from"./chunk-SNW33PYU.js";import"./chunk-L3PZS6EL.js";import{a as H,b as $}from"./chunk-5JV52UYK.js";import{a as ee,b as ye,c as be,d as Pe,e as Oe,f as Ie,g as Je}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{o as Ke,w as G,x as L}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{e as j,f as _e,j as ae,k as ge,l as xe,m as he,n as Ye,o as Ce,u as Se,w as Z,x as ve}from"./chunk-72LNXEXV.js";import{b as ie,d as ze,e as N,l as D}from"./chunk-EFDD6Q3K.js";import{a as fe}from"./chunk-4APMBPRQ.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{k as A,o as He,s as T}from"./chunk-SB5MSLCX.js";import{$b as v,Cc as de,Db as _,Dc as W,Ec as oe,Ha as M,Lb as s,Nc as Ue,Ob as q,Oc as je,Qb as $e,Rb as b,Rc as u,Tb as P,Ub as O,Vb as a,Wb as i,Xb as B,Y as U,_ as w,bd as X,c as se,ca as ue,cb as Ve,ec as y,fc as c,hb as p,ia as h,qa as C,ra as S,rc as m,s as Q,sc as d,tc as I,vc as We,xb as E}from"./chunk-6K5LNQ4J.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=h(fe)}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=ue({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 it={[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"}],[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:27,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 _t(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function gt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function xt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function St(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),P(4,Ct,12,4,"div",14,b),i()(),a(6,"div",12)(7,"div",13),P(8,yt,12,4,"div",14,b),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Pt(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),P(3,gt,2,2,"p-tab",10,b),i(),a(5,"p-tabpanels"),P(6,bt,10,2,"p-tabpanel",10,b),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,r){if(t&1&&_(0,Pt,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(R),this.fb=h(Se),this.tab=M(k.POSGLOBAL_SELL),this.tabs=M(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=M(null),this.form=M([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(w(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 it[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:g,accountID:V}of l){let Be=`${g}_${V}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:V||Qe}))}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(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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",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&&(a(0,"app-main-panel",4),_(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),i())},dependencies:[F,ot,nt,tt,et,Xe,Ze,Ke,K,Y,Z,ge,j,_e,T,A,D,L,G,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Tt(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),P(4,Et,2,1,"th",7,b),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function Ft(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function wt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),P(4,Ft,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,It,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Mt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Tt,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("value",e.paymentConfiguration().payment)}}function Dt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Mt,5,1,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)("scrollable",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(R),this.paymentConfiguration=M(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(w(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(w(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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&&_(0,Dt,3,2,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[F,ne,te,qe,T,A,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Rt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=ye(Ie(Rt),be(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(R);return{updateFilter:n=>{ee(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(U(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{ee(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Pe(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function At(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Nt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),P(3,At,2,1,"th",null,b),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Gt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Lt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),P(4,Gt,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,kt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function $t(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Nt,5,0,"ng-template",null,1,u)(4,Lt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(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(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet"]],features:[de([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();a(0,"app-main-panel",5),y("search",function(V){return C(l),S(o.onSearch(V))}),_(1,$t,10,5,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)("scrollable",!0)},dependencies:[F,T,z,ne,te,D,N,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),Ut=()=>({height:"calc(100vh - 150px)"});function jt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Ht(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function zt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Yt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Ht,7,2,"ng-template",null,2,u)(6,zt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function Kt(t,r){t&1&&B(0,"hr")}function Jt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),P(5,Yt,8,3,"div",12,b),i()(),_(7,Kt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,V=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(V.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function qt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),P(4,Jt,8,5,null,null,b),i()()()()),t&2){let e=c();q(W(5,Wt)),p(),q(W(6,Ut)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.outletForm=M(null),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.fb=h(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),w(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()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}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]})}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()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["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"],["formControlName","AccountID","filter","","filterBy","code,name","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&&(a(0,"app-main-panel",4),_(1,jt,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[F,T,A,He,z,ve,ge,j,_e,xe,Ce,he,Ye,K,Y,$,H,re,L,G,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function on(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),B(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),q(W(7,tn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),P(3,rn,12,8,"div",9,b),i()()()),t&2){let e=c(3);q(W(4,Zt)),p(),q(W(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,r){if(t&1&&_(0,ln,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.paymentForm=M(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),w(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),w(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["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","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&_(0,mn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[z,Ee,F,T,A,pe,re,K,Y,Z,j,ae,D,N,L,G,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function cn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function sn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function un(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function dn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,sn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,r){if(t&1&&(a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),P(4,dn,9,3,"div",11,b),i()()()()),t&2){let e=c();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(R),this.taxForm=M(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(w(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(w(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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",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","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,cn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,z,T,K,Y,pe,Z,j,ae,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,r){t&1&&B(0,"p-button",6)}function hn(t,r){if(t&1&&_(0,xn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Cn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function Sn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td")(4,"a",10),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",oe(4,gn,e.id)),p(),d(e.name),p(2),d(e.description)}}function vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onSelectAll(o))}),_(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.writeoffList().data)("tableStyle",W(2,_n))}}var st=(()=>{class t{constructor(){this.POSSetupService=h(R),this.writeoffList=M(null),this.hasCheckedItems=X(()=>{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(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),w(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(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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&&(a(0,"app-main-panel",4),_(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,T,A,ne,te,we,Me,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function bn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Pn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function On(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function In(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Pn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),P(5,In,9,5,"div",12,b),i()()()()()),t&2){let e=c(2);p(),q(W(2,yn)),p(4),O(e.writeOffForm().form)}}function Tn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,bn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(R),this.route=h(ie),this.writeOffForm=M(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),w(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});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=E({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&&_(0,Tn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[F,T,A,z,Ee,pe,re,K,Y,Z,j,ae,D,N,L,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var dt=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fn={data:{expenseOptions:[]}},Le=ye(Ie(Fn),Je("POSExpenseOptionStore"),be(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(dt);return{onRowSelect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(U(()=>r.getExpenseOptions().pipe(Fe({next:n=>{ee(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Pe({onInit:t=>{t.getExpenseOptions()}}));function wn(t,r){t&1&&B(0,"p-button",6)}function Mn(t,r){if(t&1&&_(0,wn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Dn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Rn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),B(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function kn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Dn,9,0,"ng-template",null,2,u)(4,Rn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().expenseOptions)}}var ft=(()=>{class t{constructor(){this.store=h(Le)}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)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-expense-option"]],features:[de([Le])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option",3,"scrollable"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","1rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Mn,1,1,"ng-template",null,0,u)(3,kn,6,1,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,ne,te,we,Me,$,H,L,G,T,A],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ga=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:mt},{path:"taxs",component:ct},{path:"writeoff",component:st},{path:"writeoff/:id",component:ut},{path:"expense-option",component:ft}]}];export{Ga as POS_SETUP_ROUTES};
|
|
1
|
+
import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-OB46Z7ZH.js";import{a as Te,b as Fe}from"./chunk-NHZLS6JU.js";import{d as te,e as qe,i as we,j as Me,k as ne}from"./chunk-VPQDUC77.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import{a as Ae}from"./chunk-KXE3J4PK.js";import{a as re,b as pe}from"./chunk-E3QNEH3B.js";import"./chunk-JUCJGYST.js";import{a as Y,b as K}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{a as Ee,b as z}from"./chunk-WXT6EZ2V.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{h as F}from"./chunk-ANSKAR27.js";import"./chunk-L3PZS6EL.js";import{a as H,b as $}from"./chunk-5JV52UYK.js";import{a as ee,b as ye,c as be,d as Pe,e as Oe,f as Ie,g as Je}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{o as Ke,w as G,x as L}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{e as j,f as _e,j as ae,k as ge,l as xe,m as he,n as Ye,o as Ce,u as Se,w as Z,x as ve}from"./chunk-72LNXEXV.js";import{b as ie,d as ze,e as N,l as D}from"./chunk-EFDD6Q3K.js";import{a as fe}from"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{k as A,o as He,s as T}from"./chunk-SB5MSLCX.js";import{$b as v,Cc as de,Db as _,Dc as W,Ec as oe,Ha as M,Lb as s,Nc as Ue,Ob as q,Oc as je,Qb as $e,Rb as b,Rc as u,Tb as P,Ub as O,Vb as a,Wb as i,Xb as B,Y as U,_ as w,bd as X,c as se,ca as ue,cb as Ve,ec as y,fc as c,hb as p,ia as h,qa as C,ra as S,rc as m,s as Q,sc as d,tc as I,vc as We,xb as E}from"./chunk-6K5LNQ4J.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=h(fe)}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=ue({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 it={[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"}],[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:27,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 _t(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function gt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function xt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function St(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),P(4,Ct,12,4,"div",14,b),i()(),a(6,"div",12)(7,"div",13),P(8,yt,12,4,"div",14,b),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Pt(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),P(3,gt,2,2,"p-tab",10,b),i(),a(5,"p-tabpanels"),P(6,bt,10,2,"p-tabpanel",10,b),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,r){if(t&1&&_(0,Pt,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(R),this.fb=h(Se),this.tab=M(k.POSGLOBAL_SELL),this.tabs=M(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=M(null),this.form=M([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(w(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 it[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:g,accountID:V}of l){let Be=`${g}_${V}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:V||Qe}))}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(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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",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&&(a(0,"app-main-panel",4),_(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),i())},dependencies:[F,ot,nt,tt,et,Xe,Ze,Ke,K,Y,Z,ge,j,_e,T,A,D,L,G,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Tt(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),P(4,Et,2,1,"th",7,b),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function Ft(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function wt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),P(4,Ft,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,It,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Mt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Tt,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("value",e.paymentConfiguration().payment)}}function Dt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Mt,5,1,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)("scrollable",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(R),this.paymentConfiguration=M(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(w(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(w(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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&&_(0,Dt,3,2,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[F,ne,te,qe,T,A,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Rt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=ye(Ie(Rt),be(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(R);return{updateFilter:n=>{ee(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(U(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{ee(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Pe(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function At(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Nt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),P(3,At,2,1,"th",null,b),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Gt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Lt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),P(4,Gt,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,kt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function $t(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Nt,5,0,"ng-template",null,1,u)(4,Lt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(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(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet"]],features:[de([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();a(0,"app-main-panel",5),y("search",function(V){return C(l),S(o.onSearch(V))}),_(1,$t,10,5,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)("scrollable",!0)},dependencies:[F,T,z,ne,te,D,N,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),Ut=()=>({height:"calc(100vh - 150px)"});function jt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Ht(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function zt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Yt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Ht,7,2,"ng-template",null,2,u)(6,zt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function Kt(t,r){t&1&&B(0,"hr")}function Jt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),P(5,Yt,8,3,"div",12,b),i()(),_(7,Kt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,V=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(V.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function qt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),P(4,Jt,8,5,null,null,b),i()()()()),t&2){let e=c();q(W(5,Wt)),p(),q(W(6,Ut)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.outletForm=M(null),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.fb=h(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),w(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()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}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]})}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()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["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"],["formControlName","AccountID","filter","","filterBy","code,name","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&&(a(0,"app-main-panel",4),_(1,jt,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[F,T,A,He,z,ve,ge,j,_e,xe,Ce,he,Ye,K,Y,$,H,re,L,G,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function on(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),B(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),q(W(7,tn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),P(3,rn,12,8,"div",9,b),i()()()),t&2){let e=c(3);q(W(4,Zt)),p(),q(W(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,r){if(t&1&&_(0,ln,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.paymentForm=M(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),w(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),w(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["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","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&_(0,mn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[z,Ee,F,T,A,pe,re,K,Y,Z,j,ae,D,N,L,G,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function cn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function sn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function un(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function dn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,sn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,r){if(t&1&&(a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),P(4,dn,9,3,"div",11,b),i()()()()),t&2){let e=c();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(R),this.taxForm=M(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(w(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(w(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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",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","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,cn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,z,T,K,Y,pe,Z,j,ae,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,r){t&1&&B(0,"p-button",6)}function hn(t,r){if(t&1&&_(0,xn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Cn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function Sn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td")(4,"a",10),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",oe(4,gn,e.id)),p(),d(e.name),p(2),d(e.description)}}function vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onSelectAll(o))}),_(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.writeoffList().data)("tableStyle",W(2,_n))}}var st=(()=>{class t{constructor(){this.POSSetupService=h(R),this.writeoffList=M(null),this.hasCheckedItems=X(()=>{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(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),w(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(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({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&&(a(0,"app-main-panel",4),_(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,T,A,ne,te,we,Me,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function bn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Pn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function On(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function In(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Pn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),P(5,In,9,5,"div",12,b),i()()()()()),t&2){let e=c(2);p(),q(W(2,yn)),p(4),O(e.writeOffForm().form)}}function Tn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,bn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(R),this.route=h(ie),this.writeOffForm=M(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),w(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});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=E({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&&_(0,Tn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[F,T,A,z,Ee,pe,re,K,Y,Z,j,ae,D,N,L,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var dt=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fn={data:{expenseOptions:[]}},Le=ye(Ie(Fn),Je("POSExpenseOptionStore"),be(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(dt);return{onRowSelect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(U(()=>r.getExpenseOptions().pipe(Fe({next:n=>{ee(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Pe({onInit:t=>{t.getExpenseOptions()}}));function wn(t,r){t&1&&B(0,"p-button",6)}function Mn(t,r){if(t&1&&_(0,wn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Dn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Rn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),B(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function kn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Dn,9,0,"ng-template",null,2,u)(4,Rn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().expenseOptions)}}var ft=(()=>{class t{constructor(){this.store=h(Le)}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)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-expense-option"]],features:[de([Le])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option",3,"scrollable"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","1rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Mn,1,1,"ng-template",null,0,u)(3,kn,6,1,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,ne,te,we,Me,$,H,L,G,T,A],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ga=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:mt},{path:"taxs",component:ct},{path:"writeoff",component:st},{path:"writeoff/:id",component:ut},{path:"expense-option",component:ft}]}];export{Ga as POS_SETUP_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-AJJKE2BQ.js";import"./chunk-7COI2POD.js";import{d as n}from"./chunk-EFDD6Q3K.js";import"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import"./chunk-SB5MSLCX.js";import{ia as e}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var a=(t,m)=>{let o=e(r),i=e(n),p=o.isAuthenticated(),s=!o.isTokenExpired(),u=o.checkAuthKeysExists();return p&&s&&u?(i.navigateByUrl("/pages/dashboard"),!1):!0};var C=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-UBI7GIQ2.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-MWFWXJG3.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-SVHOGUGR.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-MZAFOBGT.js").then(t=>t.TimeoutComponent)}];export{C as AuthenticationRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-4I3BWHCX.js";import{a as je}from"./chunk-G4XX7EU2.js";import{a as Be,b as He}from"./chunk-BUYRVZ5Z.js";import{a as Oe}from"./chunk-K4P3JOA6.js";import{a as re}from"./chunk-LM4RIIMP.js";import{b as A}from"./chunk-NL2ZRT3O.js";import"./chunk-CNXEJBY5.js";import{a as ze}from"./chunk-XKI7WLHE.js";import"./chunk-NMSYINDE.js";import"./chunk-7COI2POD.js";import{a as z,b as j}from"./chunk-NHZLS6JU.js";import{d as Ne,i as ke,j as Me,k as Pe}from"./chunk-VPQDUC77.js";import{a as Ae,b as De}from"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import"./chunk-JUCJGYST.js";import{a as Fe,b as Je}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{g as Ee,h as Ve}from"./chunk-SNW33PYU.js";import{b as Ie,c as Te}from"./chunk-L3PZS6EL.js";import{a as Ce,b as be}from"./chunk-5JV52UYK.js";import{a as y,b as Se,c as ve,d as ye,e as we,f as Re}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{b as ae,c as le,e as me,f as pe,k as se,l as ce,o as de,u as ue,x as fe}from"./chunk-72LNXEXV.js";import"./chunk-EFDD6Q3K.js";import"./chunk-4APMBPRQ.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{h as Z,j as ee,k as te,n as ie,p as ne,s as oe}from"./chunk-SB5MSLCX.js";import{$b as w,Bb as K,Cc as Q,Db as g,Dc as X,Ec as E,Ha as k,Lb as c,Nc as I,Oc as Y,Pc as V,Rc as v,Vb as r,Wb as o,Xb as b,Y as N,_ as H,bd as T,c as F,cb as U,db as L,ec as R,fc as _,hb as m,ia as C,qa as h,ra as x,rc as s,s as J,sc as S,tc as M,vc as W,wc as $,xb as G,xc as P,yc as q}from"./chunk-6K5LNQ4J.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var $e={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},O=Se(Re($e),ve(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),we(t=>{let a=C(D),e=C(A);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(F(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(F(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ye(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var B=t=>({"ng-invalid ng-dirty":t}),qe=()=>({});function Qe(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function Xe(t,a){if(t&1&&g(0,Qe,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Ye(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Ze(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,L),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,U),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function et(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function tt(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function it(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Ye,18,0,"ng-template",null,3,v)(4,Ze,22,18,"ng-template",null,4,v)(6,et,1,3,"ng-template",null,5,v)(8,tt,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function nt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function mt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function pt(t,a){if(t&1&&(r(0,"div"),g(1,mt,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function st(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),g(5,nt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,rt,2,1,"div",30),b(13,"p-datepicker",31),g(14,lt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,pt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(17,B,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(19,B,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",Y(19,15,e.customerSuggestions$)),m(5),c("autoNumeric",X(21,qe))("ngClass",E(22,B,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var ei=(()=>{class t extends ze{constructor(){super(),this.store=C(O),this.generateJournalService=C(D),this.authService=C(re),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(ue),this.dayjsService=C(A)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Ge,customerID:Ke,paymentState:We}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),pageSize:this.fb.control(u,[le.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Ge),customerID:this.fb.control(Ke),paymentState:this.fb.control(We)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=je);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(H(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([O]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AR Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,Xe,1,1,"ng-template",null,0,v)(3,it,10,5,"ng-template",null,1,v),s(5," <"),g(6,st,25,24,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,oe,Z,ee,te,ie,ne,Pe,Ne,ke,Me,xe,he,be,Ce,fe,se,ae,me,pe,ce,de,Je,Fe,De,Ae,He,Be,ge,_e,Ee,Te,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ei as ARJournalComponent};
|
|
1
|
+
import{a as D}from"./chunk-CVZD55KC.js";import{a as je}from"./chunk-G4XX7EU2.js";import{a as Be,b as He}from"./chunk-BUYRVZ5Z.js";import{a as Oe}from"./chunk-K4P3JOA6.js";import{a as re}from"./chunk-AJJKE2BQ.js";import{b as A}from"./chunk-YCFPNVDF.js";import"./chunk-CNXEJBY5.js";import{a as ze}from"./chunk-XKI7WLHE.js";import"./chunk-NMSYINDE.js";import"./chunk-7COI2POD.js";import{a as z,b as j}from"./chunk-NHZLS6JU.js";import{d as Ne,i as ke,j as Me,k as Pe}from"./chunk-VPQDUC77.js";import{a as Ae,b as De}from"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import"./chunk-JUCJGYST.js";import{a as Fe,b as Je}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{g as Ee,h as Ve}from"./chunk-ANSKAR27.js";import{b as Ie,c as Te}from"./chunk-L3PZS6EL.js";import{a as Ce,b as be}from"./chunk-5JV52UYK.js";import{a as y,b as Se,c as ve,d as ye,e as we,f as Re}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{b as ae,c as le,e as me,f as pe,k as se,l as ce,o as de,u as ue,x as fe}from"./chunk-72LNXEXV.js";import"./chunk-EFDD6Q3K.js";import"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{h as Z,j as ee,k as te,n as ie,p as ne,s as oe}from"./chunk-SB5MSLCX.js";import{$b as w,Bb as K,Cc as Q,Db as g,Dc as X,Ec as E,Ha as k,Lb as c,Nc as I,Oc as Y,Pc as V,Rc as v,Vb as r,Wb as o,Xb as b,Y as N,_ as H,bd as T,c as F,cb as U,db as L,ec as R,fc as _,hb as m,ia as C,qa as h,ra as x,rc as s,s as J,sc as S,tc as M,vc as W,wc as $,xb as G,xc as P,yc as q}from"./chunk-6K5LNQ4J.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var $e={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},O=Se(Re($e),ve(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),we(t=>{let a=C(D),e=C(A);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(F(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(F(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ye(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var B=t=>({"ng-invalid ng-dirty":t}),qe=()=>({});function Qe(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function Xe(t,a){if(t&1&&g(0,Qe,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Ye(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Ze(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,L),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,U),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function et(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function tt(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function it(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Ye,18,0,"ng-template",null,3,v)(4,Ze,22,18,"ng-template",null,4,v)(6,et,1,3,"ng-template",null,5,v)(8,tt,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function nt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function mt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function pt(t,a){if(t&1&&(r(0,"div"),g(1,mt,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function st(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),g(5,nt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,rt,2,1,"div",30),b(13,"p-datepicker",31),g(14,lt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,pt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(17,B,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(19,B,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",Y(19,15,e.customerSuggestions$)),m(5),c("autoNumeric",X(21,qe))("ngClass",E(22,B,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var ei=(()=>{class t extends ze{constructor(){super(),this.store=C(O),this.generateJournalService=C(D),this.authService=C(re),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(ue),this.dayjsService=C(A)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Ge,customerID:Ke,paymentState:We}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),pageSize:this.fb.control(u,[le.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Ge),customerID:this.fb.control(Ke),paymentState:this.fb.control(We)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=je);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(H(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([O]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AR Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,Xe,1,1,"ng-template",null,0,v)(3,it,10,5,"ng-template",null,1,v),s(5," <"),g(6,st,25,24,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,oe,Z,ee,te,ie,ne,Pe,Ne,ke,Me,xe,he,be,Ce,fe,se,ae,me,pe,ce,de,Je,Fe,De,Ae,He,Be,ge,_e,Ee,Te,Ie,Oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ei as ARJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-KIHQBEUB.js";import{b as q}from"./chunk-YCFPNVDF.js";import{a as z,b as H}from"./chunk-M5PA3FZY.js";import{a as J}from"./chunk-XKI7WLHE.js";import{a as O,b as W}from"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{h as I}from"./chunk-ANSKAR27.js";import"./chunk-L3PZS6EL.js";import{a as G,b as A}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{o as j,w as k,x as B}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{b as y,e as D,f as M,k as T,l as w,o as N,u as V,x as R}from"./chunk-72LNXEXV.js";import{d as P}from"./chunk-EFDD6Q3K.js";import"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{s as F}from"./chunk-SB5MSLCX.js";import{$b as b,Bb as S,Db as p,Lb as c,Rc as a,Vb as i,Wb as t,Xb as f,_ as C,ec as E,fc as u,hb as _,ia as m,qa as x,ra as h,rc as l,xb as v}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";function L(e,d){if(e&1){let o=b();i(0,"p-button",4),E("onClick",function(){x(o);let n=u();return h(n.onSubmit())}),t()}}function Q(e,d){e&1&&(i(0,"div",13)(1,"h3",14),l(2,"General"),t(),i(3,"span",15),l(4,"Enter your closing Fiscal Date"),t()())}function U(e,d){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,Q,5,0,"ng-template",null,2,a),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),l(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),l(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=u();_(7),c("formGroup",o.form)}}var he=(()=>{class e extends J{constructor(){super(),this.closingEntriesService=m(K),this.dayjsService=m(q),this.fb=m(V),this.router=m(P)}ngOnInit(){this.initForm()}initForm(){this.form=this.fb.group({Period:this.fb.control(new Date),Note:this.fb.control("")})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{Period:o}=this.form.getRawValue(),r=Object.entries(this.form.getRawValue()).reduce((n,[s,g])=>(s==="Period"?n[s]=this.dayjsService.from(o)?this.dayjsService.format(g):"":n[s]=g,n),{});this.closingEntriesService.createClosingEntry(r).pipe(C(()=>{this.router.navigate(["/pages/accounting-setup/closing-entries"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-closing-form"]],features:[S],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Closing Entries Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"col-4"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","Period","fluid",""],["formControlName","Note","rows","5","cols","30","pTextarea",""],[1,"d-flex","flex-column","mx-2"],[1,"fs-5","m-0"],[1,"fs-3"]],template:function(r,n){r&1&&(i(0,"app-main-panel",3),p(1,L,1,0,"ng-template",null,0,a)(3,U,16,1,"ng-template",null,1,a),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[I,F,A,G,W,O,j,H,z,B,k,R,T,y,D,M,w,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{he as ClosingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-KIHQBEUB.js";import{a as D,b as H}from"./chunk-NHZLS6JU.js";import{d as Y,i as Z,j as ee,k as te}from"./chunk-VPQDUC77.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import"./chunk-JUCJGYST.js";import"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{h as X}from"./chunk-ANSKAR27.js";import"./chunk-L3PZS6EL.js";import{a as f,b as $,c as q,d as G,e as J,f as Q,g as W}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as K,x as O}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import{e as L}from"./chunk-EFDD6Q3K.js";import"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{k as j,p as F,s as A}from"./chunk-SB5MSLCX.js";import{$b as R,Cc as B,Db as E,Lb as h,Nc as v,Pc as M,Rc as _,Vb as r,Wb as l,Xb as S,Y as k,_ as N,bd as b,c as P,ec as T,fc as g,hb as d,ia as x,qa as u,ra as C,rc as p,s as V,sc as w,vc as z,xb as U}from"./chunk-6K5LNQ4J.js";import{a,b as c}from"./chunk-YQFG5XE2.js";var ne={data:[],count:0,filter:{PageSize:20,PageNumber:1}},I=$(Q(ne),W("Closing Entries Store"),q(t=>({first:b(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:b(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.count())),hasCheckedRows:b(()=>t.data().some(s=>s.checked)),selectedItems:b(()=>t.data().filter(s=>s.checked))})),J(t=>{let s=x(y),e={updateFilter:o=>{f(t,n=>c(a({},n),{filter:a(a({},n.filter),o)}))},onRowSelect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!0}):m);return c(a({},n),{data:i})})},onRowUnselect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!1}):m);return c(a({},n),{data:i})})},onHeaderCheckboxToggle(o){f(t,n=>{let i=n.data.map(m=>c(a({},m),{checked:o}));return c(a({},n),{data:i})})},getClosingEntries:D(P(k(o=>s.getClosingEntries(o).pipe(V(n=>n.map(i=>c(a({},i),{checked:!1}))),H({next:n=>{f(t,i=>c(a({},i),{data:n})),e.getClosingEntryCount()},error:n=>{console.error("Error fetching closing entries:",n)}}))))),getClosingEntryCount:D(P(k(()=>s.getClosingEntryCount().pipe(H({next:({count:o})=>{f(t,n=>c(a({},n),{count:o}))},error:o=>{console.error("Error fetching closing entry count:",o)}})))))};return e}),G(t=>({onInit:()=>{t.getClosingEntries(t.filter)}})));function oe(t,s){if(t&1){let e=R();r(0,"p-button",11),T("onClick",function(){u(e);let n=g(2);return C(n.onDeleteClosingEntries())}),l()}}function ie(t,s){if(t&1&&(r(0,"div",7),E(1,oe,1,0,"p-button",8),r(2,"a",9),S(3,"i",10),p(4," Add"),l()()),t&2){let e=g();d(),h("ngIf",e.store.hasCheckedRows())}}function re(t,s){t&1&&(r(0,"tr")(1,"th",13),S(2,"p-tableHeaderCheckbox"),l(),r(3,"th"),p(4,"Period"),l(),r(5,"th"),p(6,"Note"),l(),r(7,"th"),p(8,"Created"),l(),r(9,"th"),p(10,"CreatedBy"),l()())}function ae(t,s){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",14),l(),r(3,"td"),p(4),v(5,"date"),l(),r(6,"td"),p(7),l(),r(8,"td"),p(9),v(10,"date"),l(),r(11,"td"),p(12),l()()),t&2){let e=s.$implicit;d(2),h("value",e),d(2),w(M(5,5,e.period,"d MMM y")),d(3),w(e.note),d(2),w(M(10,8,e.created,"d MMM y")),d(3),w(e.creatorName)}}function le(t,s){if(t&1&&p(0),t&2){let e=g(2);z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function se(t,s){t&1&&(r(0,"tr")(1,"td",15)(2,"span"),p(3," No journal entries found. "),l()()())}function ce(t,s){if(t&1){let e=R();r(0,"p-table",12),T("onPage",function(n){u(e);let i=g();return C(i.onPageChange(n))})("onRowSelect",function(n){u(e);let i=g();return C(i.onRowSelect(n))})("onRowUnselect",function(n){u(e);let i=g();return C(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){u(e);let i=g();return C(i.onHeaderCheckboxToggle(n))}),E(1,re,11,0,"ng-template",null,2,_)(3,ae,13,11,"ng-template",null,3,_)(5,le,1,3,"ng-template",null,4,_)(7,se,4,0,"ng-template",null,5,_),l()}if(t&2){let e=g();h("value",e.store.data())("paginator",!0)("totalRecords",e.store.count())("lazy",!0)("rows",e.store.filter().PageSize)("scrollHeight","calc(100vh - 142px)")}}var Ve=(()=>{class t{constructor(){this.store=x(I),this.closingEntryService=x(y)}onPageChange(e){let o=e.first/e.rows+1;this.store.updateFilter(c(a({},this.store.filter()),{PageSize:o}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onDeleteClosingEntries(){let e=this.store.selectedItems().map(o=>o.id).join(",");console.log("Deleting closing entries with IDs:",e),this.closingEntryService.deleteClosingEntry(e).pipe(N(()=>{this.store.updateFilter(a({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-closing-page"]],features:[B([I])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Closing Entries List",3,"scrollable"],[1,"d-flex","gap-2"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollHeight"],[2,"width","1rem"],[3,"value"],["colspan","5"]],template:function(o,n){o&1&&(r(0,"app-main-panel",6),E(1,ie,5,1,"ng-template",null,0,_)(3,ce,9,6,"ng-template",null,1,_),l()),o&2&&h("scrollable",!0)},dependencies:[X,A,j,F,te,Y,Z,ee,L,O,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Ve as ClosingPageComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as un}from"./chunk-
|
|
1
|
+
import{a as un}from"./chunk-AJJKE2BQ.js";import{a as qn}from"./chunk-MS6WBVQX.js";import{a as Xn}from"./chunk-AF357XP4.js";import"./chunk-7COI2POD.js";import{a as Fn}from"./chunk-CWHL7PNC.js";import{a as $n}from"./chunk-VRKBMD72.js";import{b as Wn}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{b as jn}from"./chunk-WXT6EZ2V.js";import{a as Vn}from"./chunk-AJZ7YLT4.js";import{a as Dn}from"./chunk-ATJ55H5D.js";import{b as Yn,c as Ti}from"./chunk-L3PZS6EL.js";import{b as Gn}from"./chunk-5JV52UYK.js";import{c as Mn}from"./chunk-ARXP327B.js";import{a as et,c as An,f as ai,o as Bn,p as Rn,t as Hn,u as Si,w as Nn,x as oi}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{Da as si,G as Sn,Ia as Ln,J as Tn,Ja as kn,K as Pn,Ka as zn,La as ri,Ma as ge,P as Ie,Q as _t,R as Nt,S as En,Ua as Je,b as mn,e as fn,f as gn,h as hn,ia as On,j as vn,k as wn,ma as In,p as bn,q as yn,r as _n,s as Cn,w as ni,x as xn}from"./chunk-72LNXEXV.js";import{b as rn,d as an,e as on,f as ln,l as Ht}from"./chunk-EFDD6Q3K.js";import{a as cn,c as Mi}from"./chunk-PJ6CKD3W.js";import{a as pn}from"./chunk-ZDTMCWOO.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{H as sn,h as ct,j as ii,k as Ft,l as Bt,m as Rt,n as tn,s as we,t as Oe,z as nn}from"./chunk-SB5MSLCX.js";import{$b as ve,$c as Vt,Aa as We,Ab as Qi,Ba as Wi,Bb as Ke,Cc as Ze,Da as qi,Db as X,Dc as Ji,Ea as xe,Ec as pe,Fa as wt,Fc as Be,Gc as ti,Ha as Ee,Kb as Z,La as Ui,Lb as $,Nb as Ki,Nc as Dt,Ob as Qt,Oc as $t,Pb as ye,Qb as Kt,Rb as Zt,Rc as dt,Tb as Jt,Ub as ei,Vb as G,W as Xi,Wb as N,Xb as te,Yb as at,Zb as ot,_b as Me,_c as pt,ba as Yi,bd as en,ca as Ye,cb as bi,da as je,db as qe,ec as ie,fc as H,gc as bt,hb as R,hc as lt,ia as ae,kc as fe,lc as yt,mc as ne,nb as Ue,nc as se,pa as ji,qa as U,qc as Lt,ra as Q,rc as le,s as wi,sb as Ut,sc as Fe,t as Gi,tc as yi,ua as Ae,uc as Zi,wc as kt,xb as he,xc as zt,yb as Qe,yc as At}from"./chunk-6K5LNQ4J.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
|
|
2
2
|
.p-inputgroup,
|
|
3
3
|
.p-inputgroup .p-floatlabel,
|
|
4
4
|
.p-inputgroup .p-iftalabel {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee,b as Ct}from"./chunk-
|
|
1
|
+
import{a as ee,b as Ct}from"./chunk-N5TXIUZC.js";import{a as bt}from"./chunk-G4XX7EU2.js";import{f as xt}from"./chunk-OB46Z7ZH.js";import"./chunk-E3ZGQRZ3.js";import{a as wt}from"./chunk-XKI7WLHE.js";import{a as rt}from"./chunk-AF357XP4.js";import"./chunk-7COI2POD.js";import{a as X,b as Y}from"./chunk-NHZLS6JU.js";import{d as _t,i as ft,j as ht,k as gt}from"./chunk-VPQDUC77.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import"./chunk-JUCJGYST.js";import{a as dt,b as ut}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{h as mt}from"./chunk-ANSKAR27.js";import{a as Ke}from"./chunk-L3PZS6EL.js";import{a as it,b as nt}from"./chunk-5JV52UYK.js";import{a as D,b as ot,c as at,d as st,e as lt,f as pt,g as ct}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{a as We,f as L,k as Je,m as Xe,o as Ye,s as et,w as J,x as tt}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{A as ze,C as qe,K as Ge,La as $e,Ma as K,Ua as Ze,c as W,e as Oe,f as Ae,l as Be,ma as je,o as He,u as Ne,x as Qe,z as de}from"./chunk-72LNXEXV.js";import{b as Pe,d as Re,e as Le}from"./chunk-EFDD6Q3K.js";import"./chunk-PJ6CKD3W.js";import"./chunk-ZDTMCWOO.js";import{c as Me,d as se,f as le,h as pe,i as ce,k as me}from"./chunk-F2X3VGZZ.js";import{h as j,k as $,m as Ve,s as Z}from"./chunk-SB5MSLCX.js";import{$b as T,$c as Fe,Aa as A,Bb as H,Cc as G,Db as _,Ec as V,Fc as De,Ha as R,Jc as Ee,Kb as E,Lb as s,Ob as be,Pb as ne,Qb as xe,Rb as N,Rc as x,Tb as Q,Ub as z,Vb as l,Wb as p,Xb as y,Y as O,Yb as Ce,Zb as ye,_ as te,_b as F,_c as I,bd as P,c as M,ca as he,cd as Ue,da as ge,ec as b,fc as c,gc as ve,hb as a,hc as ke,ia as C,kc as U,lc as q,mc as v,nc as k,qa as d,qc as Te,ra as u,rc as g,sc as S,tc as Se,ua as ie,vc as Ie,wc as re,xb as B,xc as oe,yb as we,yc as ae}from"./chunk-6K5LNQ4J.js";import{a as f,b as h}from"./chunk-YQFG5XE2.js";var kt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1},options:{users:[],groups:[],accessTypes:[]}}},ue=ot(ct("UserStore"),pt(kt),at(t=>({first:P(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:P(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:P(()=>t.data().some(o=>o.checked)),checkedData:P(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:P(()=>t.data().find(o=>o.checked)?.userID||null)})),lt(t=>{let o=C(ee);return{setFilter(n){D(t,i=>h(f({},i),{filter:n}))},onRowSelect(n){D(t,i=>{let r=i.data.map(m=>m.userID===n.userID?h(f({},m),{checked:!0}):m);return h(f({},i),{data:r})})},onRowUnselect(n){D(t,i=>{let r=i.data.map(m=>m.userID===n.userID?h(f({},m),{checked:!1}):m);return h(f({},i),{data:r})})},onHeaderCheckboxToggle(n){let i=localStorage.getItem("AUTH_USERNAME");D(t,r=>{let m=r.data.map(w=>w.userName!==i?h(f({},w),{checked:n}):h(f({},w),{checked:!1}));return h(f({},r),{data:m})})},getUserLoader:X(M(O(()=>o.getUserLoaderList().pipe(Y({next:n=>{D(t,i=>h(f({},i),{meta:n}))},error:n=>{console.error("Failed to fetch user loader list:",n)}}))))),getUserFormMeta:X(M(O(n=>o.getUserFormMeta(n).pipe(Y({next:i=>{D(t,r=>h(f({},r),{metaForm:i}))},error:i=>{console.error("Failed to fetch user form meta:",i)}}))))),getUsers:X(M(O(n=>o.getUsers(n).pipe(Y({next:i=>{D(t,r=>h(f({},r),{data:i.data.map(m=>h(f({},m),{checked:!1})),count:i.count}))},error:i=>{console.error("Failed to fetch users:",i)}})))))}}),st({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var It=["header"],Dt=["footer"],Et=["content"],Ft=["closeicon"],Ut=["headless"],Vt=["maskRef"],Pt=["container"],Rt=["closeButton"],Lt=["*"],Mt=(t,o,e,n,i,r)=>({"p-drawer":!0,"p-drawer-active":t,"p-drawer-left":o,"p-drawer-right":e,"p-drawer-top":n,"p-drawer-bottom":i,"p-drawer-full":r}),Ot=(t,o)=>({transform:t,transition:o}),At=t=>({value:"visible",params:t});function Bt(t,o){t&1&&F(0)}function Ht(t,o){if(t&1&&_(0,Bt,1,0,"ng-container",4),t&2){let e=c(2);s("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)}}function Nt(t,o){t&1&&F(0)}function Qt(t,o){if(t&1&&(l(0,"div"),g(1),p()),t&2){let e=c(3);ne(e.cx("title")),a(),S(e.header)}}function zt(t,o){t&1&&y(0,"TimesIcon"),t&2&&E("data-pc-section","closeicon")}function qt(t,o){}function Gt(t,o){t&1&&_(0,qt,0,0,"ng-template")}function jt(t,o){if(t&1&&_(0,zt,1,1,"TimesIcon",8)(1,Gt,1,0,null,4),t&2){let e=c(4);s("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),s("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function $t(t,o){if(t&1){let e=T();l(0,"p-button",9),b("onClick",function(i){d(e);let r=c(3);return u(r.close(i))})("keydown.enter",function(i){d(e);let r=c(3);return u(r.close(i))}),_(1,jt,2,2,"ng-template",null,1,x),p()}if(t&2){let e=c(3);s("ngClass",e.cx("closeButton"))("buttonProps",e.closeButtonProps)("ariaLabel",e.ariaCloseLabel),E("data-pc-section","closebutton")("data-pc-group-section","iconcontainer")}}function Zt(t,o){t&1&&F(0)}function Wt(t,o){t&1&&F(0)}function Kt(t,o){if(t&1&&(Ce(0),l(1,"div",5),_(2,Wt,1,0,"ng-container",4),p(),ye()),t&2){let e=c(3);a(),s("ngClass",e.cx("footer")),E("data-pc-section","footer"),a(),s("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Jt(t,o){if(t&1&&(l(0,"div",5),_(1,Nt,1,0,"ng-container",4)(2,Qt,2,3,"div",6)(3,$t,3,5,"p-button",7),p(),l(4,"div",5),ke(5),_(6,Zt,1,0,"ng-container",4),p(),_(7,Kt,3,3,"ng-container",8)),t&2){let e=c(2);s("ngClass",e.cx("header")),E("data-pc-section","header"),a(),s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),a(),s("ngIf",e.header),a(),s("ngIf",e.showCloseIcon&&e.closable),a(),s("ngClass",e.cx("content")),E("data-pc-section","content"),a(2),s("ngTemplateOutlet",e.contentTemplate||e._contentTemplate),a(),s("ngIf",e.footerTemplate||e._footerTemplate)}}function Xt(t,o){if(t&1){let e=T();l(0,"div",3,0),b("@panelState.start",function(i){d(e);let r=c();return u(r.onAnimationStart(i))})("@panelState.done",function(i){d(e);let r=c();return u(r.onAnimationEnd(i))})("keydown",function(i){d(e);let r=c();return u(r.onKeyDown(i))}),_(2,Ht,1,1,"ng-container")(3,Jt,8,9),p()}if(t&2){let e=c();be(e.style),ne(e.styleClass),s("ngClass",Ee(9,Mt,e.visible,e.position==="left"&&!e.fullScreen,e.position==="right"&&!e.fullScreen,e.position==="top"&&!e.fullScreen,e.position==="bottom"&&!e.fullScreen,e.fullScreen||e.position==="full"))("@panelState",V(19,At,De(16,Ot,e.transformOptions,e.transitionOptions))),E("data-pc-name","sidebar")("data-pc-section","root"),a(2),xe(e.headlessTemplate||e._headlessTemplate?2:3)}}var Yt=({dt:t})=>`
|
|
2
2
|
.p-drawer {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-GVGBHSSG.js";import"./chunk-YCFPNVDF.js";import{a as E,b as O}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as H}from"./chunk-ANSKAR27.js";import{b as N,c as G}from"./chunk-L3PZS6EL.js";import{a as R,b as D}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as V,x as j}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-PJ6CKD3W.js";import{a as I}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as A,s as F}from"./chunk-SB5MSLCX.js";import{$b as P,Cc as $,Db as B,Dc as _,Lb as p,Nc as m,Ob as d,Oc as l,Rc as x,Vb as o,W as y,Wb as n,Xb as c,Y as M,_ as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as C,s as u,sa as S,ta as k,xb as w}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,b as L}from"./chunk-
|
|
1
|
+
import{a as x,b as L}from"./chunk-GVGBHSSG.js";import"./chunk-YCFPNVDF.js";import{a as E,b as V}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as H}from"./chunk-ANSKAR27.js";import{b as N,c as G}from"./chunk-L3PZS6EL.js";import{a as R,b as D}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as j,x as O}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-PJ6CKD3W.js";import{a as I}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as $,s as F}from"./chunk-SB5MSLCX.js";import{$b as B,Cc as w,Db as A,Dc as _,Lb as p,Nc as c,Ob as h,Oc as s,Rc as C,Vb as n,W as v,Wb as o,Xb as l,Y as T,_ as M,ec as y,fc as m,h as P,hb as a,ia as f,qa as g,ra as d,s as u,sa as S,ta as b,xb as k}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=B();n(0,"div",3)(1,"p-button",4),y("onClick",function(){g(e);let r=m();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),y("onClick",function(){g(e);let r=m();return d(r.migratePaymentAccount())}),o()()}if(i&2){let e=m();a(2),p("disabled",s(3,2,e.countInBooks$)!==0)("pTooltip",s(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),S(),n(5,"svg",8),l(6,"path",9),o(),b(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=m();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",s(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",s(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ue=(()=>{class i{constructor(){this.migrateService=f(x),this.toastr=f(I),this.refresh$=new P(void 0),this.pageTitle="Payment Account"}ngOnInit(){let e=this.refresh$.pipe(T(()=>this.migrateService.getPaymentMethodAccountCount()),M(t=>console.log("API response:",t)),v(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.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(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-payment-account"]],features:[w([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(n(0,"app-main-panel",2),A(1,J,5,6,"ng-template",null,0,C)(3,K,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,$,V,E,D,R,G,N,L,O,j],encapsulation:2})}}return i})();export{ue as PaymentAccountComponent};
|