dealposbooks 5.34.0 → 5.36.0
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-G2YSKFGD.js → chunk-2RLNYYQR.js} +1 -1
- package/{chunk-5LRPK5BI.js → chunk-3D3GRYF3.js} +1 -1
- package/{chunk-5ATZKXRQ.js → chunk-4CNNMBJW.js} +1 -1
- package/{chunk-5JDKHEBJ.js → chunk-5IQ6TGNN.js} +1 -1
- package/chunk-5SIB7PEU.js +129 -0
- package/{chunk-RHOQDE75.js → chunk-6UA2VGP4.js} +1 -1
- package/{chunk-7LVIHCFH.js → chunk-6WEZS6IX.js} +1 -1
- package/{chunk-EUOA6ZNN.js → chunk-74BKLSFH.js} +1 -1
- package/{chunk-OZ2ESPRJ.js → chunk-7C3I4R2I.js} +1 -1
- package/{chunk-2LSXB7YZ.js → chunk-7CHVAZTI.js} +1 -1
- package/{chunk-LUPSXHRX.js → chunk-7HTH3SFF.js} +1 -1
- package/chunk-A5HAJEPC.js +1 -0
- package/{chunk-LRDAZKGE.js → chunk-AMANMDZU.js} +1 -1
- package/{chunk-AP26QGQW.js → chunk-ANCPMGSL.js} +1 -1
- package/chunk-AUF6ZNSG.js +160 -0
- package/{chunk-6MOM7AXR.js → chunk-B54WGNWI.js} +1 -1
- package/{chunk-LD7LVE2B.js → chunk-BAH2FNAN.js} +1 -1
- package/{chunk-YWXAUVYL.js → chunk-CGK3QRS6.js} +1 -1
- package/{chunk-754GP2RS.js → chunk-CUVEPFZP.js} +1 -1
- package/{chunk-U72SOCJH.js → chunk-DG42ZBO4.js} +1 -1
- package/{chunk-KPWIGW52.js → chunk-DHTMHV6T.js} +1 -1
- package/{chunk-6KHNAQCS.js → chunk-EPJW6GIY.js} +1 -1
- package/{chunk-P2OCX57R.js → chunk-F3JN6BPV.js} +1 -1
- package/{chunk-IDDGY7P4.js → chunk-FZ7YN3KE.js} +1 -1
- package/{chunk-ZJ4T6ZG6.js → chunk-GAN5PRIS.js} +1 -1
- package/{chunk-G33PO2GU.js → chunk-GMSTFECE.js} +1 -1
- package/{chunk-APY3KUFM.js → chunk-L3OMRCAX.js} +1 -1
- package/chunk-L4XMRLHM.js +1 -0
- package/{chunk-6TVP5OOO.js → chunk-M2HJCLEP.js} +1 -1
- package/chunk-MSW4JBUU.js +7 -0
- package/{chunk-GWSNPXC6.js → chunk-NU67ULMO.js} +1 -1
- package/{chunk-TJLNG6VF.js → chunk-O2K45NCM.js} +1 -1
- package/{chunk-45LSSSIH.js → chunk-O3K2CNOY.js} +1 -1
- package/{chunk-Z2QDMAKC.js → chunk-OVQDITWG.js} +1 -1
- package/{chunk-V3CVBFI5.js → chunk-P4OK4B27.js} +1 -1
- package/{chunk-4ANXCMQU.js → chunk-PAWHO2BN.js} +1 -1
- package/{chunk-UZZM57TN.js → chunk-RC2E4TKB.js} +1 -1
- package/{chunk-VRCICMG6.js → chunk-RO3TPZFM.js} +1 -1
- package/chunk-SMZ363LC.js +1 -0
- package/{chunk-BBQIPZWM.js → chunk-T43HOKPK.js} +1 -1
- package/chunk-TYMCW3J6.js +1 -0
- package/{chunk-XVS4T3KX.js → chunk-UUMZZMTS.js} +1 -1
- package/{chunk-EGR3U7VD.js → chunk-V4KVFLMH.js} +1 -1
- package/{chunk-OHDWZ3ZU.js → chunk-VFC5APMC.js} +1 -1
- package/{chunk-HNBUQBBT.js → chunk-VIJVOI6Y.js} +1 -1
- package/{chunk-MDEJN7RJ.js → chunk-W7U7YCR2.js} +1 -1
- package/{chunk-2MVACU4N.js → chunk-WGJIBSIS.js} +1 -1
- package/{chunk-Y75WHRI7.js → chunk-WJL3LNRF.js} +1 -1
- package/{chunk-GBKTFERL.js → chunk-Y46HDVD4.js} +1 -1
- package/{chunk-DQQ6JL6H.js → chunk-Z545HOL6.js} +1 -1
- package/index.html +2 -2
- package/{main-YSVUVFRK.js → main-M6EX446M.js} +1 -1
- package/package.json +1 -1
- package/chunk-BHV2HCJY.js +0 -1
- package/chunk-CZNQPNZD.js +0 -160
- package/chunk-DYCHYHHI.js +0 -1
- package/chunk-IOIIEN6T.js +0 -129
- package/chunk-N2GNLX5X.js +0 -1
- package/chunk-WFQ3EPZT.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as un}from"./chunk-
|
|
1
|
+
import{a as un}from"./chunk-Z545HOL6.js";import{a as qn}from"./chunk-BTDW4G2F.js";import{a as Xn}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as Fn}from"./chunk-LWLJZPBI.js";import{a as $n}from"./chunk-3NU3P6NL.js";import{b as Wn}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import{a as Vn}from"./chunk-ZTEDQLOG.js";import{a as Dn}from"./chunk-EDGADVEY.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as jn}from"./chunk-4CDAAU6Z.js";import{b as Yn,c as Ti}from"./chunk-X22YKT5B.js";import{b as Gn}from"./chunk-JYCUE5HV.js";import{c as Mn}from"./chunk-FUZFAJGJ.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-5FSMHZSY.js";import"./chunk-A5HAJEPC.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-G5S5AZA7.js";import{b as rn,d as an,e as on,f as ln,l as Ht}from"./chunk-Z45NTTES.js";import{a as cn,b as Mi}from"./chunk-BAH2FNAN.js";import{a as pn}from"./chunk-BLQJXMNV.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{G as sn,h as ct,j as ii,k as Ft,l as Bt,m as Rt,n as tn,r as we,s as Oe,y as nn}from"./chunk-OKCHQM5Q.js";import{Aa as Wi,Ab as Ke,Ac as pe,Bc as Be,Ca as qi,Cb as X,Cc as ti,Da as xe,Ea as wt,Ga as Ee,Jb as Z,Jc as Dt,Ka as Ui,Kb as $,Kc as $t,Mb as Ki,Mc as dt,Nb as Qt,Ob as ye,Pb as Kt,Qb as Zt,Sb as Jt,Tb as ei,Ub as G,V as Xi,Vb as N,Vc as pt,Wb as te,Wc as Vt,Xb as at,Yb as ot,Yc as en,Zb as Me,_b as ve,aa as Yi,ba as Ye,bb as bi,ca as je,cb as qe,dc as ie,ec as H,fc as bt,gb as R,gc as lt,ha as ae,jc as fe,kc as yt,lc as ne,mb as Ue,mc as se,oa as ji,pa as U,pc as Lt,qa as Q,qc as le,rb as Ut,rc as Fe,s as wi,sc as yi,t as Gi,ta as Ae,tc as Zi,vc as kt,wb as he,wc as zt,xb as Qe,xc as At,yc as Ze,za as We,zb as Qi,zc as Ji}from"./chunk-JP6RBSB3.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
|
|
2
2
|
.p-inputgroup,
|
|
3
3
|
.p-inputgroup .p-floatlabel,
|
|
4
4
|
.p-inputgroup .p-iftalabel {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-7C3I4R2I.js";import"./chunk-Z545HOL6.js";import"./chunk-C2GO6SPF.js";import"./chunk-Z45NTTES.js";import"./chunk-BAH2FNAN.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import"./chunk-OKCHQM5Q.js";import"./chunk-JP6RBSB3.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-DHTMHV6T.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-G4XX7EU2.js";import{a as dt,b as gt}from"./chunk-AACWH3EJ.js";import{a as ut}from"./chunk-YPBGL37O.js";import{a as It,b as mt}from"./chunk-RHOQDE75.js";import{a as Ke}from"./chunk-DQQ6JL6H.js";import"./chunk-FLZXCWDU.js";import{a as pt,b as st}from"./chunk-NJO5TWIA.js";import{a as ct}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import{a as et}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as ne,b as ie}from"./chunk-O4QM64EH.js";import{b as ot,d as Me,i as at,j as lt,k as ke}from"./chunk-SVXDMOLP.js";import{a as it,b as rt}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Ne}from"./chunk-XKCLERWG.js";import{a as ye,b as Re}from"./chunk-H57SDRPH.js";import"./chunk-GDX5XEV3.js";import{a as De,b as Pe}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as Q}from"./chunk-4CDAAU6Z.js";import{f as nt,h as L}from"./chunk-LUPSXHRX.js";import"./chunk-X22YKT5B.js";import{a as N,b as A}from"./chunk-JYCUE5HV.js";import{a as w,b as Ie,c as tt,d as we,e as Te,f as Fe}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as Ce,o as Se,w as Y,x as J}from"./chunk-5FSMHZSY.js";import"./chunk-BHV2HCJY.js";import{b as xe,c as K,e as X,f as _e,i as Xe,j as Ye,k as he,l as Ee,o as ve,u as Je,v as Qe,w as Ze,x as be}from"./chunk-G5S5AZA7.js";import{b as de,d as ge,e as k,l as V}from"./chunk-Z45NTTES.js";import{a as fe}from"./chunk-LD7LVE2B.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as ze,k as P,p as ue,q as z,r as M}from"./chunk-OKCHQM5Q.js";import{Ab as He,Ac as S,Cb as h,Ga as q,J as qe,Jc as C,Kb as m,Kc as F,Lc as U,Mc as x,Pb as $e,Qb as H,Sb as $,Tb as W,Ub as r,Vb as n,Wb as d,X as O,Yc as te,Z as T,_b as y,ba as le,c as ee,dc as R,ec as g,gb as l,ha as u,pa as v,qa as b,qc as a,rc as E,s as G,sc as I,ta as Ue,uc as We,vc as pe,wa as Ge,wb as D,wc as se,xc as ce,yc as me,zc as Ve}from"./chunk-JP6RBSB3.js";import{a as f,b as _,e as Rt}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{#e=u(fe);#t=u(Ke);getRecurringExpenseLoader(){return this.#e.get(void 0,"api/RecurringExpenseLoader/GetList")}getRecurringExpenses(e){return this.#e.post(void 0,"api/RecurringExpense/GetList",e)}fetchRecurringExpenseForm(e){return this.#e.get(void 0,`api/RecurringExpense/form/${e??""}`)}fetchSupplierSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",o)}fetchCustomerSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",o)}submitRecurringExpense(e,o={}){return this.#e.post(void 0,"api/RecurringExpense/submit",e,o)}removeRecurringExpense(e){return this.#e.delete(void 0,`api/RecurringExpense/${e}`,void 0)}removeRecurringExpenses(e){let o={body:e};return this.#e.delete(void 0,"api/RecurringExpense/Batch",o)}getRecurringExpenseByID(e){return this.#e.get(void 0,`api/RecurringExpense/Info/${e}`)}getAssetValueList(){return this.#e.get(void 0,"api/AssetValue/GetListt")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var wt={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Ae=Ie(Fe(wt),tt(t=>({first:te(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:te(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:te(()=>t.data().data.some(c=>c.checked)),checkedInvoice:te(()=>t.data().data.filter(c=>c.checked).map(c=>c.id))})),Te(t=>{let c=u(B);return{updateFilter(o){w(t,i=>_(f({},i),{filter:f(f({},i.filter),o)}))},onRowSelect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!0}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onRowUnselect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!1}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onHeaderCheckboxToggle(o){w(t,i=>{let s=i.data.data.map(p=>_(f({},p),{checked:o}));return _(f({},i),{data:_(f({},i.data),{data:s})})})},getRecurringExpenseLoader:ne(ee(O(()=>c.getRecurringExpenseLoader().pipe(ie({next:o=>{w(t,i=>_(f({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ne(ee(G(o=>Object.entries(o).reduce((i,[s,p])=>(p!=null&&(i[s]=p),i),{})),O(o=>c.getRecurringExpenses(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),we(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var Dt=["class","page"],Pt=t=>["details/",t];function Mt(t,c){if(t&1){let e=y();r(0,"p-button",12),R("onClick",function(){v(e);let i=g(2);return b(i.onDeleteSelected())}),n()}}function kt(t,c){if(t&1&&(r(0,"div",8),h(1,Mt,1,0,"p-button",9),r(2,"a",10),d(3,"i",11),r(4,"span"),a(5,"Add"),n()()()),t&2){let e=g();l(),m("ngIf",e.store.hasCheckedRows())}}function Vt(t,c){t&1&&(r(0,"tr")(1,"th"),d(2,"p-tableHeaderCheckbox"),n(),r(3,"th"),a(4,"Outlet"),n(),r(5,"th"),a(6,"Name"),n(),r(7,"th"),a(8,"Expense Account"),n(),r(9,"th"),a(10,"Start Date"),n(),r(11,"th"),a(12,"End Date"),n(),r(13,"th"),a(14,"Last Expense"),n(),r(15,"th"),a(16,"Amount"),n(),r(17,"th"),a(18,"Frequency"),n()())}function Nt(t,c){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",14),n(),r(3,"td"),a(4),n(),r(5,"td")(6,"a",15),a(7),n()(),r(8,"td"),a(9),n(),r(10,"td"),a(11),C(12,"date"),n(),r(13,"td"),a(14),C(15,"date"),n(),r(16,"td"),a(17),C(18,"date"),n(),r(19,"td"),a(20),C(21,"number"),n(),r(22,"td"),a(23),n()()),t&2){let e=c.$implicit;l(2),m("value",e),l(2),E(e.outletName),l(2),m("routerLink",S(21,Pt,e.id)),l(),E(e.name),l(2),E(e.expenseName),l(2),E(U(12,10,e.startDate,"d MMM y")),l(3),E(U(15,13,e.endDate,"d MMM y")),l(3),E(U(18,16,e.lastExpenseDate,"d MMM y")),l(3),E(F(21,19,e.amount)),l(3),E(e.repeatTypeLabel)}}function At(t,c){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=g(2);l(),We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function Lt(t,c){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Bt(t,c){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",13),R("onPage",function(i){v(e);let s=g();return b(s.onPageChange(i))})("onHeaderCheckboxToggle",function(i){v(e);let s=g();return b(s.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){v(e);let s=g();return b(s.onRowSelect(i))})("onRowUnselect",function(i){v(e);let s=g();return b(s.onRowUnselect(i))}),h(2,Vt,19,0,"ng-template",null,3,x)(4,Nt,24,23,"ng-template",null,4,x)(6,At,2,3,"ng-template",null,5,x)(8,Lt,4,0,"ng-template",null,6,x),n()()}if(t&2){let e=g();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function jt(t,c){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),d(4,"p-select",20),n()()),t&2){let e=g();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var _t=(()=>{class t extends ct{constructor(){super(...arguments),this.store=u(Ae),this.recurringExpenseService=u(B),this.fb=u(Je),this.isDialogFilterVisible=q(!1)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(T(()=>{this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(f({},this.store.filter()),{text:e}))}onFilterEvent(){this.onSubmitFilterDialog()}onSubmitFilterDialog(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((o,[i,s])=>(s!=null&&(o[i]=s),o),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(o=>!o)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}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)}initForm(){let{text:e,Frequency:o,pageNumber:i,rowCount:s,pageSize:p,export:j,exportPageNumber:St,exportRowCount:yt}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),rowCount:this.fb.control(s),pageSize:this.fb.control(p),export:this.fb.control(j),exportPageNumber:this.fb.control(St),exportRowCount:this.fb.control(yt)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ue(t)))(i||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[me([Ae]),He],attrs:Dt,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Recurring Expenses",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[3,"value"],[1,"link-primary",3,"routerLink"],["colspan","9"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","Frequency","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Type",3,"options"]],template:function(o,i){if(o&1){let s=y();r(0,"app-main-panel",7),R("search",function(j){return v(s),b(i.onSearchEvent(j))}),ce("isDialogFilterVisibleChange",function(j){return v(s),se(i.isDialogFilterVisible,j)||(i.isDialogFilterVisible=j),b(j)}),R("filterConfirmed",function(){return v(s),b(i.onFilterEvent())}),h(1,kt,6,1,"ng-template",null,0,x)(3,Bt,10,5,"ng-template",null,1,x)(5,jt,5,2,"ng-template",null,2,x),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),pe("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[L,k,Q,ke,Me,at,lt,M,P,z,ue,V,nt,Pe,De,J,Y,be,he,X,_e,Ee,ve,A,N],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Z=Rt(It());var Ut=["class","page"],Gt=()=>["/pages/recurring/recurring-expense"],ae=t=>({"ng-dirty ng-invalid":t}),Ht=()=>({});function $t(t,c){if(t&1){let e=y();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),R("click",function(){v(e);let i=g();return b(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",Ve(1,Gt)))}function Wt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function zt(t,c){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=c.$implicit;l(2),I(" ",e.name," ")}}function Kt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Xt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Yt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Jt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Qt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Zt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function en(t,c){if(t&1){let e=y();r(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-scroll-panel")(4,"div",12)(5,"div",13)(6,"form",14)(7,"div",15)(8,"div",13)(9,"div",16)(10,"label",17),a(11,"Name"),n(),d(12,"input",18),r(13,"div"),$(14,Wt,2,1,"small",19,H),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Outlet"),n(),r(21,"p-select",21),h(22,zt,3,1,"ng-template",null,3,x),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),R("completeMethod",function(i){v(e);let s=g(2);return b(s.searchContact(i))}),n()(),r(30,"div"),$(31,Kt,2,1,"small",19,H),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),d(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),d(42,"p-datepicker",24),n()(),d(43,"div",25),n(),d(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),d(50,"input",26),r(51,"div"),$(52,Xt,2,1,"small",19,H),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),d(58,"p-select",27),n()(),r(59,"div",20)(60,"div",16)(61,"label",17),a(62,"Expense (Debit)"),n(),r(63,"p-select",28),h(64,Yt,6,2,"ng-template",null,3,x),n()(),r(66,"div"),$(67,Jt,2,1,"small",19,H),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),h(74,Qt,6,2,"ng-template",null,3,x),n()(),r(76,"div"),$(77,Zt,2,1,"small",19,H),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),d(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,s,p=g(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",S(17,ae,p.isInvalid("name"))),l(2),W(p.getErrors("name")),l(7),m("options",(e=p.recurringExpenseData())==null||e.options==null?null:e.options.entities),l(8),m("showClear",!0)("ngClass",S(19,ae,p.isInvalid("contact")))("suggestions",p.customerSupplierSuggestions()),l(2),W(p.getErrors("contact")),l(6),m("iconDisplay","input")("showIcon",!0),l(5),m("iconDisplay","input")("showIcon",!0),l(8),m("ngClass",S(21,ae,p.isInvalid("amount")))("autoNumeric",Ve(23,Ht)),l(2),W(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses)("ngClass",S(24,ae,p.isInvalid("expenseAccountID"))),l(4),W(p.getErrors("expenseAccountID")),l(6),m("ngClass",S(26,ae,p.isInvalid("paymentAccountID")))("options",(s=p.recurringExpenseData())==null||s.options==null?null:s.options.assets),l(4),W(p.getErrors("paymentAccountID"))}}function tn(t,c){if(t&1&&h(0,en,84,28,"div",8),t&2){let e=g();m("ngIf",e.recurringExpenseData())}}var je=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.fb=u(Qe),this.destroyRef=u(Ge),this.route=u(de),this.recurringExpenseData=q(null),this.customerSupplierSuggestions=q([]),this.router=u(ge),this.contactType=new Xe(0),this.dayjsService=u(mt)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[K.required]),repeatTypeID:this.fb.control(1,[K.required]),startDate:this.fb.control((0,Z.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[K.required]),paymentAccountID:this.fb.control(null,[K.required]),expenseAccountID:this.fb.control(null,[K.required]),contact:this.fb.control("",[]),description:this.fb.control(""),repeatTypeLabel:this.fb.control(""),outletID:this.fb.control(""),creatorID:this.fb.control(""),created:this.fb.control(""),modifierID:this.fb.control(""),modified:this.fb.control("")})}fetchRecurringExpenseForm(){this.route.paramMap.pipe(G(e=>e.get("id")),O(e=>e?this.recurringExpenseService.fetchRecurringExpenseForm(e):this.recurringExpenseService.fetchRecurringExpenseForm()),T(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"startDate":i[s]=(0,Z.default)(p).isSame((0,Z.default)("0001-01-01T00:00:00"))?(0,Z.default)().toDate():(0,Z.default)(p).toDate();break;case"repeatTypeID":i[s]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[s]=p===re?null:p;break;case"expenseAccountID":i[s]=p===re?null:p;break;default:i[s]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(T(this.customerSupplierSuggestions.set)).subscribe()}onSubmit(){let e=this.recurringExpenseForm.value;if(this.recurringExpenseForm.invalid){this.recurringExpenseForm.markAllAsTouched();return}let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"amount":i[s]=+p;break;case"startDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"contact":typeof p=="string"?i.contactID=p:typeof p=="object"&&p!==null?i.contactID=p&&Object.prototype.hasOwnProperty.call(p,"Key")?p.Key:p:i.contactID=re;break;default:i[s]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}isInvalid(e){let o=this.recurringExpenseForm.controls[e];return o.invalid&&(o.dirty||o.touched)}getErrors(e){if(!this.isInvalid(e))return null;let o=this.recurringExpenseForm.controls[e];if(!o.errors)return null;let i=[];for(let[s,p]of Object.entries(o.errors))switch(s){case"required":i.push("This field is required.");break;case"minlength":i.push(`Minimum length is ${p.requiredLength} characters.`);break;case"maxlength":i.push(`Maximum length is ${p.requiredLength} characters.`);break;case"email":i.push("Please enter a valid email address.");break;case"pattern":i.push("The format is invalid.");break;case"min":i.push(`Minimum value is ${p.min}.`);break;case"max":i.push(`Maximum value is ${p.max}.`);break;default:i.push("Invalid value.")}return i}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:Ut,decls:5,vars:2,consts:[["actionButton",""],["content",""],["outlet",""],["item",""],["pageTitle","Recurring Expense Form",3,"hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit","icon","fa-solid fa-plus",3,"click"],["class","row justify-content-center",4,"ngIf"],[1,"row","justify-content-center"],[1,"col-6"],[1,"h-100","d-flex"],[1,"row","justify-content-center","h-100"],[1,"col-12"],[1,"d-flex","flex-column","row-gap-2",3,"formGroup"],[1,"row","row-gap-2"],[1,"d-flex","flex-column"],["for",""],["formControlName","name","type","text","pInputText","",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["filter","","filterBy","name","appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["formControlName","contact","inputStyleClass","w-100","styleClass","w-100","optionLabel","Value","optionValue","Key",3,"completeMethod","showClear","ngClass","suggestions"],["dateFormat","mm/dd/yy","appendTo","body","formControlName","startDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],["appendTo","body","formControlName","endDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"col"],["formControlName","amount","type","text","pInputText","",3,"ngClass","autoNumeric"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense","filter","","filterBy","code,value",3,"options","ngClass"],["appendTo","body","formControlName","paymentAccountID","optionLabel","value","optionValue","key","filter","","filterBy","code,value","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["formControlName","description","rows","3","cols","30","pTextarea",""],[1,"flex","items-center","gap-2"],[1,"text-truncate","d-inline-block",2,"max-width","250px"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,$t,4,2,"ng-template",null,0,x)(3,tn,1,1,"ng-template",null,1,x),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[L,Q,Se,Ce,Pe,De,rt,it,gt,dt,st,pt,Re,ye,M,ze,P,be,he,xe,X,_e,Ee,ve,V,k,J,Y,ut,A,N,ot],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=["class","page"],rn=t=>["/pages/recurring/recurring-expense/edit",t];function on(t,c){if(t&1&&(r(0,"a",7),d(1,"i",8),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=g(4);m("routerLink",S(1,rn,e.currentRecurringExpense().id))}}function an(t,c){if(t&1){let e=y();r(0,"p-button",9),R("onClick",function(){v(e);let i=g(4);return b(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function ln(t,c){if(t&1&&(r(0,"div",4),h(1,on,4,3,"a",5)(2,an,1,0,"p-button",6),n()),t&2){let e=g(3);l(),m("ngIf",e.roleService.setup.recurring),l(),m("ngIf",e.roleService.setup.recurring)}}function pn(t,c){if(t&1&&h(0,ln,3,2,"div",3),t&2){let e=g(2);m("ngIf",e.currentRecurringExpense())}}function sn(t,c){if(t&1){let e=y();r(0,"p-panel",13)(1,"p-scroll-panel")(2,"div",10)(3,"div",14)(4,"div",15)(5,"div",14)(6,"div",16)(7,"div",17)(8,"div",18)(9,"label",19),a(10,"Outlet"),n(),r(11,"input",20),ce("ngModelChange",function(i){v(e);let s=g(3);return se(s.currentRecurringExpense().outletName,i)||(s.currentRecurringExpense().outletName=i),b(i)}),n()()(),r(12,"div",17)(13,"div",18)(14,"label",19),a(15,"Supplier"),n(),d(16,"input",21),n()(),r(17,"div",17)(18,"div",18)(19,"label",19),a(20,"From"),n(),d(21,"input",22),C(22,"date"),n()(),r(23,"div",17)(24,"div",18)(25,"label",19),a(26,"To"),n(),d(27,"input",22),C(28,"date"),n()()(),d(29,"hr"),r(30,"div",16)(31,"div",17)(32,"div",18)(33,"label",19),a(34,"Amount"),n(),d(35,"input",22),C(36,"number"),n()(),r(37,"div",17)(38,"div",18)(39,"label",19),a(40,"Frequency"),n(),d(41,"input",22),n()(),r(42,"div",17)(43,"div",18)(44,"label",19),a(45,"Expense (Debit)"),n(),d(46,"input",22),n()(),r(47,"div",17)(48,"div",18)(49,"label",19),a(50,"Payment (Credit)"),n(),d(51,"input",22),n()(),r(52,"div",23)(53,"div",18)(54,"label",19),a(55,"Description"),n(),d(56,"textarea",24),n()()()()()()()()()}if(t&2){let e=g(3);l(11),pe("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",U(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",U(28,12,e.currentRecurringExpense().endDate,"d MMM y")),l(8),m("value",F(36,15,e.currentRecurringExpense().amount)),l(6),m("value",e.currentRecurringExpense().repeatTypeLabel),l(5),m("value",e.currentRecurringExpense().expenseName),l(5),m("value",e.currentRecurringExpense().paymentName),l(5),m("value",e.currentRecurringExpense().description)}}function cn(t,c){if(t&1&&(r(0,"div",10)(1,"div",11),h(2,sn,57,17,"p-panel",12),n()()),t&2){let e=g(2);l(2),m("ngIf",e.currentRecurringExpense())}}function mn(t,c){if(t&1&&(r(0,"app-main-panel",2),h(1,pn,1,1,"ng-template",null,0,x)(3,cn,3,1,"ng-template",null,1,x),n()),t&2){let e=g();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var Et=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.route=u(de),this.router=u(ge),this.currentRecurringExpense=q(null),this.roleService=u(et)}ngOnInit(){this.route.paramMap.pipe(G(e=>e.get("id")),Ne("params"),qe(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),T(e=>this.currentRecurringExpense.set(e)),Ne("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:nn,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["class","p-button p-button-outlined p-button-secondary d-flex gap-2 align-items-center",3,"routerLink",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],[1,"row","justify-content-center"],[1,"col-6"],["class","h-100 d-flex",4,"ngIf"],[1,"h-100","d-flex"],[1,"col"],[1,"row"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["readonly","","type","text","pInputText","",3,"ngModelChange","ngModel"],["type","text","readonly","","pInputText","",3,"value"],["readonly","","type","text","pInputText","",3,"value"],[1,"col","col-lg-12"],["readonly","","rows","5","cols","30","pTextarea","",3,"value"]],template:function(o,i){o&1&&h(0,mn,5,3,"app-main-panel",2),o&2&&$e(i.currentRecurringExpense()?0:-1)},dependencies:[L,Q,M,P,z,ue,Se,Ce,Ze,xe,X,Ye,J,Y,V,k,A,N,Re,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vt=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:_t},{path:"create",component:je},{path:"details/:id",component:Et},{path:"edit/:id",component:je}]}];var bt=(()=>{class t{constructor(){this.httpService=u(fe)}getAssetValue(e){return this.httpService.post(void 0,"/api/AssetValue/GetList",e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var un={filter:{Text:"",Frequency:0,PageNumber:1,RowCount:10},data:null},Oe=Ie(Fe(un),Te(t=>{let c=u(bt);return{getAssetValue:ne(ee(O(o=>c.getAssetValue(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{w(t,i=>_(f({},i),{filter:o}))}}}),we({onInit:t=>{t.getAssetValue(t.filter())}}));var dn=t=>["/pages/recurring/recurring-expense/details/",t];function gn(t,c){t&1&&d(0,"div",5)}function fn(t,c){t&1&&(r(0,"tr")(1,"th"),a(2,"Outlet"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",8),a(8,"Price on Purchase"),n(),r(9,"th",8),a(10,"Accomulated Depreciation"),n(),r(11,"th",8),a(12,"Book Value"),n(),r(13,"th",8),a(14,"Frequency"),n()())}function xn(t,c){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",9),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",8),a(9),C(10,"number"),n(),r(11,"td",8),a(12),C(13,"number"),n(),r(14,"td",8),a(15),C(16,"number"),n(),r(17,"td",8),a(18),C(19,"number"),n()()),t&2){let e=c.$implicit;l(2),E(e.entityName),l(2),m("routerLink",S(16,dn,e.id)),l(),E(e.name),l(2),E(e.accountCode),l(2),E(F(10,8,e.priceOnPurchase)),l(3),I(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),I(" ",F(16,12,e.bookValue)," "),l(3),I(" ",F(19,14,e.depreciationPerYear)," ")}}function _n(t,c){if(t&1&&(r(0,"p-panel")(1,"p-table",7),h(2,fn,15,0,"ng-template",null,2,x)(4,xn,20,18,"ng-template",null,3,x),n()()),t&2){let e=g(2);l(),m("value",e.store.data().data)("rows",e.store.filter().RowCount)("totalRecords",e.store.data().count)}}function hn(t,c){if(t&1&&h(0,_n,6,3,"p-panel",6),t&2){let e=g();m("ngIf",e.store.data())}}var Ct=(()=>{class t{constructor(){this.store=u(Oe)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-asset-value"]],features:[me([Oe])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],[4,"ngIf"],["styleClass","h-100","dataKey","id",1,"",3,"value","rows","totalRecords"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,gn,1,0,"ng-template",null,0,x)(3,hn,1,1,"ng-template",null,1,x),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[L,M,P,z,A,N,ke,Me,V,k],encapsulation:2})}}return t})();var dr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:vt},{path:"asset-value",component:Ct},{path:"post-to-journal",loadComponent:()=>import("./chunk-6TVP5OOO.js").then(t=>t.PostRecurringExpenseComponent)}];export{dr as RECURRING_ROUTES};
|
|
1
|
+
import{a as re}from"./chunk-G4XX7EU2.js";import{a as dt,b as gt}from"./chunk-AACWH3EJ.js";import{a as ut}from"./chunk-YPBGL37O.js";import{a as It,b as mt}from"./chunk-6UA2VGP4.js";import{a as Ke}from"./chunk-Z545HOL6.js";import"./chunk-FLZXCWDU.js";import{a as pt,b as st}from"./chunk-NJO5TWIA.js";import{a as ct}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import{a as et}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as ne,b as ie}from"./chunk-O4QM64EH.js";import{b as ot,d as Me,i as at,j as lt,k as ke}from"./chunk-SVXDMOLP.js";import{a as it,b as rt}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Ne}from"./chunk-XKCLERWG.js";import{a as ye,b as Re}from"./chunk-H57SDRPH.js";import"./chunk-GDX5XEV3.js";import{a as De,b as Pe}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as Q}from"./chunk-4CDAAU6Z.js";import{f as nt,h as L}from"./chunk-7HTH3SFF.js";import"./chunk-X22YKT5B.js";import{a as N,b as A}from"./chunk-JYCUE5HV.js";import{a as w,b as Ie,c as tt,d as we,e as Te,f as Fe}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as Ce,o as Se,w as Y,x as J}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as xe,c as K,e as X,f as _e,i as Xe,j as Ye,k as he,l as Ee,o as ve,u as Je,v as Qe,w as Ze,x as be}from"./chunk-G5S5AZA7.js";import{b as de,d as ge,e as k,l as V}from"./chunk-Z45NTTES.js";import{a as fe}from"./chunk-BAH2FNAN.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as ze,k as P,p as ue,q as z,r as M}from"./chunk-OKCHQM5Q.js";import{Ab as He,Ac as S,Cb as h,Ga as q,J as qe,Jc as C,Kb as m,Kc as F,Lc as U,Mc as x,Pb as $e,Qb as H,Sb as $,Tb as W,Ub as r,Vb as n,Wb as d,X as O,Yc as te,Z as T,_b as y,ba as le,c as ee,dc as R,ec as g,gb as l,ha as u,pa as v,qa as b,qc as a,rc as E,s as G,sc as I,ta as Ue,uc as We,vc as pe,wa as Ge,wb as D,wc as se,xc as ce,yc as me,zc as Ve}from"./chunk-JP6RBSB3.js";import{a as f,b as _,e as Rt}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{#e=u(fe);#t=u(Ke);getRecurringExpenseLoader(){return this.#e.get(void 0,"api/RecurringExpenseLoader/GetList")}getRecurringExpenses(e){return this.#e.post(void 0,"api/RecurringExpense/GetList",e)}fetchRecurringExpenseForm(e){return this.#e.get(void 0,`api/RecurringExpense/form/${e??""}`)}fetchSupplierSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",o)}fetchCustomerSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",o)}submitRecurringExpense(e,o={}){return this.#e.post(void 0,"api/RecurringExpense/submit",e,o)}removeRecurringExpense(e){return this.#e.delete(void 0,`api/RecurringExpense/${e}`,void 0)}removeRecurringExpenses(e){let o={body:e};return this.#e.delete(void 0,"api/RecurringExpense/Batch",o)}getRecurringExpenseByID(e){return this.#e.get(void 0,`api/RecurringExpense/Info/${e}`)}getAssetValueList(){return this.#e.get(void 0,"api/AssetValue/GetListt")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var wt={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Ae=Ie(Fe(wt),tt(t=>({first:te(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:te(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:te(()=>t.data().data.some(c=>c.checked)),checkedInvoice:te(()=>t.data().data.filter(c=>c.checked).map(c=>c.id))})),Te(t=>{let c=u(B);return{updateFilter(o){w(t,i=>_(f({},i),{filter:f(f({},i.filter),o)}))},onRowSelect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!0}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onRowUnselect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!1}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onHeaderCheckboxToggle(o){w(t,i=>{let s=i.data.data.map(p=>_(f({},p),{checked:o}));return _(f({},i),{data:_(f({},i.data),{data:s})})})},getRecurringExpenseLoader:ne(ee(O(()=>c.getRecurringExpenseLoader().pipe(ie({next:o=>{w(t,i=>_(f({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ne(ee(G(o=>Object.entries(o).reduce((i,[s,p])=>(p!=null&&(i[s]=p),i),{})),O(o=>c.getRecurringExpenses(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),we(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var Dt=["class","page"],Pt=t=>["details/",t];function Mt(t,c){if(t&1){let e=y();r(0,"p-button",12),R("onClick",function(){v(e);let i=g(2);return b(i.onDeleteSelected())}),n()}}function kt(t,c){if(t&1&&(r(0,"div",8),h(1,Mt,1,0,"p-button",9),r(2,"a",10),d(3,"i",11),r(4,"span"),a(5,"Add"),n()()()),t&2){let e=g();l(),m("ngIf",e.store.hasCheckedRows())}}function Vt(t,c){t&1&&(r(0,"tr")(1,"th"),d(2,"p-tableHeaderCheckbox"),n(),r(3,"th"),a(4,"Outlet"),n(),r(5,"th"),a(6,"Name"),n(),r(7,"th"),a(8,"Expense Account"),n(),r(9,"th"),a(10,"Start Date"),n(),r(11,"th"),a(12,"End Date"),n(),r(13,"th"),a(14,"Last Expense"),n(),r(15,"th"),a(16,"Amount"),n(),r(17,"th"),a(18,"Frequency"),n()())}function Nt(t,c){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",14),n(),r(3,"td"),a(4),n(),r(5,"td")(6,"a",15),a(7),n()(),r(8,"td"),a(9),n(),r(10,"td"),a(11),C(12,"date"),n(),r(13,"td"),a(14),C(15,"date"),n(),r(16,"td"),a(17),C(18,"date"),n(),r(19,"td"),a(20),C(21,"number"),n(),r(22,"td"),a(23),n()()),t&2){let e=c.$implicit;l(2),m("value",e),l(2),E(e.outletName),l(2),m("routerLink",S(21,Pt,e.id)),l(),E(e.name),l(2),E(e.expenseName),l(2),E(U(12,10,e.startDate,"d MMM y")),l(3),E(U(15,13,e.endDate,"d MMM y")),l(3),E(U(18,16,e.lastExpenseDate,"d MMM y")),l(3),E(F(21,19,e.amount)),l(3),E(e.repeatTypeLabel)}}function At(t,c){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=g(2);l(),We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function Lt(t,c){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Bt(t,c){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",13),R("onPage",function(i){v(e);let s=g();return b(s.onPageChange(i))})("onHeaderCheckboxToggle",function(i){v(e);let s=g();return b(s.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){v(e);let s=g();return b(s.onRowSelect(i))})("onRowUnselect",function(i){v(e);let s=g();return b(s.onRowUnselect(i))}),h(2,Vt,19,0,"ng-template",null,3,x)(4,Nt,24,23,"ng-template",null,4,x)(6,At,2,3,"ng-template",null,5,x)(8,Lt,4,0,"ng-template",null,6,x),n()()}if(t&2){let e=g();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function jt(t,c){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),d(4,"p-select",20),n()()),t&2){let e=g();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var _t=(()=>{class t extends ct{constructor(){super(...arguments),this.store=u(Ae),this.recurringExpenseService=u(B),this.fb=u(Je),this.isDialogFilterVisible=q(!1)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(T(()=>{this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(f({},this.store.filter()),{text:e}))}onFilterEvent(){this.onSubmitFilterDialog()}onSubmitFilterDialog(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((o,[i,s])=>(s!=null&&(o[i]=s),o),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(o=>!o)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}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)}initForm(){let{text:e,Frequency:o,pageNumber:i,rowCount:s,pageSize:p,export:j,exportPageNumber:St,exportRowCount:yt}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),rowCount:this.fb.control(s),pageSize:this.fb.control(p),export:this.fb.control(j),exportPageNumber:this.fb.control(St),exportRowCount:this.fb.control(yt)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ue(t)))(i||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[me([Ae]),He],attrs:Dt,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Recurring Expenses",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[3,"value"],[1,"link-primary",3,"routerLink"],["colspan","9"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","Frequency","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Type",3,"options"]],template:function(o,i){if(o&1){let s=y();r(0,"app-main-panel",7),R("search",function(j){return v(s),b(i.onSearchEvent(j))}),ce("isDialogFilterVisibleChange",function(j){return v(s),se(i.isDialogFilterVisible,j)||(i.isDialogFilterVisible=j),b(j)}),R("filterConfirmed",function(){return v(s),b(i.onFilterEvent())}),h(1,kt,6,1,"ng-template",null,0,x)(3,Bt,10,5,"ng-template",null,1,x)(5,jt,5,2,"ng-template",null,2,x),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),pe("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[L,k,Q,ke,Me,at,lt,M,P,z,ue,V,nt,Pe,De,J,Y,be,he,X,_e,Ee,ve,A,N],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Z=Rt(It());var Ut=["class","page"],Gt=()=>["/pages/recurring/recurring-expense"],ae=t=>({"ng-dirty ng-invalid":t}),Ht=()=>({});function $t(t,c){if(t&1){let e=y();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),R("click",function(){v(e);let i=g();return b(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",Ve(1,Gt)))}function Wt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function zt(t,c){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=c.$implicit;l(2),I(" ",e.name," ")}}function Kt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Xt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Yt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Jt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Qt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Zt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function en(t,c){if(t&1){let e=y();r(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-scroll-panel")(4,"div",12)(5,"div",13)(6,"form",14)(7,"div",15)(8,"div",13)(9,"div",16)(10,"label",17),a(11,"Name"),n(),d(12,"input",18),r(13,"div"),$(14,Wt,2,1,"small",19,H),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Outlet"),n(),r(21,"p-select",21),h(22,zt,3,1,"ng-template",null,3,x),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),R("completeMethod",function(i){v(e);let s=g(2);return b(s.searchContact(i))}),n()(),r(30,"div"),$(31,Kt,2,1,"small",19,H),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),d(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),d(42,"p-datepicker",24),n()(),d(43,"div",25),n(),d(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),d(50,"input",26),r(51,"div"),$(52,Xt,2,1,"small",19,H),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),d(58,"p-select",27),n()(),r(59,"div",20)(60,"div",16)(61,"label",17),a(62,"Expense (Debit)"),n(),r(63,"p-select",28),h(64,Yt,6,2,"ng-template",null,3,x),n()(),r(66,"div"),$(67,Jt,2,1,"small",19,H),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),h(74,Qt,6,2,"ng-template",null,3,x),n()(),r(76,"div"),$(77,Zt,2,1,"small",19,H),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),d(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,s,p=g(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",S(17,ae,p.isInvalid("name"))),l(2),W(p.getErrors("name")),l(7),m("options",(e=p.recurringExpenseData())==null||e.options==null?null:e.options.entities),l(8),m("showClear",!0)("ngClass",S(19,ae,p.isInvalid("contact")))("suggestions",p.customerSupplierSuggestions()),l(2),W(p.getErrors("contact")),l(6),m("iconDisplay","input")("showIcon",!0),l(5),m("iconDisplay","input")("showIcon",!0),l(8),m("ngClass",S(21,ae,p.isInvalid("amount")))("autoNumeric",Ve(23,Ht)),l(2),W(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses)("ngClass",S(24,ae,p.isInvalid("expenseAccountID"))),l(4),W(p.getErrors("expenseAccountID")),l(6),m("ngClass",S(26,ae,p.isInvalid("paymentAccountID")))("options",(s=p.recurringExpenseData())==null||s.options==null?null:s.options.assets),l(4),W(p.getErrors("paymentAccountID"))}}function tn(t,c){if(t&1&&h(0,en,84,28,"div",8),t&2){let e=g();m("ngIf",e.recurringExpenseData())}}var je=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.fb=u(Qe),this.destroyRef=u(Ge),this.route=u(de),this.recurringExpenseData=q(null),this.customerSupplierSuggestions=q([]),this.router=u(ge),this.contactType=new Xe(0),this.dayjsService=u(mt)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[K.required]),repeatTypeID:this.fb.control(1,[K.required]),startDate:this.fb.control((0,Z.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[K.required]),paymentAccountID:this.fb.control(null,[K.required]),expenseAccountID:this.fb.control(null,[K.required]),contact:this.fb.control("",[]),description:this.fb.control(""),repeatTypeLabel:this.fb.control(""),outletID:this.fb.control(""),creatorID:this.fb.control(""),created:this.fb.control(""),modifierID:this.fb.control(""),modified:this.fb.control("")})}fetchRecurringExpenseForm(){this.route.paramMap.pipe(G(e=>e.get("id")),O(e=>e?this.recurringExpenseService.fetchRecurringExpenseForm(e):this.recurringExpenseService.fetchRecurringExpenseForm()),T(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"startDate":i[s]=(0,Z.default)(p).isSame((0,Z.default)("0001-01-01T00:00:00"))?(0,Z.default)().toDate():(0,Z.default)(p).toDate();break;case"repeatTypeID":i[s]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[s]=p===re?null:p;break;case"expenseAccountID":i[s]=p===re?null:p;break;default:i[s]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(T(this.customerSupplierSuggestions.set)).subscribe()}onSubmit(){let e=this.recurringExpenseForm.value;if(this.recurringExpenseForm.invalid){this.recurringExpenseForm.markAllAsTouched();return}let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"amount":i[s]=+p;break;case"startDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"contact":typeof p=="string"?i.contactID=p:typeof p=="object"&&p!==null?i.contactID=p&&Object.prototype.hasOwnProperty.call(p,"Key")?p.Key:p:i.contactID=re;break;default:i[s]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}isInvalid(e){let o=this.recurringExpenseForm.controls[e];return o.invalid&&(o.dirty||o.touched)}getErrors(e){if(!this.isInvalid(e))return null;let o=this.recurringExpenseForm.controls[e];if(!o.errors)return null;let i=[];for(let[s,p]of Object.entries(o.errors))switch(s){case"required":i.push("This field is required.");break;case"minlength":i.push(`Minimum length is ${p.requiredLength} characters.`);break;case"maxlength":i.push(`Maximum length is ${p.requiredLength} characters.`);break;case"email":i.push("Please enter a valid email address.");break;case"pattern":i.push("The format is invalid.");break;case"min":i.push(`Minimum value is ${p.min}.`);break;case"max":i.push(`Maximum value is ${p.max}.`);break;default:i.push("Invalid value.")}return i}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:Ut,decls:5,vars:2,consts:[["actionButton",""],["content",""],["outlet",""],["item",""],["pageTitle","Recurring Expense Form",3,"hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit","icon","fa-solid fa-plus",3,"click"],["class","row justify-content-center",4,"ngIf"],[1,"row","justify-content-center"],[1,"col-6"],[1,"h-100","d-flex"],[1,"row","justify-content-center","h-100"],[1,"col-12"],[1,"d-flex","flex-column","row-gap-2",3,"formGroup"],[1,"row","row-gap-2"],[1,"d-flex","flex-column"],["for",""],["formControlName","name","type","text","pInputText","",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["filter","","filterBy","name","appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["formControlName","contact","inputStyleClass","w-100","styleClass","w-100","optionLabel","Value","optionValue","Key",3,"completeMethod","showClear","ngClass","suggestions"],["dateFormat","mm/dd/yy","appendTo","body","formControlName","startDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],["appendTo","body","formControlName","endDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"col"],["formControlName","amount","type","text","pInputText","",3,"ngClass","autoNumeric"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense","filter","","filterBy","code,value",3,"options","ngClass"],["appendTo","body","formControlName","paymentAccountID","optionLabel","value","optionValue","key","filter","","filterBy","code,value","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["formControlName","description","rows","3","cols","30","pTextarea",""],[1,"flex","items-center","gap-2"],[1,"text-truncate","d-inline-block",2,"max-width","250px"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,$t,4,2,"ng-template",null,0,x)(3,tn,1,1,"ng-template",null,1,x),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[L,Q,Se,Ce,Pe,De,rt,it,gt,dt,st,pt,Re,ye,M,ze,P,be,he,xe,X,_e,Ee,ve,V,k,J,Y,ut,A,N,ot],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=["class","page"],rn=t=>["/pages/recurring/recurring-expense/edit",t];function on(t,c){if(t&1&&(r(0,"a",7),d(1,"i",8),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=g(4);m("routerLink",S(1,rn,e.currentRecurringExpense().id))}}function an(t,c){if(t&1){let e=y();r(0,"p-button",9),R("onClick",function(){v(e);let i=g(4);return b(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function ln(t,c){if(t&1&&(r(0,"div",4),h(1,on,4,3,"a",5)(2,an,1,0,"p-button",6),n()),t&2){let e=g(3);l(),m("ngIf",e.roleService.setup.recurring),l(),m("ngIf",e.roleService.setup.recurring)}}function pn(t,c){if(t&1&&h(0,ln,3,2,"div",3),t&2){let e=g(2);m("ngIf",e.currentRecurringExpense())}}function sn(t,c){if(t&1){let e=y();r(0,"p-panel",13)(1,"p-scroll-panel")(2,"div",10)(3,"div",14)(4,"div",15)(5,"div",14)(6,"div",16)(7,"div",17)(8,"div",18)(9,"label",19),a(10,"Outlet"),n(),r(11,"input",20),ce("ngModelChange",function(i){v(e);let s=g(3);return se(s.currentRecurringExpense().outletName,i)||(s.currentRecurringExpense().outletName=i),b(i)}),n()()(),r(12,"div",17)(13,"div",18)(14,"label",19),a(15,"Supplier"),n(),d(16,"input",21),n()(),r(17,"div",17)(18,"div",18)(19,"label",19),a(20,"From"),n(),d(21,"input",22),C(22,"date"),n()(),r(23,"div",17)(24,"div",18)(25,"label",19),a(26,"To"),n(),d(27,"input",22),C(28,"date"),n()()(),d(29,"hr"),r(30,"div",16)(31,"div",17)(32,"div",18)(33,"label",19),a(34,"Amount"),n(),d(35,"input",22),C(36,"number"),n()(),r(37,"div",17)(38,"div",18)(39,"label",19),a(40,"Frequency"),n(),d(41,"input",22),n()(),r(42,"div",17)(43,"div",18)(44,"label",19),a(45,"Expense (Debit)"),n(),d(46,"input",22),n()(),r(47,"div",17)(48,"div",18)(49,"label",19),a(50,"Payment (Credit)"),n(),d(51,"input",22),n()(),r(52,"div",23)(53,"div",18)(54,"label",19),a(55,"Description"),n(),d(56,"textarea",24),n()()()()()()()()()}if(t&2){let e=g(3);l(11),pe("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",U(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",U(28,12,e.currentRecurringExpense().endDate,"d MMM y")),l(8),m("value",F(36,15,e.currentRecurringExpense().amount)),l(6),m("value",e.currentRecurringExpense().repeatTypeLabel),l(5),m("value",e.currentRecurringExpense().expenseName),l(5),m("value",e.currentRecurringExpense().paymentName),l(5),m("value",e.currentRecurringExpense().description)}}function cn(t,c){if(t&1&&(r(0,"div",10)(1,"div",11),h(2,sn,57,17,"p-panel",12),n()()),t&2){let e=g(2);l(2),m("ngIf",e.currentRecurringExpense())}}function mn(t,c){if(t&1&&(r(0,"app-main-panel",2),h(1,pn,1,1,"ng-template",null,0,x)(3,cn,3,1,"ng-template",null,1,x),n()),t&2){let e=g();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var Et=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.route=u(de),this.router=u(ge),this.currentRecurringExpense=q(null),this.roleService=u(et)}ngOnInit(){this.route.paramMap.pipe(G(e=>e.get("id")),Ne("params"),qe(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),T(e=>this.currentRecurringExpense.set(e)),Ne("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:nn,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["class","p-button p-button-outlined p-button-secondary d-flex gap-2 align-items-center",3,"routerLink",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],[1,"row","justify-content-center"],[1,"col-6"],["class","h-100 d-flex",4,"ngIf"],[1,"h-100","d-flex"],[1,"col"],[1,"row"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["readonly","","type","text","pInputText","",3,"ngModelChange","ngModel"],["type","text","readonly","","pInputText","",3,"value"],["readonly","","type","text","pInputText","",3,"value"],[1,"col","col-lg-12"],["readonly","","rows","5","cols","30","pTextarea","",3,"value"]],template:function(o,i){o&1&&h(0,mn,5,3,"app-main-panel",2),o&2&&$e(i.currentRecurringExpense()?0:-1)},dependencies:[L,Q,M,P,z,ue,Se,Ce,Ze,xe,X,Ye,J,Y,V,k,A,N,Re,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vt=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:_t},{path:"create",component:je},{path:"details/:id",component:Et},{path:"edit/:id",component:je}]}];var bt=(()=>{class t{constructor(){this.httpService=u(fe)}getAssetValue(e){return this.httpService.post(void 0,"/api/AssetValue/GetList",e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var un={filter:{Text:"",Frequency:0,PageNumber:1,RowCount:10},data:null},Oe=Ie(Fe(un),Te(t=>{let c=u(bt);return{getAssetValue:ne(ee(O(o=>c.getAssetValue(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{w(t,i=>_(f({},i),{filter:o}))}}}),we({onInit:t=>{t.getAssetValue(t.filter())}}));var dn=t=>["/pages/recurring/recurring-expense/details/",t];function gn(t,c){t&1&&d(0,"div",5)}function fn(t,c){t&1&&(r(0,"tr")(1,"th"),a(2,"Outlet"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",8),a(8,"Price on Purchase"),n(),r(9,"th",8),a(10,"Accomulated Depreciation"),n(),r(11,"th",8),a(12,"Book Value"),n(),r(13,"th",8),a(14,"Frequency"),n()())}function xn(t,c){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",9),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",8),a(9),C(10,"number"),n(),r(11,"td",8),a(12),C(13,"number"),n(),r(14,"td",8),a(15),C(16,"number"),n(),r(17,"td",8),a(18),C(19,"number"),n()()),t&2){let e=c.$implicit;l(2),E(e.entityName),l(2),m("routerLink",S(16,dn,e.id)),l(),E(e.name),l(2),E(e.accountCode),l(2),E(F(10,8,e.priceOnPurchase)),l(3),I(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),I(" ",F(16,12,e.bookValue)," "),l(3),I(" ",F(19,14,e.depreciationPerYear)," ")}}function _n(t,c){if(t&1&&(r(0,"p-panel")(1,"p-table",7),h(2,fn,15,0,"ng-template",null,2,x)(4,xn,20,18,"ng-template",null,3,x),n()()),t&2){let e=g(2);l(),m("value",e.store.data().data)("rows",e.store.filter().RowCount)("totalRecords",e.store.data().count)}}function hn(t,c){if(t&1&&h(0,_n,6,3,"p-panel",6),t&2){let e=g();m("ngIf",e.store.data())}}var Ct=(()=>{class t{constructor(){this.store=u(Oe)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-asset-value"]],features:[me([Oe])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],[4,"ngIf"],["styleClass","h-100","dataKey","id",1,"",3,"value","rows","totalRecords"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,gn,1,0,"ng-template",null,0,x)(3,hn,1,1,"ng-template",null,1,x),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[L,M,P,z,A,N,ke,Me,V,k],encapsulation:2})}}return t})();var dr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:vt},{path:"asset-value",component:Ct},{path:"post-to-journal",loadComponent:()=>import("./chunk-M2HJCLEP.js").then(t=>t.PostRecurringExpenseComponent)}];export{dr as RECURRING_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-W7U7YCR2.js";import"./chunk-6UA2VGP4.js";import{a as E,b as O}from"./chunk-H57SDRPH.js";import"./chunk-4CDAAU6Z.js";import{h as H}from"./chunk-7HTH3SFF.js";import{b as N,c as G}from"./chunk-X22YKT5B.js";import{a as R,b as D}from"./chunk-JYCUE5HV.js";import"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{w as V,x as j}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import"./chunk-G5S5AZA7.js";import"./chunk-BAH2FNAN.js";import{a as I}from"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{n as A,r as F}from"./chunk-OKCHQM5Q.js";import{Cb as B,Jc as m,Kb as p,Kc as l,Mc as x,Nb as d,Ub as o,V as y,Vb as n,Wb as c,X as M,Z as b,_b as P,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as C,ra as S,s as u,sa as k,wb as w,yc as $,zc as _}from"./chunk-JP6RBSB3.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};
|