dealposbooks 5.52.1 → 5.52.2
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-6XXZ5EGB.js → chunk-3NKFD47E.js} +1 -1
- package/{chunk-TD6LAXYK.js → chunk-3NQK565X.js} +1 -1
- package/{chunk-ADKIXPGH.js → chunk-3NVMSAHU.js} +1 -1
- package/{chunk-6XA4GVYX.js → chunk-4IUQ4YHH.js} +1 -1
- package/{chunk-IUKMLLIQ.js → chunk-4UKHYZF2.js} +1 -1
- package/{chunk-KXAIRXAX.js → chunk-57D7DG3Q.js} +1 -1
- package/{chunk-FMQVV33X.js → chunk-5BXTTSOP.js} +1 -1
- package/{chunk-JHPJ4MGU.js → chunk-5RGY4F7I.js} +1 -1
- package/{chunk-MG4ANKML.js → chunk-6FKXFARK.js} +1 -1
- package/{chunk-77KCWCRS.js → chunk-7E74W6WW.js} +2 -2
- package/{chunk-ISOQMZH7.js → chunk-7TJ6TXHJ.js} +1 -1
- package/{chunk-NGPSYFYL.js → chunk-ATDQTCSX.js} +1 -1
- package/{chunk-3UVMXT5B.js → chunk-BXY2NVJG.js} +1 -1
- package/{chunk-YYMKIN6V.js → chunk-C46G7Q7U.js} +1 -1
- package/{chunk-JQPCBCM7.js → chunk-DHW6IGKB.js} +2 -2
- package/{chunk-P5IIC4NE.js → chunk-DMNOUNVA.js} +1 -1
- package/{chunk-DPCBCM5D.js → chunk-DOWFGTEO.js} +1 -1
- package/{chunk-S32NCUGA.js → chunk-DYTMAI7L.js} +1 -1
- package/{chunk-IJONYXTD.js → chunk-EN3A5A5C.js} +1 -1
- package/{chunk-P6FGXTBZ.js → chunk-ETP6ZSNL.js} +2 -2
- package/{chunk-SQ3SQOQY.js → chunk-F4BFKDR4.js} +1 -1
- package/{chunk-WGCLZSC7.js → chunk-FJTBJQGQ.js} +1 -1
- package/{chunk-SGQB3C2L.js → chunk-HLX24FYU.js} +1 -1
- package/{chunk-DVFNJNJJ.js → chunk-HSJFWPLG.js} +1 -1
- package/{chunk-D76TQJK5.js → chunk-I2TZZXJL.js} +1 -1
- package/{chunk-Q7CVCL25.js → chunk-K2FH5Z6F.js} +1 -1
- package/{chunk-BHP7NYZ4.js → chunk-KONPP7HM.js} +1 -1
- package/{chunk-UC5HKZSR.js → chunk-KR6DPLHN.js} +1 -1
- package/{chunk-VBAHUAJS.js → chunk-KY4EBOEB.js} +1 -1
- package/{chunk-S37YZPHR.js → chunk-M4LLZHKE.js} +1 -1
- package/{chunk-ZSRAYXJU.js → chunk-MRIW4627.js} +1 -1
- package/{chunk-PZO4HMLT.js → chunk-N557TZES.js} +1 -1
- package/{chunk-QZNCENWD.js → chunk-NBK5FR62.js} +2 -2
- package/{chunk-GIBQL72Q.js → chunk-OEFBXMXZ.js} +1 -1
- package/{chunk-N72UYL5Y.js → chunk-P55NMMMB.js} +1 -1
- package/{chunk-7JO6LW3O.js → chunk-PRMMCAGR.js} +1 -1
- package/{chunk-3WDS5EXM.js → chunk-Q65FW2EM.js} +1 -1
- package/{chunk-F6XVHVND.js → chunk-QLLOE7QW.js} +1 -1
- package/{chunk-VUDPVFKL.js → chunk-R2IYAZSE.js} +1 -1
- package/{chunk-A7AIX5OW.js → chunk-R5Q5RJJY.js} +1 -1
- package/{chunk-V63TFXDO.js → chunk-TGWHSWWX.js} +1 -1
- package/{chunk-EMMG7PXA.js → chunk-THSOUH4P.js} +1 -1
- package/{chunk-HBTF4B3Q.js → chunk-TSXIHD3X.js} +1 -1
- package/{chunk-CNW4OSB5.js → chunk-TWDYXQSM.js} +1 -1
- package/{chunk-YM4SHG3Z.js → chunk-VZSCGFD2.js} +1 -1
- package/{chunk-ZRDIIE3G.js → chunk-WQ4FPUGZ.js} +1 -1
- package/{chunk-BG6LSO5D.js → chunk-XPNCASSR.js} +1 -1
- package/chunk-YLD6FBJE.js +1 -0
- package/{chunk-6Z275RHE.js → chunk-YNAV5JSB.js} +1 -1
- package/{chunk-FQXBUB5Z.js → chunk-Z3OSIXXU.js} +1 -1
- package/{chunk-SNUYIITB.js → chunk-ZPEEG2MX.js} +1 -1
- package/{chunk-3FNKBRI4.js → chunk-ZZHR3572.js} +1 -1
- package/index.html +2 -2
- package/{main-DOREGDKZ.js → main-7RB7FA7W.js} +1 -1
- package/package.json +1 -1
- package/chunk-PZGPTTYS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as K}from"./chunk-
|
|
1
|
+
import{a as y,b as K}from"./chunk-Q65FW2EM.js";import"./chunk-WQ4FPUGZ.js";import{m as j}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as R,b as D}from"./chunk-B7TARMUS.js";import"./chunk-WAKVBF4U.js";import{h as J}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as H,b as L}from"./chunk-45NYDNRM.js";import"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as N,I as G,J as q,K as z}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import"./chunk-JGVJQYWH.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import{a as V}from"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{o as E,t as I}from"./chunk-5KNGGA7C.js";import{Ab as $,Hc as F,Ic as b,Mb as _,Nb as h,R as M,Rc as l,Sb as p,Sc as s,T as k,Tb as o,Ub as n,V as w,Vb as u,Vc as S,ac as x,da as m,db as r,f as A,fc as v,gc as a,ka as g,la as C,ma as B,na as O,s as d,sc as T,ub as P}from"./chunk-ZIDIPNEH.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(e,f){if(e&1){let t=x();o(0,"p-button",6),v("onClick",function(){g(t);let c=a(2);return C(c.onFormatCOA())}),n()}}function W(e,f){if(e&1){let t=x();o(0,"p-button",7),l(1,"async"),l(2,"async"),v("onClick",function(){g(t);let c=a(2);return C(c.onMigrateCoaAccount())}),n()}if(e&2){let t=a(2);p("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(e,f){if(e&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),e&2){let t=a();r(),h(t.roleService.permissions().migrate.delete?1:-1),r(),h(t.roleService.permissions().migrate.create?2:-1)}}function Y(e,f){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),l(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),O(),u(7,"app-migration-cards",12),l(8,"async"),n()()()),e&2){let t=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),p("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),p("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var vt=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new A(void 0),this.pageTitle="Chart of Account",this.roleService=m(j)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getCOACount()),w(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(d(i=>Number(i.pos))),this.countInBooks$=t.pipe(d(i=>Number(i.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=P({type:e,selectors:[["app-chart-of-account"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,c){i&1&&(o(0,"app-main-panel",2),$(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&p("pageTitle",c.pageTitle)},dependencies:[J,I,K,G,N,D,R,L,H,z,q,E],encapsulation:2})}}return e})();export{vt as ChartOfAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as dt}from"./chunk-2U3KEP66.js";import{a as oe}from"./chunk-YHLRDTIS.js";import{a as gt,b as xt}from"./chunk-DIT4MZDT.js";import{a as Ye}from"./chunk-GIBQL72Q.js";import{a as It,b as st}from"./chunk-ZRDIIE3G.js";import{a as ct,b as mt}from"./chunk-BS66RAKW.js";import{a as ut}from"./chunk-XKI7WLHE.js";import"./chunk-YUVA7MXG.js";import"./chunk-534L4NXK.js";import{m as _e}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as ie,b as re}from"./chunk-4TVWOK6B.js";import{b as Ve,g as lt,h as pt,i as Ne}from"./chunk-K2XFBG4B.js";import{b as at}from"./chunk-DBTEBZLE.js";import{a as rt,b as ot}from"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import{a as Ae}from"./chunk-BR3ARMX5.js";import{a as Ie,b as Te}from"./chunk-B7TARMUS.js";import"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import{b as Me,c as ke}from"./chunk-GCUU37JB.js";import"./chunk-JCGIG4OG.js";import"./chunk-MQZKQQJ2.js";import"./chunk-KIYQBDPO.js";import{b as Z}from"./chunk-WAKVBF4U.js";import"./chunk-2BKQ45PR.js";import"./chunk-EUBEE6D7.js";import{e as it,h as B}from"./chunk-VBAHUAJS.js";import"./chunk-OZY5YA4U.js";import{a as A,b as L}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import{b as P,c as De,d as nt,e as Pe,f as we,g as Fe}from"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as J,I as Q,y as ye,z as Re}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{b as he,c as X,e as Y,f as Ee,i as Je,j as Qe,k as ve,p as Ce,q as Se,v as Ze,w as et,x as tt,y as be}from"./chunk-JGVJQYWH.js";import{b as ge,d as xe,e as V,l as N}from"./chunk-5IZ2YCM4.js";import"./chunk-SQ3SQOQY.js";import{a as fe}from"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as Ke,l as Xe,q as de,r as K,t as k}from"./chunk-5KNGGA7C.js";import{Ab as C,Ac as ce,Bc as me,Da as Ge,G as Ue,Hc as ue,Ic as We,Jc as R,Mb as b,Nb as y,Ob as $,Qb as H,Rb as W,Rc as S,Sb as m,Sc as F,T as O,Tb as r,Tc as z,Ub as n,V as w,Vb as g,Vc as f,Zc as ne,_ as pe,ac as I,c as te,da as d,db as l,fc as T,gc as u,ka as E,la as v,qa as ze,s as G,ub as M,uc as a,vc as h,wa as U,wc as D,yc as He,zb as $e,zc as se}from"./chunk-ZIDIPNEH.js";import{a as x,b as _,g as Rt}from"./chunk-PRARYYF3.js";var j=(()=>{class t{#e=d(fe);#t=d(Ye);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=pe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tt={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Le=De(Fe(Tt),nt(t=>({first:ne(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:ne(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:ne(()=>t.data().data.some(s=>s.checked)),checkedInvoice:ne(()=>t.data().data.filter(s=>s.checked).map(s=>s.id))})),we(t=>{let s=d(j);return{updateFilter(o){P(t,i=>_(x({},i),{filter:x(x({},i.filter),o)}))},onRowSelect(o){P(t,i=>{let c=i.data.data.map(p=>p.id===o.id?_(x({},p),{checked:!0}):p);return _(x({},i),{data:_(x({},i.data),{data:c})})})},onRowUnselect(o){P(t,i=>{let c=i.data.data.map(p=>p.id===o.id?_(x({},p),{checked:!1}):p);return _(x({},i),{data:_(x({},i.data),{data:c})})})},onHeaderCheckboxToggle(o){P(t,i=>{let c=i.data.data.map(p=>_(x({},p),{checked:o}));return _(x({},i),{data:_(x({},i.data),{data:c})})})},getRecurringExpenseLoader:ie(te(O(()=>s.getRecurringExpenseLoader().pipe(re({next:o=>{P(t,i=>_(x({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ie(te(G(o=>Object.entries(o).reduce((i,[c,p])=>(p!=null&&(i[c]=p),i),{})),O(o=>s.getRecurringExpenses(o).pipe(re({next:i=>{P(t,c=>_(x({},c),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),Pe(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var wt=["class","page"],Ft=t=>["details/",t];function Mt(t,s){if(t&1){let e=I();r(0,"p-button",11),T("onClick",function(){E(e);let i=u(2);return v(i.onDeleteSelected())}),n()}}function kt(t,s){t&1&&(r(0,"a",10),g(1,"i",12),r(2,"span"),a(3,"Add"),n()())}function Vt(t,s){if(t&1&&(r(0,"div",8),b(1,Mt,1,0,"p-button",9),b(2,kt,4,0,"a",10),n()),t&2){let e=u();l(),y(e.store.hasCheckedRows()&&e.roleService.permissions().recurring.delete?1:-1),l(),y(e.roleService.permissions().recurring.create?2:-1)}}function Nt(t,s){t&1&&(r(0,"th"),g(1,"p-tableHeaderCheckbox"),n())}function At(t,s){if(t&1&&(r(0,"tr"),b(1,Nt,2,0,"th"),r(2,"th"),a(3,"Tag"),n(),r(4,"th"),a(5,"Name"),n(),r(6,"th"),a(7,"Expense Account"),n(),r(8,"th"),a(9,"Start Date"),n(),r(10,"th"),a(11,"End Date"),n(),r(12,"th"),a(13,"Last Expense"),n(),r(14,"th"),a(15,"Amount"),n(),r(16,"th"),a(17,"Frequency"),n()()),t&2){let e=u(2);l(),y(e.roleService.permissions().recurring.delete?1:-1)}}function Lt(t,s){if(t&1&&(r(0,"td"),g(1,"p-tableCheckbox",15),n()),t&2){let e=u().$implicit;l(),m("value",e)}}function Bt(t,s){if(t&1&&(r(0,"tr"),b(1,Lt,2,1,"td"),r(2,"td"),a(3),n(),r(4,"td")(5,"a",14),a(6),n()(),r(7,"td"),a(8),n(),r(9,"td"),a(10),S(11,"date"),n(),r(12,"td"),a(13),S(14,"date"),n(),r(15,"td"),a(16),S(17,"date"),n(),r(18,"td"),a(19),S(20,"number"),n(),r(21,"td"),a(22),n()()),t&2){let e=s.$implicit,o=u(2);l(),y(o.roleService.permissions().recurring.delete?1:-1),l(2),h(e.outletName),l(2),m("routerLink",R(21,Ft,e.id)),l(),h(e.name),l(2),h(e.expenseName),l(2),h(z(11,10,e.startDate,"d MMM y")),l(3),h(z(14,13,e.endDate,"d MMM y")),l(3),h(z(17,16,e.lastExpenseDate,"d MMM y")),l(3),h(F(20,19,e.amount)),l(3),h(e.repeatTypeLabel)}}function jt(t,s){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=u(2);l(),He(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function qt(t,s){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Ot(t,s){if(t&1){let e=I();r(0,"p-panel")(1,"p-table",13),T("onPage",function(i){E(e);let c=u();return v(c.onPageChange(i))})("onHeaderCheckboxToggle",function(i){E(e);let c=u();return v(c.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){E(e);let c=u();return v(c.onRowSelect(i))})("onRowUnselect",function(i){E(e);let c=u();return v(c.onRowUnselect(i))}),C(2,At,18,1,"ng-template",null,3,f)(4,Bt,23,23,"ng-template",null,4,f)(6,jt,2,3,"ng-template",null,5,f)(8,qt,4,0,"ng-template",null,6,f),n()()}if(t&2){let e=u();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function Ut(t,s){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),g(4,"p-select",20),n()()),t&2){let e=u();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var ht=(()=>{class t extends ut{constructor(){super(...arguments),this.store=d(Le),this.recurringExpenseService=d(j),this.fb=d(Ze),this.isDialogFilterVisible=U(!1),this.roleService=d(_e)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(x({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(w(()=>{this.store.updateFilter(_(x({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(x({},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,c])=>(c!=null&&(o[i]=c),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,pageSize:c,export:p,exportPageNumber:q,exportPageSize:yt}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),pageSize:this.fb.control(c),export:this.fb.control(p),exportPageNumber:this.fb.control(q),exportPageSize:this.fb.control(yt)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ge(t)))(i||t)}})()}static{this.\u0275cmp=M({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[ue([Le]),$e],attrs:wt,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"],["routerLink","create",1,"p-button"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[1,"link-primary",3,"routerLink"],[3,"value"],["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 c=I();r(0,"app-main-panel",7),T("search",function(q){return E(c),v(i.onSearchEvent(q))}),me("isDialogFilterVisibleChange",function(q){return E(c),ce(i.isDialogFilterVisible,q)||(i.isDialogFilterVisible=q),v(q)}),T("filterConfirmed",function(){return E(c),v(i.onFilterEvent())}),C(1,Vt,3,2,"ng-template",null,0,f)(3,Ot,10,5,"ng-template",null,1,f)(5,Ut,5,2,"ng-template",null,2,f),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),se("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[B,V,Z,Ne,Ve,lt,pt,k,N,it,ke,Me,Q,J,be,ve,Y,Ee,Se,Ce,L,A,K,de],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 ee=Rt(It());var $t=["class","page"],Ht=()=>["/pages/recurring/recurring-expense"],le=t=>({"ng-dirty ng-invalid":t});function Wt(t,s){if(t&1){let e=I();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),T("click",function(){E(e);let i=u();return v(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",We(1,Ht)))}function Kt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Xt(t,s){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=s.$implicit;l(2),D(" ",e.name," ")}}function Yt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Jt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Qt(t,s){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=s.$implicit;l(3),D("(",e.code,")"),l(2),D(" ",e.value," ")}}function Zt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function en(t,s){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=s.$implicit;l(3),D("(",e.code,")"),l(2),D(" ",e.value," ")}}function tn(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function nn(t,s){if(t&1){let e=I();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(),g(12,"input",18),r(13,"div"),H(14,Kt,2,1,"small",19,$),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Tag"),n(),r(21,"p-select",21),C(22,Xt,3,1,"ng-template",null,3,f),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),T("completeMethod",function(i){E(e);let c=u(2);return v(c.searchContact(i))}),n()(),r(30,"div"),H(31,Yt,2,1,"small",19,$),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),g(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),g(42,"p-datepicker",24),n()(),g(43,"div",25),n(),g(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),g(50,"input",26),r(51,"div"),H(52,Jt,2,1,"small",19,$),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),g(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),C(64,Qt,6,2,"ng-template",null,3,f),n()(),r(66,"div"),H(67,Zt,2,1,"small",19,$),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),C(74,en,6,2,"ng-template",null,3,f),n()(),r(76,"div"),H(77,tn,2,1,"small",19,$),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),g(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,c,p=u(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",R(16,le,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("ngClass",R(18,le,p.isInvalid("contact")))("showClear",!0)("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",R(20,le,p.isInvalid("amount"))),l(2),W(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("ngClass",R(22,le,p.isInvalid("expenseAccountID")))("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses),l(4),W(p.getErrors("expenseAccountID")),l(6),m("ngClass",R(24,le,p.isInvalid("paymentAccountID")))("options",(c=p.recurringExpenseData())==null||c.options==null?null:c.options.assets),l(4),W(p.getErrors("paymentAccountID"))}}function rn(t,s){if(t&1&&C(0,nn,84,26,"div",8),t&2){let e=u();m("ngIf",e.recurringExpenseData())}}var qe=(()=>{class t{constructor(){this.recurringExpenseService=d(j),this.fb=d(et),this.destroyRef=d(ze),this.route=d(ge),this.recurringExpenseData=U(null),this.customerSupplierSuggestions=U([]),this.router=d(xe),this.contactType=new Je(0),this.dayjsService=d(st)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[X.required]),repeatTypeID:this.fb.control(1,[X.required]),startDate:this.fb.control((0,ee.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[X.required]),paymentAccountID:this.fb.control(null,[X.required]),expenseAccountID:this.fb.control(null,[X.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()),w(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[c,p])=>{switch(c){case"startDate":i[c]=(0,ee.default)(p).isSame((0,ee.default)("0001-01-01T00:00:00"))?(0,ee.default)().toDate():(0,ee.default)(p).toDate();break;case"repeatTypeID":i[c]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[c]=p===oe?null:p;break;case"expenseAccountID":i[c]=p===oe?null:p;break;default:i[c]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(w(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,[c,p])=>{switch(c){case"amount":i[c]=+p;break;case"startDate":i[c]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[c]=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=oe;break;default:i[c]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(w(()=>{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[c,p]of Object.entries(o.errors))switch(c){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=M({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:$t,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"],["icon","fa-solid fa-plus","label","Submit",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","pInputText","","type","text",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["appendTo","body","filter","","filterBy","name","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Tag",3,"options"],["formControlName","contact","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","ngClass","showClear","suggestions"],["appendTo","body","dateFormat","mm/dd/yy","fluid","","formControlName","startDate","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","endDate","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],[1,"col"],["appMaskNumber","","formControlName","amount","pInputText","","type","text",3,"ngClass"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","filter","","filterBy","code,value","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense",3,"ngClass","options"],["appendTo","body","filter","","filterBy","code,value","formControlName","paymentAccountID","optionLabel","value","optionValue","key","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["cols","30","formControlName","description","pTextarea","","rows","3"],[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),C(1,Wt,4,2,"ng-template",null,0,f)(3,rn,1,1,"ng-template",null,1,f),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[B,Z,Re,ye,ke,Me,ot,rt,xt,gt,mt,ct,Te,Ie,k,Ke,Xe,be,ve,he,Y,Ee,Se,Ce,N,V,Q,J,dt,L,A,at],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var on=["class","page"],an=t=>["/pages/recurring/recurring-expense/edit",t];function ln(t,s){if(t&1&&(r(0,"a",4),g(1,"i",6),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=u(4);m("routerLink",R(1,an,e.currentRecurringExpense().id))}}function pn(t,s){if(t&1){let e=I();r(0,"p-button",7),T("onClick",function(){E(e);let i=u(4);return v(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function sn(t,s){if(t&1&&(r(0,"div",3),b(1,ln,4,3,"a",4),b(2,pn,1,0,"p-button",5),n()),t&2){let e=u(3);l(),y(e.roleService.permissions().recurring.edit?1:-1),l(),y(e.roleService.permissions().recurring.delete?2:-1)}}function cn(t,s){if(t&1&&b(0,sn,3,2,"div",3),t&2){let e=u(2);y(e.currentRecurringExpense()?0:-1)}}function mn(t,s){if(t&1){let e=I();r(0,"p-panel",10)(1,"p-scroll-panel")(2,"div",8)(3,"div",11)(4,"div",12)(5,"div",11)(6,"div",13)(7,"div",14)(8,"div",15)(9,"label",16),a(10,"Tag"),n(),r(11,"input",17),me("ngModelChange",function(i){E(e);let c=u(3);return ce(c.currentRecurringExpense().outletName,i)||(c.currentRecurringExpense().outletName=i),v(i)}),n()()(),r(12,"div",14)(13,"div",15)(14,"label",16),a(15,"Supplier"),n(),g(16,"input",18),n()(),r(17,"div",14)(18,"div",15)(19,"label",16),a(20,"From"),n(),g(21,"input",19),S(22,"date"),n()(),r(23,"div",14)(24,"div",15)(25,"label",16),a(26,"To"),n(),g(27,"input",19),S(28,"date"),n()()(),g(29,"hr"),r(30,"div",13)(31,"div",14)(32,"div",15)(33,"label",16),a(34,"Amount"),n(),g(35,"input",19),S(36,"number"),n()(),r(37,"div",14)(38,"div",15)(39,"label",16),a(40,"Frequency"),n(),g(41,"input",19),n()(),r(42,"div",14)(43,"div",15)(44,"label",16),a(45,"Expense (Debit)"),n(),g(46,"input",19),n()(),r(47,"div",14)(48,"div",15)(49,"label",16),a(50,"Payment (Credit)"),n(),g(51,"input",19),n()(),r(52,"div",20)(53,"div",15)(54,"label",16),a(55,"Description"),n(),g(56,"textarea",21),n()()()()()()()()()}if(t&2){let e=u(3);l(11),se("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",z(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",z(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 un(t,s){if(t&1&&(r(0,"div",8)(1,"div",9),b(2,mn,57,17,"p-panel",10),n()()),t&2){let e=u(2);l(2),y(e.currentRecurringExpense()?2:-1)}}function dn(t,s){if(t&1&&(r(0,"app-main-panel",2),C(1,cn,1,1,"ng-template",null,0,f)(3,un,3,1,"ng-template",null,1,f),n()),t&2){let e=u();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var vt=(()=>{class t{constructor(){this.recurringExpenseService=d(j),this.route=d(ge),this.router=d(xe),this.currentRecurringExpense=U(null),this.roleService=d(_e)}ngOnInit(){this.route.paramMap.pipe(G(e=>e.get("id")),Ae("params"),Ue(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),w(e=>this.currentRecurringExpense.set(e)),Ae("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(w(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:on,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[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"],[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&&b(0,dn,5,3,"app-main-panel",2),o&2&&y(i.currentRecurringExpense()?0:-1)},dependencies:[B,Z,k,Re,ye,tt,he,Y,Qe,Q,J,N,V,L,A,Te,Ie,K,de],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ct=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:ht},{path:"create",component:qe},{path:"details/:id",component:vt},{path:"edit/:id",component:qe}]}];var St=(()=>{class t{constructor(){this.httpService=d(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=pe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var gn={filter:{Text:"",Frequency:0,PageNumber:1,PageSize:10},data:null},Oe=De(Fe(gn),we(t=>{let s=d(St);return{getAssetValue:ie(te(O(o=>s.getAssetValue(o).pipe(re({next:i=>{P(t,c=>_(x({},c),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{P(t,i=>_(x({},i),{filter:o}))}}}),Pe({onInit:t=>{t.getAssetValue(t.filter())}}));var xn=t=>["/pages/recurring/recurring-expense/details/",t];function fn(t,s){t&1&&g(0,"div",5)}function _n(t,s){t&1&&(r(0,"tr")(1,"th"),a(2,"Tags"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",7),a(8,"Price on Purchase"),n(),r(9,"th",7),a(10,"Accomulated Depreciation"),n(),r(11,"th",7),a(12,"Book Value"),n(),r(13,"th",7),a(14,"Frequency"),n()())}function hn(t,s){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",8),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",7),a(9),S(10,"number"),n(),r(11,"td",7),a(12),S(13,"number"),n(),r(14,"td",7),a(15),S(16,"number"),n(),r(17,"td",7),a(18),S(19,"number"),n()()),t&2){let e=s.$implicit;l(2),h(e.entityName),l(2),m("routerLink",R(16,xn,e.id)),l(),h(e.name),l(2),h(e.accountCode),l(2),h(F(10,8,e.priceOnPurchase)),l(3),D(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),D(" ",F(16,12,e.bookValue)," "),l(3),D(" ",F(19,14,e.depreciationPerYear)," ")}}function En(t,s){if(t&1&&(r(0,"p-panel")(1,"p-table",6),C(2,_n,15,0,"ng-template",null,2,f)(4,hn,20,18,"ng-template",null,3,f),n()()),t&2){let e=u(2);l(),m("value",e.store.data().data)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)}}function vn(t,s){if(t&1&&b(0,En,6,3,"p-panel"),t&2){let e=u();y(e.store.data()?0:-1)}}var bt=(()=>{class t{constructor(){this.store=d(Oe)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-asset-value"]],features:[ue([Oe])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],["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),C(1,fn,1,0,"ng-template",null,0,f)(3,vn,1,1,"ng-template",null,1,f),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[B,k,L,A,Ne,Ve,N,V,K],encapsulation:2})}}return t})();var fr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:Ct},{path:"asset-value",component:bt},{path:"post-to-journal",loadComponent:()=>import("./chunk-ISOQMZH7.js").then(t=>t.PostRecurringExpenseComponent)}];export{fr as RECURRING_ROUTES};
|
|
1
|
+
import{a as dt}from"./chunk-2U3KEP66.js";import{a as oe}from"./chunk-YHLRDTIS.js";import{a as gt,b as xt}from"./chunk-DIT4MZDT.js";import{a as Ye}from"./chunk-OEFBXMXZ.js";import{a as It,b as st}from"./chunk-WQ4FPUGZ.js";import{a as ct,b as mt}from"./chunk-BS66RAKW.js";import{a as ut}from"./chunk-XKI7WLHE.js";import"./chunk-YUVA7MXG.js";import"./chunk-534L4NXK.js";import{m as _e}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as ie,b as re}from"./chunk-4TVWOK6B.js";import{b as Ve,g as lt,h as pt,i as Ne}from"./chunk-K2XFBG4B.js";import{b as at}from"./chunk-DBTEBZLE.js";import{a as rt,b as ot}from"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import{a as Ae}from"./chunk-BR3ARMX5.js";import{a as Ie,b as Te}from"./chunk-B7TARMUS.js";import"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import{b as Me,c as ke}from"./chunk-GCUU37JB.js";import"./chunk-JCGIG4OG.js";import"./chunk-MQZKQQJ2.js";import"./chunk-KIYQBDPO.js";import{b as Z}from"./chunk-WAKVBF4U.js";import"./chunk-2BKQ45PR.js";import"./chunk-EUBEE6D7.js";import{e as it,h as B}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as A,b as L}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import{b as P,c as De,d as nt,e as Pe,f as we,g as Fe}from"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as J,I as Q,y as ye,z as Re}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{b as he,c as X,e as Y,f as Ee,i as Je,j as Qe,k as ve,p as Ce,q as Se,v as Ze,w as et,x as tt,y as be}from"./chunk-JGVJQYWH.js";import{b as ge,d as xe,e as V,l as N}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import{a as fe}from"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as Ke,l as Xe,q as de,r as K,t as k}from"./chunk-5KNGGA7C.js";import{Ab as C,Ac as ce,Bc as me,Da as Ge,G as Ue,Hc as ue,Ic as We,Jc as R,Mb as b,Nb as y,Ob as $,Qb as H,Rb as W,Rc as S,Sb as m,Sc as F,T as O,Tb as r,Tc as z,Ub as n,V as w,Vb as g,Vc as f,Zc as ne,_ as pe,ac as I,c as te,da as d,db as l,fc as T,gc as u,ka as E,la as v,qa as ze,s as G,ub as M,uc as a,vc as h,wa as U,wc as D,yc as He,zb as $e,zc as se}from"./chunk-ZIDIPNEH.js";import{a as x,b as _,g as Rt}from"./chunk-PRARYYF3.js";var j=(()=>{class t{#e=d(fe);#t=d(Ye);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=pe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Tt={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Le=De(Fe(Tt),nt(t=>({first:ne(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:ne(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:ne(()=>t.data().data.some(s=>s.checked)),checkedInvoice:ne(()=>t.data().data.filter(s=>s.checked).map(s=>s.id))})),we(t=>{let s=d(j);return{updateFilter(o){P(t,i=>_(x({},i),{filter:x(x({},i.filter),o)}))},onRowSelect(o){P(t,i=>{let c=i.data.data.map(p=>p.id===o.id?_(x({},p),{checked:!0}):p);return _(x({},i),{data:_(x({},i.data),{data:c})})})},onRowUnselect(o){P(t,i=>{let c=i.data.data.map(p=>p.id===o.id?_(x({},p),{checked:!1}):p);return _(x({},i),{data:_(x({},i.data),{data:c})})})},onHeaderCheckboxToggle(o){P(t,i=>{let c=i.data.data.map(p=>_(x({},p),{checked:o}));return _(x({},i),{data:_(x({},i.data),{data:c})})})},getRecurringExpenseLoader:ie(te(O(()=>s.getRecurringExpenseLoader().pipe(re({next:o=>{P(t,i=>_(x({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ie(te(G(o=>Object.entries(o).reduce((i,[c,p])=>(p!=null&&(i[c]=p),i),{})),O(o=>s.getRecurringExpenses(o).pipe(re({next:i=>{P(t,c=>_(x({},c),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),Pe(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var wt=["class","page"],Ft=t=>["details/",t];function Mt(t,s){if(t&1){let e=I();r(0,"p-button",11),T("onClick",function(){E(e);let i=u(2);return v(i.onDeleteSelected())}),n()}}function kt(t,s){t&1&&(r(0,"a",10),g(1,"i",12),r(2,"span"),a(3,"Add"),n()())}function Vt(t,s){if(t&1&&(r(0,"div",8),b(1,Mt,1,0,"p-button",9),b(2,kt,4,0,"a",10),n()),t&2){let e=u();l(),y(e.store.hasCheckedRows()&&e.roleService.permissions().recurring.delete?1:-1),l(),y(e.roleService.permissions().recurring.create?2:-1)}}function Nt(t,s){t&1&&(r(0,"th"),g(1,"p-tableHeaderCheckbox"),n())}function At(t,s){if(t&1&&(r(0,"tr"),b(1,Nt,2,0,"th"),r(2,"th"),a(3,"Tag"),n(),r(4,"th"),a(5,"Name"),n(),r(6,"th"),a(7,"Expense Account"),n(),r(8,"th"),a(9,"Start Date"),n(),r(10,"th"),a(11,"End Date"),n(),r(12,"th"),a(13,"Last Expense"),n(),r(14,"th"),a(15,"Amount"),n(),r(16,"th"),a(17,"Frequency"),n()()),t&2){let e=u(2);l(),y(e.roleService.permissions().recurring.delete?1:-1)}}function Lt(t,s){if(t&1&&(r(0,"td"),g(1,"p-tableCheckbox",15),n()),t&2){let e=u().$implicit;l(),m("value",e)}}function Bt(t,s){if(t&1&&(r(0,"tr"),b(1,Lt,2,1,"td"),r(2,"td"),a(3),n(),r(4,"td")(5,"a",14),a(6),n()(),r(7,"td"),a(8),n(),r(9,"td"),a(10),S(11,"date"),n(),r(12,"td"),a(13),S(14,"date"),n(),r(15,"td"),a(16),S(17,"date"),n(),r(18,"td"),a(19),S(20,"number"),n(),r(21,"td"),a(22),n()()),t&2){let e=s.$implicit,o=u(2);l(),y(o.roleService.permissions().recurring.delete?1:-1),l(2),h(e.outletName),l(2),m("routerLink",R(21,Ft,e.id)),l(),h(e.name),l(2),h(e.expenseName),l(2),h(z(11,10,e.startDate,"d MMM y")),l(3),h(z(14,13,e.endDate,"d MMM y")),l(3),h(z(17,16,e.lastExpenseDate,"d MMM y")),l(3),h(F(20,19,e.amount)),l(3),h(e.repeatTypeLabel)}}function jt(t,s){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=u(2);l(),He(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function qt(t,s){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Ot(t,s){if(t&1){let e=I();r(0,"p-panel")(1,"p-table",13),T("onPage",function(i){E(e);let c=u();return v(c.onPageChange(i))})("onHeaderCheckboxToggle",function(i){E(e);let c=u();return v(c.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){E(e);let c=u();return v(c.onRowSelect(i))})("onRowUnselect",function(i){E(e);let c=u();return v(c.onRowUnselect(i))}),C(2,At,18,1,"ng-template",null,3,f)(4,Bt,23,23,"ng-template",null,4,f)(6,jt,2,3,"ng-template",null,5,f)(8,qt,4,0,"ng-template",null,6,f),n()()}if(t&2){let e=u();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function Ut(t,s){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),g(4,"p-select",20),n()()),t&2){let e=u();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var ht=(()=>{class t extends ut{constructor(){super(...arguments),this.store=d(Le),this.recurringExpenseService=d(j),this.fb=d(Ze),this.isDialogFilterVisible=U(!1),this.roleService=d(_e)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(x({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(w(()=>{this.store.updateFilter(_(x({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(x({},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,c])=>(c!=null&&(o[i]=c),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,pageSize:c,export:p,exportPageNumber:q,exportPageSize:yt}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),pageSize:this.fb.control(c),export:this.fb.control(p),exportPageNumber:this.fb.control(q),exportPageSize:this.fb.control(yt)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ge(t)))(i||t)}})()}static{this.\u0275cmp=M({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[ue([Le]),$e],attrs:wt,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"],["routerLink","create",1,"p-button"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[1,"link-primary",3,"routerLink"],[3,"value"],["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 c=I();r(0,"app-main-panel",7),T("search",function(q){return E(c),v(i.onSearchEvent(q))}),me("isDialogFilterVisibleChange",function(q){return E(c),ce(i.isDialogFilterVisible,q)||(i.isDialogFilterVisible=q),v(q)}),T("filterConfirmed",function(){return E(c),v(i.onFilterEvent())}),C(1,Vt,3,2,"ng-template",null,0,f)(3,Ot,10,5,"ng-template",null,1,f)(5,Ut,5,2,"ng-template",null,2,f),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),se("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[B,V,Z,Ne,Ve,lt,pt,k,N,it,ke,Me,Q,J,be,ve,Y,Ee,Se,Ce,L,A,K,de],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 ee=Rt(It());var $t=["class","page"],Ht=()=>["/pages/recurring/recurring-expense"],le=t=>({"ng-dirty ng-invalid":t});function Wt(t,s){if(t&1){let e=I();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),T("click",function(){E(e);let i=u();return v(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",We(1,Ht)))}function Kt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Xt(t,s){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=s.$implicit;l(2),D(" ",e.name," ")}}function Yt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Jt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function Qt(t,s){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=s.$implicit;l(3),D("(",e.code,")"),l(2),D(" ",e.value," ")}}function Zt(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function en(t,s){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=s.$implicit;l(3),D("(",e.code,")"),l(2),D(" ",e.value," ")}}function tn(t,s){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=s.$implicit;l(),h(e)}}function nn(t,s){if(t&1){let e=I();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(),g(12,"input",18),r(13,"div"),H(14,Kt,2,1,"small",19,$),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Tag"),n(),r(21,"p-select",21),C(22,Xt,3,1,"ng-template",null,3,f),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),T("completeMethod",function(i){E(e);let c=u(2);return v(c.searchContact(i))}),n()(),r(30,"div"),H(31,Yt,2,1,"small",19,$),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),g(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),g(42,"p-datepicker",24),n()(),g(43,"div",25),n(),g(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),g(50,"input",26),r(51,"div"),H(52,Jt,2,1,"small",19,$),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),g(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),C(64,Qt,6,2,"ng-template",null,3,f),n()(),r(66,"div"),H(67,Zt,2,1,"small",19,$),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),C(74,en,6,2,"ng-template",null,3,f),n()(),r(76,"div"),H(77,tn,2,1,"small",19,$),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),g(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,c,p=u(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",R(16,le,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("ngClass",R(18,le,p.isInvalid("contact")))("showClear",!0)("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",R(20,le,p.isInvalid("amount"))),l(2),W(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("ngClass",R(22,le,p.isInvalid("expenseAccountID")))("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses),l(4),W(p.getErrors("expenseAccountID")),l(6),m("ngClass",R(24,le,p.isInvalid("paymentAccountID")))("options",(c=p.recurringExpenseData())==null||c.options==null?null:c.options.assets),l(4),W(p.getErrors("paymentAccountID"))}}function rn(t,s){if(t&1&&C(0,nn,84,26,"div",8),t&2){let e=u();m("ngIf",e.recurringExpenseData())}}var qe=(()=>{class t{constructor(){this.recurringExpenseService=d(j),this.fb=d(et),this.destroyRef=d(ze),this.route=d(ge),this.recurringExpenseData=U(null),this.customerSupplierSuggestions=U([]),this.router=d(xe),this.contactType=new Je(0),this.dayjsService=d(st)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[X.required]),repeatTypeID:this.fb.control(1,[X.required]),startDate:this.fb.control((0,ee.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[X.required]),paymentAccountID:this.fb.control(null,[X.required]),expenseAccountID:this.fb.control(null,[X.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()),w(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[c,p])=>{switch(c){case"startDate":i[c]=(0,ee.default)(p).isSame((0,ee.default)("0001-01-01T00:00:00"))?(0,ee.default)().toDate():(0,ee.default)(p).toDate();break;case"repeatTypeID":i[c]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[c]=p===oe?null:p;break;case"expenseAccountID":i[c]=p===oe?null:p;break;default:i[c]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(w(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,[c,p])=>{switch(c){case"amount":i[c]=+p;break;case"startDate":i[c]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[c]=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=oe;break;default:i[c]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(w(()=>{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[c,p]of Object.entries(o.errors))switch(c){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=M({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:$t,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"],["icon","fa-solid fa-plus","label","Submit",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","pInputText","","type","text",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["appendTo","body","filter","","filterBy","name","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Tag",3,"options"],["formControlName","contact","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","ngClass","showClear","suggestions"],["appendTo","body","dateFormat","mm/dd/yy","fluid","","formControlName","startDate","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","endDate","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],[1,"col"],["appMaskNumber","","formControlName","amount","pInputText","","type","text",3,"ngClass"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","filter","","filterBy","code,value","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense",3,"ngClass","options"],["appendTo","body","filter","","filterBy","code,value","formControlName","paymentAccountID","optionLabel","value","optionValue","key","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["cols","30","formControlName","description","pTextarea","","rows","3"],[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),C(1,Wt,4,2,"ng-template",null,0,f)(3,rn,1,1,"ng-template",null,1,f),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[B,Z,Re,ye,ke,Me,ot,rt,xt,gt,mt,ct,Te,Ie,k,Ke,Xe,be,ve,he,Y,Ee,Se,Ce,N,V,Q,J,dt,L,A,at],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var on=["class","page"],an=t=>["/pages/recurring/recurring-expense/edit",t];function ln(t,s){if(t&1&&(r(0,"a",4),g(1,"i",6),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=u(4);m("routerLink",R(1,an,e.currentRecurringExpense().id))}}function pn(t,s){if(t&1){let e=I();r(0,"p-button",7),T("onClick",function(){E(e);let i=u(4);return v(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function sn(t,s){if(t&1&&(r(0,"div",3),b(1,ln,4,3,"a",4),b(2,pn,1,0,"p-button",5),n()),t&2){let e=u(3);l(),y(e.roleService.permissions().recurring.edit?1:-1),l(),y(e.roleService.permissions().recurring.delete?2:-1)}}function cn(t,s){if(t&1&&b(0,sn,3,2,"div",3),t&2){let e=u(2);y(e.currentRecurringExpense()?0:-1)}}function mn(t,s){if(t&1){let e=I();r(0,"p-panel",10)(1,"p-scroll-panel")(2,"div",8)(3,"div",11)(4,"div",12)(5,"div",11)(6,"div",13)(7,"div",14)(8,"div",15)(9,"label",16),a(10,"Tag"),n(),r(11,"input",17),me("ngModelChange",function(i){E(e);let c=u(3);return ce(c.currentRecurringExpense().outletName,i)||(c.currentRecurringExpense().outletName=i),v(i)}),n()()(),r(12,"div",14)(13,"div",15)(14,"label",16),a(15,"Supplier"),n(),g(16,"input",18),n()(),r(17,"div",14)(18,"div",15)(19,"label",16),a(20,"From"),n(),g(21,"input",19),S(22,"date"),n()(),r(23,"div",14)(24,"div",15)(25,"label",16),a(26,"To"),n(),g(27,"input",19),S(28,"date"),n()()(),g(29,"hr"),r(30,"div",13)(31,"div",14)(32,"div",15)(33,"label",16),a(34,"Amount"),n(),g(35,"input",19),S(36,"number"),n()(),r(37,"div",14)(38,"div",15)(39,"label",16),a(40,"Frequency"),n(),g(41,"input",19),n()(),r(42,"div",14)(43,"div",15)(44,"label",16),a(45,"Expense (Debit)"),n(),g(46,"input",19),n()(),r(47,"div",14)(48,"div",15)(49,"label",16),a(50,"Payment (Credit)"),n(),g(51,"input",19),n()(),r(52,"div",20)(53,"div",15)(54,"label",16),a(55,"Description"),n(),g(56,"textarea",21),n()()()()()()()()()}if(t&2){let e=u(3);l(11),se("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",z(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",z(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 un(t,s){if(t&1&&(r(0,"div",8)(1,"div",9),b(2,mn,57,17,"p-panel",10),n()()),t&2){let e=u(2);l(2),y(e.currentRecurringExpense()?2:-1)}}function dn(t,s){if(t&1&&(r(0,"app-main-panel",2),C(1,cn,1,1,"ng-template",null,0,f)(3,un,3,1,"ng-template",null,1,f),n()),t&2){let e=u();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var vt=(()=>{class t{constructor(){this.recurringExpenseService=d(j),this.route=d(ge),this.router=d(xe),this.currentRecurringExpense=U(null),this.roleService=d(_e)}ngOnInit(){this.route.paramMap.pipe(G(e=>e.get("id")),Ae("params"),Ue(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),w(e=>this.currentRecurringExpense.set(e)),Ae("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(w(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:on,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[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"],[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&&b(0,dn,5,3,"app-main-panel",2),o&2&&y(i.currentRecurringExpense()?0:-1)},dependencies:[B,Z,k,Re,ye,tt,he,Y,Qe,Q,J,N,V,L,A,Te,Ie,K,de],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ct=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:ht},{path:"create",component:qe},{path:"details/:id",component:vt},{path:"edit/:id",component:qe}]}];var St=(()=>{class t{constructor(){this.httpService=d(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=pe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var gn={filter:{Text:"",Frequency:0,PageNumber:1,PageSize:10},data:null},Oe=De(Fe(gn),we(t=>{let s=d(St);return{getAssetValue:ie(te(O(o=>s.getAssetValue(o).pipe(re({next:i=>{P(t,c=>_(x({},c),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{P(t,i=>_(x({},i),{filter:o}))}}}),Pe({onInit:t=>{t.getAssetValue(t.filter())}}));var xn=t=>["/pages/recurring/recurring-expense/details/",t];function fn(t,s){t&1&&g(0,"div",5)}function _n(t,s){t&1&&(r(0,"tr")(1,"th"),a(2,"Tags"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",7),a(8,"Price on Purchase"),n(),r(9,"th",7),a(10,"Accomulated Depreciation"),n(),r(11,"th",7),a(12,"Book Value"),n(),r(13,"th",7),a(14,"Frequency"),n()())}function hn(t,s){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",8),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",7),a(9),S(10,"number"),n(),r(11,"td",7),a(12),S(13,"number"),n(),r(14,"td",7),a(15),S(16,"number"),n(),r(17,"td",7),a(18),S(19,"number"),n()()),t&2){let e=s.$implicit;l(2),h(e.entityName),l(2),m("routerLink",R(16,xn,e.id)),l(),h(e.name),l(2),h(e.accountCode),l(2),h(F(10,8,e.priceOnPurchase)),l(3),D(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),D(" ",F(16,12,e.bookValue)," "),l(3),D(" ",F(19,14,e.depreciationPerYear)," ")}}function En(t,s){if(t&1&&(r(0,"p-panel")(1,"p-table",6),C(2,_n,15,0,"ng-template",null,2,f)(4,hn,20,18,"ng-template",null,3,f),n()()),t&2){let e=u(2);l(),m("value",e.store.data().data)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)}}function vn(t,s){if(t&1&&b(0,En,6,3,"p-panel"),t&2){let e=u();y(e.store.data()?0:-1)}}var bt=(()=>{class t{constructor(){this.store=d(Oe)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-asset-value"]],features:[ue([Oe])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],["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),C(1,fn,1,0,"ng-template",null,0,f)(3,vn,1,1,"ng-template",null,1,f),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[B,k,L,A,Ne,Ve,N,V,K],encapsulation:2})}}return t})();var fr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:Ct},{path:"asset-value",component:bt},{path:"post-to-journal",loadComponent:()=>import("./chunk-7TJ6TXHJ.js").then(t=>t.PostRecurringExpenseComponent)}];export{fr as RECURRING_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J}from"./chunk-3374MMIU.js";import{b as W}from"./chunk-
|
|
1
|
+
import{a as J}from"./chunk-3374MMIU.js";import{b as W}from"./chunk-WQ4FPUGZ.js";import{a as q,b as z}from"./chunk-BS66RAKW.js";import{a as H}from"./chunk-XKI7WLHE.js";import{a as I,b as O}from"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import"./chunk-2BKQ45PR.js";import"./chunk-EUBEE6D7.js";import{h as A}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as B,b as G}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as j,I as k,z as R}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{b as y,e as P,f as D,k as M,p as T,q as w,v as N,y as V}from"./chunk-JGVJQYWH.js";import{d as E}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import"./chunk-5KNGGA7C.js";import{Ab as p,Sb as c,Tb as i,Ub as t,V as x,Vb as f,Vc as l,ac as F,da as m,db as _,fc as b,gc as d,ka as C,la as h,ub as v,uc as a,zb as S}from"./chunk-ZIDIPNEH.js";import"./chunk-PRARYYF3.js";function K(e,u){if(e&1){let o=F();i(0,"p-button",4),b("onClick",function(){C(o);let n=d();return h(n.onSubmit())}),t()}}function L(e,u){e&1&&(i(0,"div",13)(1,"h3",14),a(2,"General"),t(),i(3,"span",15),a(4,"Enter your closing Fiscal Date"),t()())}function Q(e,u){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,L,5,0,"ng-template",null,2,l),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),a(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),a(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=d();_(7),c("formGroup",o.form)}}var xe=(()=>{class e extends H{constructor(){super(),this.closingEntriesService=m(J),this.dayjsService=m(W),this.fb=m(N),this.router=m(E)}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(x(()=>{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",""],["dateFormat","dd M yy","fluid","","formControlName","Period"],["cols","30","formControlName","Note","pTextarea","","rows","5"],[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,K,1,0,"ng-template",null,0,l)(3,Q,16,1,"ng-template",null,1,l),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[A,G,B,O,I,R,z,q,k,j,V,M,y,P,D,w,T],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{xe as ClosingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as K}from"./chunk-
|
|
1
|
+
import{a as y,b as K}from"./chunk-Q65FW2EM.js";import"./chunk-WQ4FPUGZ.js";import{m as j}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as R,b as D}from"./chunk-B7TARMUS.js";import"./chunk-WAKVBF4U.js";import{h as J}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as H,b as L}from"./chunk-45NYDNRM.js";import"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as N,I as G,J as q,K as z}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import"./chunk-JGVJQYWH.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import{a as V}from"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{o as E,t as I}from"./chunk-5KNGGA7C.js";import{Ab as $,Hc as F,Ic as T,Mb as C,Nb as h,R as M,Rc as p,Sb as c,Sc as s,T as k,Tb as o,Ub as n,V as O,Vb as u,Vc as b,ac as x,da as m,db as r,f as A,fc as v,gc as a,ka as g,la as _,ma as B,na as P,s as f,sc as S,ub as w}from"./chunk-ZIDIPNEH.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(e,d){if(e&1){let t=x();o(0,"p-button",6),v("onClick",function(){g(t);let l=a(2);return _(l.onFormat())}),n()}}function W(e,d){if(e&1){let t=x();o(0,"p-button",7),p(1,"async"),p(2,"async"),v("onClick",function(){g(t);let l=a(2);return _(l.onMigrateOutletAccount())}),n()}if(e&2){let t=a(2);c("disabled",s(1,2,t.countInBooks$)!==0)("pTooltip",s(2,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(e,d){if(e&1&&(o(0,"div",3),C(1,U,1,0,"p-button",4),C(2,W,3,6,"p-button",5),n()),e&2){let t=a();r(),h(t.roleService.permissions().migrate.delete?1:-1),r(),h(t.roleService.permissions().migrate.create?2:-1)}}function Y(e,d){if(e&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),p(4,"async"),B(),o(5,"svg",10),u(6,"path",11),n(),P(),u(7,"app-migration-cards",12),p(8,"async"),n()()()),e&2){let t=a();S(T(12,Q)),r(),S(T(13,Q)),r(2),c("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),r(4),c("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var ht=(()=>{class e{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new A(void 0),this.pageTitle="Outlet Account",this.roleService=m(j)}ngOnInit(){let t=this.refresh$.pipe(k(()=>this.migrateService.getOutletAccountCount()),O(i=>console.log("API response:",i)),M(1));this.countInPOS$=t.pipe(f(i=>Number(i.pos))),this.countInBooks$=t.pipe(f(i=>Number(i.books)))}onMigrateOutletAccount(){this.migrateService.migrateOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=w({type:e,selectors:[["app-outlet-account"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,l){i&1&&(o(0,"app-main-panel",2),$(1,X,3,2,"ng-template",null,0,b)(3,Y,9,14,"ng-template",null,1,b),n()),i&2&&c("pageTitle",l.pageTitle)},dependencies:[J,I,G,N,D,R,L,H,z,q,K,E],encapsulation:2})}}return e})();export{ht as OutletAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Me,b as Se}from"./chunk-5WP7GW6P.js";import{a as ve,b as be,c as Ce,d as xe,e as ye,f as Fe}from"./chunk-4MO47INH.js";import"./chunk-W6LNCRKG.js";import{a as ge,b as he}from"./chunk-BS66RAKW.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{m as H}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import"./chunk-4KOFBQEK.js";import{a as ie,b as ne}from"./chunk-JCGIG4OG.js";import"./chunk-KIYQBDPO.js";import"./chunk-2BKQ45PR.js";import{h as fe}from"./chunk-
|
|
1
|
+
import{a as Me,b as Se}from"./chunk-5WP7GW6P.js";import{a as ve,b as be,c as Ce,d as xe,e as ye,f as Fe}from"./chunk-4MO47INH.js";import"./chunk-W6LNCRKG.js";import{a as ge,b as he}from"./chunk-BS66RAKW.js";import{a as _e}from"./chunk-XKI7WLHE.js";import{m as H}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import"./chunk-4KOFBQEK.js";import{a as ie,b as ne}from"./chunk-JCGIG4OG.js";import"./chunk-KIYQBDPO.js";import"./chunk-2BKQ45PR.js";import{h as fe}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as me,b as ce}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as pe,I as se,J as de,K as ue,y as ae,z as le}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{b as J,c as K,e as Q,f as W,k as X,n as Y,o as Z,p as ee,q as te,v as oe,y as re}from"./chunk-JGVJQYWH.js";import{b as U,d as L}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as q,t as z}from"./chunk-5KNGGA7C.js";import{Ab as R,Da as D,Ic as x,Jc as y,Mb as h,Nb as _,Ob as S,Pb as O,Qb as v,Rb as b,Sb as s,T as E,Tb as i,Ub as n,V as M,Vb as f,Vc as G,ac as V,da as c,db as r,fc as B,fd as j,gc as d,ka as I,la as N,sc as C,tc as k,ub as P,uc as g,vc as T,wa as A,wc as $,zb as w}from"./chunk-ZIDIPNEH.js";import"./chunk-PRARYYF3.js";var Ee=()=>({height:"calc(100vh - 70px)"}),Ie=t=>({"ng-invalid ng-dirty":t}),ke=t=>({"ps-0":t}),Te=()=>({display:"flex"});function Ne(t,a){if(t&1){let e=V();i(0,"p-button",4),B("onClick",function(){I(e);let l=d(2);return N(l.onSubmit())}),n()}}function Ae(t,a){if(t&1&&h(0,Ne,1,0,"p-button",3),t&2){let e=d();_(e.roleService.permissions().user.edit||e.roleService.permissions().user.create?0:-1)}}function De(t,a){if(t&1&&(i(0,"div")(1,"span",14),g(2),n()()),t&2){let e=a.$implicit;r(2),T(e)}}function Pe(t,a){if(t&1&&(i(0,"div"),v(1,De,3,1,"div",null,O),n()),t&2){let e=d(2);r(),b(e.getErrors("name"))}}function we(t,a){if(t&1&&(i(0,"div",22)(1,"div",23),f(2,"p-checkbox",24),i(3,"p",25),g(4),n()()()),t&2){let e=a.$implicit,o=a.$index;s("formGroupName",o)("pTooltip",e.get("description").value),r(2),C(x(6,Te)),s("binary",!0),r(2),$(" ",e.get("name").value," ")}}function Re(t,a){if(t&1&&(i(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),g(4),n()(),f(5,"p-checkbox",19),n(),i(6,"div",20)(7,"div",21),v(8,we,5,7,"div",22,S),n()()()),t&2){let e=a.$implicit,o=a.$index,l=d(3);s("formGroupName",o),r(4),T(e.get("groupName").value),r(),C(x(5,Te)),s("binary",!0),r(3),b(l.getRolesArray(o).controls)}}function Oe(t,a){if(t&1&&(i(0,"div",11),v(1,Re,10,6,"div",15,S),n()),t&2){let e=d(2);r(),b(e.rolesFormArray.controls)}}function Ve(t,a){if(t&1&&(i(0,"p-panel")(1,"div",5),f(2,"app-user-tabs"),i(3,"form",6),f(4,"input",7),h(5,Pe,3,0,"div"),n(),i(6,"p-tabs",8)(7,"p-tablist")(8,"p-tab",8),g(9,"Permission"),n(),i(10,"p-tab",9),g(11,"Description"),n()(),i(12,"p-tabpanels",10)(13,"p-tabpanel",8)(14,"form",6),h(15,Oe,3,0,"div",11),n()(),i(16,"p-tabpanel",9)(17,"div",12),f(18,"textarea",13),n()()()()()()),t&2){let e=d();C(x(13,Ee)),r(3),s("formGroup",e.form),r(),s("fluid",!0)("ngClass",y(14,Ie,e.isInvalid("name"))),r(),_(e.isInvalid("name")?5:-1),r(3),k(y(16,ke,e.router.url.includes("forms"))),r(2),k(y(18,ke,e.router.url.includes("forms"))),r(4),s("formGroup",e.form),r(),_(e.rolesFormArray.length>0?15:-1),r(2),s("formGroup",e.form)}}var ft=(()=>{class t extends _e{constructor(){super(...arguments),this.service=c(Me),this.fb=c(oe),this.cdr=c(j),this.route=c(U),this.router=c(L),this.roleService=c(H),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[K.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(E(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(M(o=>{this.groupFormMeta.set(o),this.populateForm(o)})))).subscribe()}populateForm(e){this.form.patchValue({groupID:e.form.groupID,name:e.form.name,description:e.form.description});let o=this.rolesFormArray;o.clear(),e.options.roles.forEach(l=>{let m=this.fb.array(l.roles.map(p=>this.fb.group({id:this.fb.control(p.id),name:this.fb.control(p.name),checked:this.fb.control({value:e.form.rolesID.includes(p.id),disabled:!this.roleService.permissions().user.edit}),description:this.fb.control(p.description||"")}))),u=this.fb.group({groupName:this.fb.control(l.name),groupChecked:this.fb.control(!1),roles:m}),Ge=m.controls.every(p=>p.get("checked").value);u.get("groupChecked").setValue(Ge,{emitEvent:!1}),this.roleService.permissions().user.edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(p=>{m.controls.forEach(F=>{F.get("checked").setValue(p,{emitEvent:!1})})}),m.valueChanges.subscribe(()=>{let p=m.controls.every(F=>F.get("checked").value);u.get("groupChecked").setValue(p,{emitEvent:!1})}),o.push(u)}),this.cdr.detectChanges()}get rolesFormArray(){return this.form.get("roles")}getRolesArray(e){return this.rolesFormArray.at(e).get("roles")}getSelectedRoleIDs(){let e=[];return this.rolesFormArray.controls.forEach(o=>{o.get("roles").controls.forEach(m=>{m.get("checked").value&&e.push(m.get("id").value)})}),e}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e={groupID:this.form.get("groupID").value,name:this.form.get("name").value,rolesID:this.getSelectedRoleIDs(),description:this.form.controls.description.value};this.service.assignGroupRole(e).pipe(M(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(l){return(e||(e=D(t)))(l||t)}})()}static{this.\u0275cmp=P({type:t,selectors:[["app-group-form"]],features:[w],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit"],["label","Submit",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],["type","text","pInputText","","formControlName","name","placeholder","Group Name",3,"fluid","ngClass"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[1,"text-danger"],[1,"row","align-items-stretch",3,"formGroupName"],[1,"col-2","py-2","border-top","border-bottom","border-start","d-flex","justify-content-between",2,"background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],["size","small","formControlName","groupChecked",3,"binary"],[1,"col","p-0"],["formArrayName","roles",1,"roles-grid","h-100"],["tooltipPosition","top",1,"role-cell",3,"formGroupName","pTooltip"],[1,"py-2","d-flex","h-100","align-items-center","gap-2","px-2"],["size","small","formControlName","checked",3,"binary"],[1,"fs-2","text-dark","m-0"]],template:function(o,l){o&1&&(i(0,"app-main-panel",2),R(1,Ae,1,1,"ng-template",null,0,G)(3,Ve,19,20,"ng-template",null,1,G),n()),o&2&&s("overflowScroll",!0)},dependencies:[fe,ne,ie,re,X,J,Q,W,te,ee,Y,Z,z,q,le,ae,Fe,ve,ye,xe,be,Ce,he,ge,se,pe,Se,ce,me,ue,de],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-checkbox{display:flex!important}[_nghost-%COMP%] .p-tabs .p-tab{padding-left:0!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}.roles-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr)}.role-cell[_ngcontent-%COMP%]{border:1px solid #ddd;border-top:none;border-left:none;background:#fff}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(-n+4){border-top:1px solid #ddd}.roles-grid[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4n+1){border-left:1px solid #ddd}"],changeDetection:0})}}return t})();export{ft as GroupFormComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ri,b as ai,c as si,d as di,e as ci,f as pi}from"./chunk-OJMGF5CJ.js";import{a as ni,b as Ci,c as hi}from"./chunk-OP3K37O3.js";import{a as Ft,b as Vt}from"./chunk-SKZA3A5A.js";import{a as li}from"./chunk-CXJDV4ZO.js";import{a as $e}from"./chunk-BR3ARMX5.js";import{a as Ut}from"./chunk-B7TARMUS.js";import{b as Ue,c as Qe,d as Ot,e as Ht,f as At,g as ii,h as oi}from"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import"./chunk-GCUU37JB.js";import{a as Bt}from"./chunk-JCGIG4OG.js";import{c as je}from"./chunk-MQZKQQJ2.js";import{a as Nt}from"./chunk-KIYQBDPO.js";import{a as ei,b as ti}from"./chunk-WAKVBF4U.js";import{a as We}from"./chunk-2BKQ45PR.js";import{a as Ge}from"./chunk-EUBEE6D7.js";import{d as Xt,e as Zt,h as Yt}from"./chunk-VBAHUAJS.js";import"./chunk-OZY5YA4U.js";import{a as qt,b as jt}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import{a as Jt}from"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{A as Kt,F as Qt,H as Gt,I as Wt,K as $t,b as Pt,c as se,d as O,e as Rt,f as Ke,u as qe}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{Ba as Dt,C as wt,D as F,E as Be,Q as xt,Sa as xe,T as St,V as It,Xa as Se,Ya as Ae,ab as Lt,ca as Et,ha as kt,ia as Oe,la as ae,ma as E,na as we,oa as He,sa as Mt,ta as zt,ua as ge,wa as fe,x as vt,z as Ne}from"./chunk-JGVJQYWH.js";import{d as Ct}from"./chunk-5IZ2YCM4.js";import"./chunk-SQ3SQOQY.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as ue,k as Tt,l as X,m as Ve,n as me,t as Ce,x as ve}from"./chunk-5KNGGA7C.js";import{$ as it,$b as T,Ab as p,Ac as mt,Bc as gt,Da as ze,F as tt,Fa as nt,Hc as he,Ic as re,Jb as q,Jc as R,Kb as dt,Kc as J,Lb as ct,Lc as ft,Mb as De,Mc as bt,Nb as Le,Ob as Pe,Qb as Re,Rb as Fe,Rc as _t,Sb as a,Tb as c,Tc as yt,Ub as h,V as ke,Vb as I,Vc as S,Zb as j,_ as Me,_b as $,ac as P,ba as ot,bb as rt,bc as pt,da as D,db as s,e as Y,fc as k,gc as u,jc as ht,jd as v,ka as M,kc as ce,kd as Q,la as z,lc as g,m as et,ma as ee,mc as f,nb as H,pc as oe,qc as le,sa as x,sc as ne,ta as de,tc as b,ub as W,uc as _,vb as at,vc as A,wa as te,wb as st,wc as pe,yb as Te,za as lt,zb as ie,zc as ut}from"./chunk-ZIDIPNEH.js";import{a as U,b as ye,g as Ti}from"./chunk-PRARYYF3.js";var xi=["colgroup"],Si=["caption"],Ii=["header"],Ei=["body"],ki=["footer"],Mi=["summary"],zi=["emptymessage"],Di=["paginatorleft"],Li=["paginatorright"],Pi=["paginatordropdownitem"],Ri=["frozenheader"],Fi=["frozenbody"],Vi=["frozenfooter"],Ni=["frozencolgroup"],Bi=["loadingicon"],Oi=["reorderindicatorupicon"],Hi=["reorderindicatordownicon"],Ai=["sorticon"],Ki=["checkboxicon"],Ui=["headercheckboxicon"],Qi=["togglericon"],Gi=["paginatorfirstpagelinkicon"],Wi=["paginatorlastpagelinkicon"],qi=["paginatorpreviouspagelinkicon"],ji=["paginatornextpagelinkicon"],$i=["loader"],Ji=["resizeHelper"],Xi=["reorderIndicatorUp"],Zi=["reorderIndicatorDown"],Yi=["table"],eo=["scrollableView"],to=["scrollableFrozenView"],K=t=>({$implicit:t}),io=(t,r)=>({left:t,width:r}),oo=(t,r)=>[t,r],lo=t=>({width:t});function no(t,r){if(t&1&&I(0,"i"),t&2){let e=u(2);b(e.cn(e.cx("loadingIcon"),"pi-spin"+e.loadingIcon))}}function ro(t,r){if(t&1&&(ee(),I(0,"svg",13)),t&2){let e=u(3);b(e.cx("loadingIcon")),a("spin",!0)}}function ao(t,r){}function so(t,r){t&1&&p(0,ao,0,0,"ng-template")}function co(t,r){if(t&1&&(c(0,"span"),p(1,so,1,0,null,14),h()),t&2){let e=u(3);b(e.cx("loadingIcon")),s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function po(t,r){if(t&1&&(j(0),p(1,ro,1,3,"svg",12)(2,co,2,3,"span",10),$()),t&2){let e=u(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ho(t,r){if(t&1&&(c(0,"div",9),ct("p-overlay-mask-leave-active"),dt("p-overlay-mask-enter-active"),p(1,no,1,2,"i",10)(2,po,3,2,"ng-container",11),h()),t&2){let e=u();b(e.cx("mask")),a("pBind",e.ptm("mask")),s(),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&(c(0,"div",9),p(1,uo,1,0,"ng-container",14),h()),t&2){let e=u();b(e.cx("header")),a("pBind",e.ptm("header")),s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function go(t,r){t&1&&T(0)}function fo(t,r){if(t&1&&p(0,go,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function bo(t,r){t&1&&p(0,fo,1,1,"ng-template",16)}function _o(t,r){t&1&&T(0)}function yo(t,r){if(t&1&&p(0,_o,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function To(t,r){t&1&&p(0,yo,1,1,"ng-template",17)}function Co(t,r){t&1&&T(0)}function vo(t,r){if(t&1&&p(0,Co,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function wo(t,r){t&1&&p(0,vo,1,1,"ng-template",18)}function xo(t,r){t&1&&T(0)}function So(t,r){if(t&1&&p(0,xo,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Io(t,r){t&1&&p(0,So,1,1,"ng-template",19)}function Eo(t,r){if(t&1){let e=P();c(0,"p-paginator",15),k("onPageChange",function(i){M(e);let l=u();return z(l.onPageChange(i))}),p(1,bo,1,0,null,11)(2,To,1,0,null,11)(3,wo,1,0,null,11)(4,Io,1,0,null,11),h()}if(t&2){let e=u();a("pt",e.ptm("pcPaginator"))("rows",e.rows)("first",e.first)("totalRecords",e.totalRecords)("pageLinkSize",e.pageLinks)("styleClass",e.cx("pcPaginator"))("alwaysShow",e.alwaysShowPaginator)("rowsPerPageOptions",e.rowsPerPageOptions)("templateLeft",e.paginatorLeftTemplate??e._paginatorLeftTemplate)("templateRight",e.paginatorRightTemplate??e._paginatorRightTemplate)("appendTo",e.paginatorDropdownAppendTo)("currentPageReportTemplate",e.currentPageReportTemplate)("showFirstLastIcon",e.showFirstLastIcon)("dropdownItemTemplate",e.paginatorDropdownItemTemplate??e._paginatorDropdownItemTemplate)("showCurrentPageReport",e.showCurrentPageReport)("showJumpToPageDropdown",e.showJumpToPageDropdown)("showPageLinks",e.showPageLinks)("locale",e.paginatorLocale)("unstyled",e.unstyled()),s(),a("ngIf",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate),s(),a("ngIf",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function ko(t,r){t&1&&T(0)}function Mo(t,r){t&1&&T(0)}function zo(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&(c(0,"div",9)(1,"table",20,0),p(3,ko,1,0,"ng-container",21),c(4,"thead",22),p(5,Mo,1,0,"ng-container",21),h(),I(6,"tbody",23),c(7,"tfoot",22),p(8,zo,1,0,"ng-container",21),h()()()),t&2){let e=u();b(e.cx("wrapper")),a("pBind",e.ptm("wrapper")),s(),a("pBind",e.ptm("table"))("ngClass",e.tableStyleClass)("ngStyle",e.tableStyle),s(2),a("ngTemplateOutlet",e.colGroupTemplate||e._colGroupTemplate)("ngTemplateOutletContext",R(24,K,e.columns)),s(),b(e.cx("thead")),a("pBind",e.ptm("thead")),s(),a("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)("ngTemplateOutletContext",R(26,K,e.columns)),s(),b(e.cx("tbody")),a("pBind",e.ptm("tbody"))("unstyled",e.unstyled())("pTreeTableBody",e.columns)("pTreeTableBodyTemplate",e.bodyTemplate??e._bodyTemplate),s(),b(e.cx("tfoot")),a("pBind",e.ptm("tfoot")),s(),a("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)("ngTemplateOutletContext",R(28,K,e.columns))}}function Lo(t,r){if(t&1&&I(0,"div",26,2),t&2){let e=u(2);a("ngClass",J(7,oo,e.cx("scrollableView"),e.cx("frozenView")))("ttScrollableView",e.frozenColumns)("unstyled",e.unstyled())("frozen",!0)("ngStyle",R(10,lo,e.frozenWidth))("scrollHeight",e.scrollHeight)("pBind",e.ptm("scrollableView"))}}function Po(t,r){if(t&1&&(c(0,"div",9),p(1,Lo,2,12,"div",24),I(2,"div",25,1),h()),t&2){let e=u();b(e.cx("scrollableWrapper")),a("pBind",e.ptm("scrollableWrapper")),s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),b(e.cx("scrollableView")),a("pBind",e.ptm("scrollableView"))("ttScrollableView",e.columns)("unstyled",e.unstyled())("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",J(12,io,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function Ro(t,r){t&1&&T(0)}function Fo(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Vo(t,r){t&1&&p(0,Fo,1,1,"ng-template",16)}function No(t,r){t&1&&T(0)}function Bo(t,r){if(t&1&&p(0,No,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,Bo,1,1,"ng-template",17)}function Ho(t,r){t&1&&T(0)}function Ao(t,r){if(t&1&&p(0,Ho,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Ko(t,r){t&1&&p(0,Ao,1,1,"ng-template",18)}function Uo(t,r){t&1&&T(0)}function Qo(t,r){if(t&1&&p(0,Uo,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Go(t,r){t&1&&p(0,Qo,1,1,"ng-template",19)}function Wo(t,r){if(t&1){let e=P();c(0,"p-paginator",15),k("onPageChange",function(i){M(e);let l=u();return z(l.onPageChange(i))}),p(1,Vo,1,0,null,11)(2,Oo,1,0,null,11)(3,Ko,1,0,null,11)(4,Go,1,0,null,11),h()}if(t&2){let e=u();a("pt",e.ptm("pcPaginator"))("rows",e.rows)("first",e.first)("totalRecords",e.totalRecords)("pageLinkSize",e.pageLinks)("styleClass",e.cx("pcPaginator"))("alwaysShow",e.alwaysShowPaginator)("rowsPerPageOptions",e.rowsPerPageOptions)("templateLeft",e.paginatorLeftTemplate??e._paginatorLeftTemplate)("templateRight",e.paginatorRightTemplate??e._paginatorRightTemplate)("appendTo",e.paginatorDropdownAppendTo)("currentPageReportTemplate",e.currentPageReportTemplate)("showFirstLastIcon",e.showFirstLastIcon)("dropdownItemTemplate",e.paginatorDropdownItemTemplate??e._paginatorDropdownItemTemplate)("showCurrentPageReport",e.showCurrentPageReport)("showJumpToPageDropdown",e.showJumpToPageDropdown)("showPageLinks",e.showPageLinks)("locale",e.paginatorLocale)("unstyled",e.unstyled()),s(),a("ngIf",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate),s(),a("ngIf",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function qo(t,r){t&1&&T(0)}function jo(t,r){if(t&1&&(c(0,"div",9),p(1,qo,1,0,"ng-container",14),h()),t&2){let e=u();b(e.cx("footer")),a("pBind",e.ptm("footer")),s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function $o(t,r){if(t&1&&I(0,"div",9,3),t&2){let e=u();b(e.cx("columnResizerHelper")),le("display","none"),a("pBind",e.ptm("columnResizerHelper"))}}function Jo(t,r){t&1&&(ee(),I(0,"svg",28))}function Xo(t,r){}function Zo(t,r){t&1&&p(0,Xo,0,0,"ng-template")}function Yo(t,r){if(t&1&&(c(0,"span",9,4),p(2,Jo,1,0,"svg",27)(3,Zo,1,0,null,14),h()),t&2){let e=u();b(e.cx("reorderIndicatorUp")),le("display","none"),a("pBind",e.ptm("reorderIndicatorUp")),s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function el(t,r){t&1&&(ee(),I(0,"svg",30))}function tl(t,r){}function il(t,r){t&1&&p(0,tl,0,0,"ng-template")}function ol(t,r){if(t&1&&(c(0,"span",9,5),p(2,el,1,0,"svg",29)(3,il,1,0,null,14),h()),t&2){let e=u();b(e.cx("reorderIndicatorDown")),le("display","none"),a("pBind",e.ptm("reorderIndicatorDown")),s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var ll=["pTreeTableBody",""],nl=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),rl=(t,r)=>({$implicit:t,frozen:r});function al(t,r){t&1&&T(0)}function sl(t,r){if(t&1&&(j(0),p(1,al,1,0,"ng-container",2),$()),t&2){let e=u().$implicit,o=u();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",bt(2,nl,e,e.node,e.node.data,o.columns))}}function dl(t,r){if(t&1&&p(0,sl,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function cl(t,r){t&1&&T(0)}function pl(t,r){if(t&1&&(j(0),p(1,cl,1,0,"ng-container",2),$()),t&2){let e=u();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",J(2,rl,e.columns,e.frozen))}}var hl=["scrollHeader"],ul=["scrollHeaderBox"],ml=["scrollBody"],gl=["scrollTable"],fl=["loadingTable"],bl=["scrollFooter"],_l=["scrollFooterBox"],yl=["scrollableAligner"],Tl=["scroller"],Cl=["ttScrollableView",""],vl=t=>({height:t}),ui=(t,r)=>({$implicit:t,options:r}),wl=t=>({options:t}),xl=(t,r)=>({"max-height":t,"overflow-y":r}),Sl=()=>({});function Il(t,r){t&1&&T(0)}function El(t,r){t&1&&T(0)}function kl(t,r){t&1&&T(0)}function Ml(t,r){if(t&1&&p(0,kl,1,0,"ng-container",13),t&2){let e=r.$implicit,o=r.options;u(2);let i=oe(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",J(2,ui,e,o))}}function zl(t,r){t&1&&T(0)}function Dl(t,r){if(t&1&&p(0,zl,1,0,"ng-container",13),t&2){let e=r.options,o=u(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",R(2,wl,e))}}function Ll(t,r){t&1&&(j(0),p(1,Dl,1,4,"ng-template",null,5,S),$())}function Pl(t,r){if(t&1){let e=P();c(0,"p-scroller",18,3),k("onLazyLoad",function(i){M(e);let l=u();return z(l.tt.onLazyItemLoad(i))}),p(2,Ml,1,5,"ng-template",null,4,S)(4,Ll,3,0,"ng-container",16),h()}if(t&2){let e=u();ne(R(10,vl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("styleClass",e.cx("scrollableBody"))("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions)("pt",e.ptm("virtualScroller")),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function Rl(t,r){t&1&&T(0)}function Fl(t,r){if(t&1&&(j(0),c(1,"div",12,6),p(3,Rl,1,0,"ng-container",13),h(),$()),t&2){let e=u(),o=oe(11);s(),b(e.cx("scrollableBody")),a("pBind",e.ptm("scrollableBody"))("ngStyle",J(6,xl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",J(10,ui,e.serializedValue,re(9,Sl)))}}function Vl(t,r){t&1&&T(0)}function Nl(t,r){t&1&&I(0,"div",null,8),t&2&&le("background-color","transparent")}function Bl(t,r){if(t&1&&(c(0,"table",19,7),p(2,Vl,1,0,"ng-container",13),I(3,"tbody",20),h(),p(4,Nl,2,2,"div",21)),t&2){let e=r.$implicit,o=r.options,i=u();ne(o.contentStyle),b(i.tt.tableStyleClass),a("pBind",i.ptm("table"))("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",R(19,K,i.columns)),s(),b(i.cx("tbody")),a("pBind",i.ptm("tbody"))("pBind",i.ptm("tbody"))("pTreeTableBody",i.columns)("unstyled",i.unstyled())("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Ol(t,r){t&1&&T(0)}function Hl(t,r){t&1&&T(0)}function Al(t,r){if(t&1&&(c(0,"div",11,9)(2,"div",11,10)(4,"table",22),p(5,Ol,1,0,"ng-container",13),c(6,"tfoot",14),p(7,Hl,1,0,"ng-container",13),h()()()()),t&2){let e=u();b(e.cx("scrollableFooter")),a("pBind",e.ptm("scrollableFooter")),s(2),b(e.cx("scrollableFooterBox")),a("pBind",e.ptm("scrollableFooterBox")),s(2),b(e.cx("scrollableFooterTable")),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle)("pBind",e.ptm("scrollableFooterTable")),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",R(18,K,e.columns)),s(),b(e.cx("tfoot")),a("pBind",e.ptm("tfoot")),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",R(20,K,e.columns))}}function Kl(t,r){if(t&1&&(ee(),I(0,"svg",5)),t&2){let e=u(2);a("pBind",e.ptm("nodetoggleicon")),q("aria-hidden",!0)}}function Ul(t,r){if(t&1&&(ee(),I(0,"svg",6)),t&2){let e=u(2);a("pBind",e.ptm("nodetoggleicon")),q("aria-hidden",!0)}}function Ql(t,r){if(t&1&&(j(0),p(1,Kl,1,2,"svg",3)(2,Ul,1,2,"svg",4),$()),t&2){let e=u();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Gl(t,r){}function Wl(t,r){t&1&&p(0,Gl,0,0,"ng-template")}var ql=`
|
|
1
|
+
import{a as ri,b as ai,c as si,d as di,e as ci,f as pi}from"./chunk-OJMGF5CJ.js";import{a as ni,b as Ci,c as hi}from"./chunk-OP3K37O3.js";import{a as Ft,b as Vt}from"./chunk-SKZA3A5A.js";import{a as li}from"./chunk-CXJDV4ZO.js";import{a as $e}from"./chunk-BR3ARMX5.js";import{a as Ut}from"./chunk-B7TARMUS.js";import{b as Ue,c as Qe,d as Ot,e as Ht,f as At,g as ii,h as oi}from"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import"./chunk-GCUU37JB.js";import{a as Bt}from"./chunk-JCGIG4OG.js";import{c as je}from"./chunk-MQZKQQJ2.js";import{a as Nt}from"./chunk-KIYQBDPO.js";import{a as ei,b as ti}from"./chunk-WAKVBF4U.js";import{a as We}from"./chunk-2BKQ45PR.js";import{a as Ge}from"./chunk-EUBEE6D7.js";import{d as Xt,e as Zt,h as Yt}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as qt,b as jt}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import{a as Jt}from"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{A as Kt,F as Qt,H as Gt,I as Wt,K as $t,b as Pt,c as se,d as O,e as Rt,f as Ke,u as qe}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{Ba as Dt,C as wt,D as F,E as Be,Q as xt,Sa as xe,T as St,V as It,Xa as Se,Ya as Ae,ab as Lt,ca as Et,ha as kt,ia as Oe,la as ae,ma as E,na as we,oa as He,sa as Mt,ta as zt,ua as ge,wa as fe,x as vt,z as Ne}from"./chunk-JGVJQYWH.js";import{d as Ct}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as ue,k as Tt,l as X,m as Ve,n as me,t as Ce,x as ve}from"./chunk-5KNGGA7C.js";import{$ as it,$b as T,Ab as p,Ac as mt,Bc as gt,Da as ze,F as tt,Fa as nt,Hc as he,Ic as re,Jb as q,Jc as R,Kb as dt,Kc as J,Lb as ct,Lc as ft,Mb as De,Mc as bt,Nb as Le,Ob as Pe,Qb as Re,Rb as Fe,Rc as _t,Sb as a,Tb as c,Tc as yt,Ub as h,V as ke,Vb as I,Vc as S,Zb as j,_ as Me,_b as $,ac as P,ba as ot,bb as rt,bc as pt,da as D,db as s,e as Y,fc as k,gc as u,jc as ht,jd as v,ka as M,kc as ce,kd as Q,la as z,lc as g,m as et,ma as ee,mc as f,nb as H,pc as oe,qc as le,sa as x,sc as ne,ta as de,tc as b,ub as W,uc as _,vb as at,vc as A,wa as te,wb as st,wc as pe,yb as Te,za as lt,zb as ie,zc as ut}from"./chunk-ZIDIPNEH.js";import{a as U,b as ye,g as Ti}from"./chunk-PRARYYF3.js";var xi=["colgroup"],Si=["caption"],Ii=["header"],Ei=["body"],ki=["footer"],Mi=["summary"],zi=["emptymessage"],Di=["paginatorleft"],Li=["paginatorright"],Pi=["paginatordropdownitem"],Ri=["frozenheader"],Fi=["frozenbody"],Vi=["frozenfooter"],Ni=["frozencolgroup"],Bi=["loadingicon"],Oi=["reorderindicatorupicon"],Hi=["reorderindicatordownicon"],Ai=["sorticon"],Ki=["checkboxicon"],Ui=["headercheckboxicon"],Qi=["togglericon"],Gi=["paginatorfirstpagelinkicon"],Wi=["paginatorlastpagelinkicon"],qi=["paginatorpreviouspagelinkicon"],ji=["paginatornextpagelinkicon"],$i=["loader"],Ji=["resizeHelper"],Xi=["reorderIndicatorUp"],Zi=["reorderIndicatorDown"],Yi=["table"],eo=["scrollableView"],to=["scrollableFrozenView"],K=t=>({$implicit:t}),io=(t,r)=>({left:t,width:r}),oo=(t,r)=>[t,r],lo=t=>({width:t});function no(t,r){if(t&1&&I(0,"i"),t&2){let e=u(2);b(e.cn(e.cx("loadingIcon"),"pi-spin"+e.loadingIcon))}}function ro(t,r){if(t&1&&(ee(),I(0,"svg",13)),t&2){let e=u(3);b(e.cx("loadingIcon")),a("spin",!0)}}function ao(t,r){}function so(t,r){t&1&&p(0,ao,0,0,"ng-template")}function co(t,r){if(t&1&&(c(0,"span"),p(1,so,1,0,null,14),h()),t&2){let e=u(3);b(e.cx("loadingIcon")),s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function po(t,r){if(t&1&&(j(0),p(1,ro,1,3,"svg",12)(2,co,2,3,"span",10),$()),t&2){let e=u(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ho(t,r){if(t&1&&(c(0,"div",9),ct("p-overlay-mask-leave-active"),dt("p-overlay-mask-enter-active"),p(1,no,1,2,"i",10)(2,po,3,2,"ng-container",11),h()),t&2){let e=u();b(e.cx("mask")),a("pBind",e.ptm("mask")),s(),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&(c(0,"div",9),p(1,uo,1,0,"ng-container",14),h()),t&2){let e=u();b(e.cx("header")),a("pBind",e.ptm("header")),s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function go(t,r){t&1&&T(0)}function fo(t,r){if(t&1&&p(0,go,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function bo(t,r){t&1&&p(0,fo,1,1,"ng-template",16)}function _o(t,r){t&1&&T(0)}function yo(t,r){if(t&1&&p(0,_o,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function To(t,r){t&1&&p(0,yo,1,1,"ng-template",17)}function Co(t,r){t&1&&T(0)}function vo(t,r){if(t&1&&p(0,Co,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function wo(t,r){t&1&&p(0,vo,1,1,"ng-template",18)}function xo(t,r){t&1&&T(0)}function So(t,r){if(t&1&&p(0,xo,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Io(t,r){t&1&&p(0,So,1,1,"ng-template",19)}function Eo(t,r){if(t&1){let e=P();c(0,"p-paginator",15),k("onPageChange",function(i){M(e);let l=u();return z(l.onPageChange(i))}),p(1,bo,1,0,null,11)(2,To,1,0,null,11)(3,wo,1,0,null,11)(4,Io,1,0,null,11),h()}if(t&2){let e=u();a("pt",e.ptm("pcPaginator"))("rows",e.rows)("first",e.first)("totalRecords",e.totalRecords)("pageLinkSize",e.pageLinks)("styleClass",e.cx("pcPaginator"))("alwaysShow",e.alwaysShowPaginator)("rowsPerPageOptions",e.rowsPerPageOptions)("templateLeft",e.paginatorLeftTemplate??e._paginatorLeftTemplate)("templateRight",e.paginatorRightTemplate??e._paginatorRightTemplate)("appendTo",e.paginatorDropdownAppendTo)("currentPageReportTemplate",e.currentPageReportTemplate)("showFirstLastIcon",e.showFirstLastIcon)("dropdownItemTemplate",e.paginatorDropdownItemTemplate??e._paginatorDropdownItemTemplate)("showCurrentPageReport",e.showCurrentPageReport)("showJumpToPageDropdown",e.showJumpToPageDropdown)("showPageLinks",e.showPageLinks)("locale",e.paginatorLocale)("unstyled",e.unstyled()),s(),a("ngIf",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate),s(),a("ngIf",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function ko(t,r){t&1&&T(0)}function Mo(t,r){t&1&&T(0)}function zo(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&(c(0,"div",9)(1,"table",20,0),p(3,ko,1,0,"ng-container",21),c(4,"thead",22),p(5,Mo,1,0,"ng-container",21),h(),I(6,"tbody",23),c(7,"tfoot",22),p(8,zo,1,0,"ng-container",21),h()()()),t&2){let e=u();b(e.cx("wrapper")),a("pBind",e.ptm("wrapper")),s(),a("pBind",e.ptm("table"))("ngClass",e.tableStyleClass)("ngStyle",e.tableStyle),s(2),a("ngTemplateOutlet",e.colGroupTemplate||e._colGroupTemplate)("ngTemplateOutletContext",R(24,K,e.columns)),s(),b(e.cx("thead")),a("pBind",e.ptm("thead")),s(),a("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)("ngTemplateOutletContext",R(26,K,e.columns)),s(),b(e.cx("tbody")),a("pBind",e.ptm("tbody"))("unstyled",e.unstyled())("pTreeTableBody",e.columns)("pTreeTableBodyTemplate",e.bodyTemplate??e._bodyTemplate),s(),b(e.cx("tfoot")),a("pBind",e.ptm("tfoot")),s(),a("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)("ngTemplateOutletContext",R(28,K,e.columns))}}function Lo(t,r){if(t&1&&I(0,"div",26,2),t&2){let e=u(2);a("ngClass",J(7,oo,e.cx("scrollableView"),e.cx("frozenView")))("ttScrollableView",e.frozenColumns)("unstyled",e.unstyled())("frozen",!0)("ngStyle",R(10,lo,e.frozenWidth))("scrollHeight",e.scrollHeight)("pBind",e.ptm("scrollableView"))}}function Po(t,r){if(t&1&&(c(0,"div",9),p(1,Lo,2,12,"div",24),I(2,"div",25,1),h()),t&2){let e=u();b(e.cx("scrollableWrapper")),a("pBind",e.ptm("scrollableWrapper")),s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),b(e.cx("scrollableView")),a("pBind",e.ptm("scrollableView"))("ttScrollableView",e.columns)("unstyled",e.unstyled())("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",J(12,io,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function Ro(t,r){t&1&&T(0)}function Fo(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Vo(t,r){t&1&&p(0,Fo,1,1,"ng-template",16)}function No(t,r){t&1&&T(0)}function Bo(t,r){if(t&1&&p(0,No,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,Bo,1,1,"ng-template",17)}function Ho(t,r){t&1&&T(0)}function Ao(t,r){if(t&1&&p(0,Ho,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Ko(t,r){t&1&&p(0,Ao,1,1,"ng-template",18)}function Uo(t,r){t&1&&T(0)}function Qo(t,r){if(t&1&&p(0,Uo,1,0,"ng-container",14),t&2){let e=u(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Go(t,r){t&1&&p(0,Qo,1,1,"ng-template",19)}function Wo(t,r){if(t&1){let e=P();c(0,"p-paginator",15),k("onPageChange",function(i){M(e);let l=u();return z(l.onPageChange(i))}),p(1,Vo,1,0,null,11)(2,Oo,1,0,null,11)(3,Ko,1,0,null,11)(4,Go,1,0,null,11),h()}if(t&2){let e=u();a("pt",e.ptm("pcPaginator"))("rows",e.rows)("first",e.first)("totalRecords",e.totalRecords)("pageLinkSize",e.pageLinks)("styleClass",e.cx("pcPaginator"))("alwaysShow",e.alwaysShowPaginator)("rowsPerPageOptions",e.rowsPerPageOptions)("templateLeft",e.paginatorLeftTemplate??e._paginatorLeftTemplate)("templateRight",e.paginatorRightTemplate??e._paginatorRightTemplate)("appendTo",e.paginatorDropdownAppendTo)("currentPageReportTemplate",e.currentPageReportTemplate)("showFirstLastIcon",e.showFirstLastIcon)("dropdownItemTemplate",e.paginatorDropdownItemTemplate??e._paginatorDropdownItemTemplate)("showCurrentPageReport",e.showCurrentPageReport)("showJumpToPageDropdown",e.showJumpToPageDropdown)("showPageLinks",e.showPageLinks)("locale",e.paginatorLocale)("unstyled",e.unstyled()),s(),a("ngIf",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate),s(),a("ngIf",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function qo(t,r){t&1&&T(0)}function jo(t,r){if(t&1&&(c(0,"div",9),p(1,qo,1,0,"ng-container",14),h()),t&2){let e=u();b(e.cx("footer")),a("pBind",e.ptm("footer")),s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function $o(t,r){if(t&1&&I(0,"div",9,3),t&2){let e=u();b(e.cx("columnResizerHelper")),le("display","none"),a("pBind",e.ptm("columnResizerHelper"))}}function Jo(t,r){t&1&&(ee(),I(0,"svg",28))}function Xo(t,r){}function Zo(t,r){t&1&&p(0,Xo,0,0,"ng-template")}function Yo(t,r){if(t&1&&(c(0,"span",9,4),p(2,Jo,1,0,"svg",27)(3,Zo,1,0,null,14),h()),t&2){let e=u();b(e.cx("reorderIndicatorUp")),le("display","none"),a("pBind",e.ptm("reorderIndicatorUp")),s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function el(t,r){t&1&&(ee(),I(0,"svg",30))}function tl(t,r){}function il(t,r){t&1&&p(0,tl,0,0,"ng-template")}function ol(t,r){if(t&1&&(c(0,"span",9,5),p(2,el,1,0,"svg",29)(3,il,1,0,null,14),h()),t&2){let e=u();b(e.cx("reorderIndicatorDown")),le("display","none"),a("pBind",e.ptm("reorderIndicatorDown")),s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var ll=["pTreeTableBody",""],nl=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),rl=(t,r)=>({$implicit:t,frozen:r});function al(t,r){t&1&&T(0)}function sl(t,r){if(t&1&&(j(0),p(1,al,1,0,"ng-container",2),$()),t&2){let e=u().$implicit,o=u();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",bt(2,nl,e,e.node,e.node.data,o.columns))}}function dl(t,r){if(t&1&&p(0,sl,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function cl(t,r){t&1&&T(0)}function pl(t,r){if(t&1&&(j(0),p(1,cl,1,0,"ng-container",2),$()),t&2){let e=u();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",J(2,rl,e.columns,e.frozen))}}var hl=["scrollHeader"],ul=["scrollHeaderBox"],ml=["scrollBody"],gl=["scrollTable"],fl=["loadingTable"],bl=["scrollFooter"],_l=["scrollFooterBox"],yl=["scrollableAligner"],Tl=["scroller"],Cl=["ttScrollableView",""],vl=t=>({height:t}),ui=(t,r)=>({$implicit:t,options:r}),wl=t=>({options:t}),xl=(t,r)=>({"max-height":t,"overflow-y":r}),Sl=()=>({});function Il(t,r){t&1&&T(0)}function El(t,r){t&1&&T(0)}function kl(t,r){t&1&&T(0)}function Ml(t,r){if(t&1&&p(0,kl,1,0,"ng-container",13),t&2){let e=r.$implicit,o=r.options;u(2);let i=oe(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",J(2,ui,e,o))}}function zl(t,r){t&1&&T(0)}function Dl(t,r){if(t&1&&p(0,zl,1,0,"ng-container",13),t&2){let e=r.options,o=u(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",R(2,wl,e))}}function Ll(t,r){t&1&&(j(0),p(1,Dl,1,4,"ng-template",null,5,S),$())}function Pl(t,r){if(t&1){let e=P();c(0,"p-scroller",18,3),k("onLazyLoad",function(i){M(e);let l=u();return z(l.tt.onLazyItemLoad(i))}),p(2,Ml,1,5,"ng-template",null,4,S)(4,Ll,3,0,"ng-container",16),h()}if(t&2){let e=u();ne(R(10,vl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("styleClass",e.cx("scrollableBody"))("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions)("pt",e.ptm("virtualScroller")),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function Rl(t,r){t&1&&T(0)}function Fl(t,r){if(t&1&&(j(0),c(1,"div",12,6),p(3,Rl,1,0,"ng-container",13),h(),$()),t&2){let e=u(),o=oe(11);s(),b(e.cx("scrollableBody")),a("pBind",e.ptm("scrollableBody"))("ngStyle",J(6,xl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",J(10,ui,e.serializedValue,re(9,Sl)))}}function Vl(t,r){t&1&&T(0)}function Nl(t,r){t&1&&I(0,"div",null,8),t&2&&le("background-color","transparent")}function Bl(t,r){if(t&1&&(c(0,"table",19,7),p(2,Vl,1,0,"ng-container",13),I(3,"tbody",20),h(),p(4,Nl,2,2,"div",21)),t&2){let e=r.$implicit,o=r.options,i=u();ne(o.contentStyle),b(i.tt.tableStyleClass),a("pBind",i.ptm("table"))("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",R(19,K,i.columns)),s(),b(i.cx("tbody")),a("pBind",i.ptm("tbody"))("pBind",i.ptm("tbody"))("pTreeTableBody",i.columns)("unstyled",i.unstyled())("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Ol(t,r){t&1&&T(0)}function Hl(t,r){t&1&&T(0)}function Al(t,r){if(t&1&&(c(0,"div",11,9)(2,"div",11,10)(4,"table",22),p(5,Ol,1,0,"ng-container",13),c(6,"tfoot",14),p(7,Hl,1,0,"ng-container",13),h()()()()),t&2){let e=u();b(e.cx("scrollableFooter")),a("pBind",e.ptm("scrollableFooter")),s(2),b(e.cx("scrollableFooterBox")),a("pBind",e.ptm("scrollableFooterBox")),s(2),b(e.cx("scrollableFooterTable")),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle)("pBind",e.ptm("scrollableFooterTable")),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",R(18,K,e.columns)),s(),b(e.cx("tfoot")),a("pBind",e.ptm("tfoot")),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",R(20,K,e.columns))}}function Kl(t,r){if(t&1&&(ee(),I(0,"svg",5)),t&2){let e=u(2);a("pBind",e.ptm("nodetoggleicon")),q("aria-hidden",!0)}}function Ul(t,r){if(t&1&&(ee(),I(0,"svg",6)),t&2){let e=u(2);a("pBind",e.ptm("nodetoggleicon")),q("aria-hidden",!0)}}function Ql(t,r){if(t&1&&(j(0),p(1,Kl,1,2,"svg",3)(2,Ul,1,2,"svg",4),$()),t&2){let e=u();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Gl(t,r){}function Wl(t,r){t&1&&p(0,Gl,0,0,"ng-template")}var ql=`
|
|
2
2
|
/* For PrimeNG */
|
|
3
3
|
.p-treetable {
|
|
4
4
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-PRARYYF3.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-
|
|
1
|
+
import"./chunk-PRARYYF3.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-R2IYAZSE.js").then(o=>o.UserPageComponent)},{path:"groups",loadComponent:()=>import("./chunk-5RGY4F7I.js").then(o=>o.GroupPageComponent)},{path:"groups/forms",loadComponent:()=>import("./chunk-4UKHYZF2.js").then(o=>o.GroupFormComponent)}]}];export{t as USERS_ROUTES};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ce,b as At}from"./chunk-5WP7GW6P.js";import{f as Kt}from"./chunk-4MO47INH.js";import"./chunk-W6LNCRKG.js";import{b as Rt}from"./chunk-YHLRDTIS.js";import{m as Ue}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as we,b as Ie}from"./chunk-4TVWOK6B.js";import{b as Pt,g as Gt,h as Dt,i as Bt}from"./chunk-K2XFBG4B.js";import"./chunk-DBTEBZLE.js";import"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import{a as ft}from"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import{a as Ft,b as Lt}from"./chunk-GCUU37JB.js";import"./chunk-JCGIG4OG.js";import"./chunk-MQZKQQJ2.js";import"./chunk-KIYQBDPO.js";import"./chunk-2BKQ45PR.js";import{a as gt}from"./chunk-EUBEE6D7.js";import{h as Et}from"./chunk-
|
|
1
|
+
import{a as ce,b as At}from"./chunk-5WP7GW6P.js";import{f as Kt}from"./chunk-4MO47INH.js";import"./chunk-W6LNCRKG.js";import{b as Rt}from"./chunk-YHLRDTIS.js";import{m as Ue}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{a as we,b as Ie}from"./chunk-4TVWOK6B.js";import{b as Pt,g as Gt,h as Dt,i as Bt}from"./chunk-K2XFBG4B.js";import"./chunk-DBTEBZLE.js";import"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import{a as ft}from"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import{a as Ft,b as Lt}from"./chunk-GCUU37JB.js";import"./chunk-JCGIG4OG.js";import"./chunk-MQZKQQJ2.js";import"./chunk-KIYQBDPO.js";import"./chunk-2BKQ45PR.js";import{a as gt}from"./chunk-EUBEE6D7.js";import{h as Et}from"./chunk-KY4EBOEB.js";import{a as _t}from"./chunk-OZY5YA4U.js";import{a as xt,b as wt}from"./chunk-45NYDNRM.js";import{a as mt}from"./chunk-C4H5ZZHM.js";import{b as A,c as It,d as St,e as Tt,f as Vt,g as kt,h as Mt}from"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{A as yt,C as vt,H as Ot,I as Ct,a as rt,b as xe,c as ht,d as $,x as bt}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{C as O,D as F,E as Oe,H as Ce,O as tt,Ua as ct,Xa as pt,Ya as W,Z as nt,Za as dt,a as Qe,ab as ut,da as it,e as We,f as je,i as ve,ia as ot,m as Xe,ma as at,na as re,q as Je,ta as st,v as Ye,wa as lt,x as Ze,y as et,z as le}from"./chunk-JGVJQYWH.js";import{d as ze,e as qe}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{k as Ne,l as _e,m as $e,n as be,t as ye}from"./chunk-5KNGGA7C.js";import{$ as Ee,$b as ee,Ab as f,Ac as oe,Bc as ae,Da as Pe,Hc as Q,Ic as He,Jb as D,Jc as se,Kc as fe,Mb as q,Nb as U,Sb as l,T as ue,Tb as u,Ub as d,V as Y,Vb as V,Vc as S,Z as ke,Zb as B,Zc as M,_ as Me,_b as R,ac as k,ad as N,ba as Fe,c as de,da as v,db as c,fc as x,gc as r,jc as Be,jd as E,ka as h,kc as Re,kd as ge,la as m,lc as w,ma as Z,mc as I,nb as he,pc as te,s as Ve,sa as C,sc as Ke,tc as y,ub as z,uc as b,vb as Ge,vc as K,wa as P,wc as ne,yb as De,yc as Ae,za as Le,zb as me,zc as ie}from"./chunk-ZIDIPNEH.js";import{a as g,b as _}from"./chunk-PRARYYF3.js";var zt={data:[],count:0,meta:{filter:{pagination:1,pageSize:10,rolesID:null,text:""},options:{roles:[]}},filter:{pagination:1,pageSize:10,rolesID:null,text:""}},Se=It(kt(zt),Mt("GroupStore"),St(t=>({first:M(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:M(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:M(()=>t.data().some(s=>s.checked)),checkedData:M(()=>t.data().filter(s=>s.checked).map(s=>s.id))})),Vt(t=>{let s=v(ce),e={setFilter(n){A(t,i=>_(g({},i),{filter:n}))},onRowSelect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!0}):a);return _(g({},i),{data:o})})},onRowUnselect(n){A(t,i=>{let o=i.data.map(a=>a.id===n.id?_(g({},a),{checked:!1}):a);return _(g({},i),{data:o})})},onHeaderCheckboxToggle(n){A(t,i=>{let o=i.data.map(a=>_(g({},a),{checked:n}));return _(g({},i),{data:o})})},getGroupList:we(de(ue(n=>s.getGroupList(n).pipe(Ie(i=>{A(t,o=>_(g({},o),{data:i.data,count:i.count}))},i=>{console.error("Error fetching group list:",i)}))))),getGroupLoader:we(de(ue(()=>s.getGroupLoader().pipe(Ie({next:n=>{let i=n.options.roles.map(o=>_(g({},o),{id:Rt()}));A(t,o=>_(g({},o),{meta:_(g({},n),{options:_(g({},n.options),{roles:i})}),filter:n.filter})),e.getGroupList(t.filter)},error:n=>{console.error("Error fetching group loader:",n)}})))))};return e}),Tt(t=>({onInit:()=>{t.getGroupLoader()}})));var Ht=`
|
|
2
2
|
.p-cascadeselect {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-KR6DPLHN.js";import"./chunk-OEFBXMXZ.js";import"./chunk-HTDATC3L.js";import"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import"./chunk-UURD2F4Q.js";import"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import"./chunk-5KNGGA7C.js";import"./chunk-ZIDIPNEH.js";import"./chunk-PRARYYF3.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-KONPP7HM.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as Oe,b as je,c as Je,d as ze}from"./chunk-RR2QREJI.js";import{a as Ue,b as He}from"./chunk-W6LNCRKG.js";import{a as Ge}from"./chunk-2U3KEP66.js";import{a as S}from"./chunk-6WHGKHCN.js";import{b as Ne}from"./chunk-
|
|
1
|
+
import{a as Oe,b as je,c as Je,d as ze}from"./chunk-RR2QREJI.js";import{a as Ue,b as He}from"./chunk-W6LNCRKG.js";import{a as Ge}from"./chunk-2U3KEP66.js";import{a as S}from"./chunk-6WHGKHCN.js";import{b as Ne}from"./chunk-WQ4FPUGZ.js";import"./chunk-534L4NXK.js";import{m as z}from"./chunk-3NCKB3ET.js";import"./chunk-HTDATC3L.js";import{b as Pe,g as Ve,h as Be,i as X}from"./chunk-K2XFBG4B.js";import"./chunk-DBTEBZLE.js";import{a as ke,b as Ie}from"./chunk-ZO46YHUY.js";import"./chunk-MY6ZWYSL.js";import"./chunk-4KOFBQEK.js";import{a as Re}from"./chunk-BR3ARMX5.js";import{a as De,b as Ee}from"./chunk-B7TARMUS.js";import"./chunk-KMQJC7EK.js";import"./chunk-KPI4WLJD.js";import"./chunk-GCUU37JB.js";import"./chunk-JCGIG4OG.js";import"./chunk-MQZKQQJ2.js";import"./chunk-KIYQBDPO.js";import{b as Me}from"./chunk-WAKVBF4U.js";import"./chunk-2BKQ45PR.js";import"./chunk-EUBEE6D7.js";import{h as v}from"./chunk-KY4EBOEB.js";import"./chunk-OZY5YA4U.js";import{a as k,b as I}from"./chunk-45NYDNRM.js";import"./chunk-C4H5ZZHM.js";import"./chunk-RWGWM2JZ.js";import"./chunk-T4MKGUPR.js";import{H as M,I as Q,y as K,z as E}from"./chunk-LIOWCE3C.js";import"./chunk-KMHIOZSQ.js";import{Ta as D,b as T,c as pe,e as A,f as U,j as we,n as Te,o as Ae,p as H,q as W,v as $,x as L,y as q}from"./chunk-JGVJQYWH.js";import{b as Se}from"./chunk-5IZ2YCM4.js";import"./chunk-F4BFKDR4.js";import{a as Fe}from"./chunk-UURD2F4Q.js";import{a as ye}from"./chunk-6TJ2OAAU.js";import"./chunk-CJPLD6EO.js";import"./chunk-ZJHW6UKQ.js";import{i as be,r as ve,t as J}from"./chunk-5KNGGA7C.js";import{Ab as _,Ac as G,Bc as O,Hc as j,I as fe,Ic as ae,Jc as le,Mb as y,Nb as F,Ob as Ce,Pb as ge,Qb as oe,Rb as ie,Rc as ce,Sb as h,Sc as me,Tb as i,U as he,Ub as r,V,Vb as C,Vc as d,Zc as se,_ as _e,ac as g,da as p,db as s,e as de,fc as x,gc as l,ka as u,la as f,nb as ne,s as ue,sc as re,ub as b,uc as a,vc as xe,wa as B,wc as w,zc as N}from"./chunk-ZIDIPNEH.js";import{a as R,b as P}from"./chunk-PRARYYF3.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),y(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),F(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datepicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",27),a(2),r(),i(3,"td"),C(4,"input",28),r(),i(5,"td"),C(6,"input",29),r()()),t&2){let e,n=c.$implicit,o=c.$index,m=l(4);h("formGroupName",o),s(2),w(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),oe(14,mt,7,2,"tr",10,ge),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);h("formGroupName",n),s(2),w(" ",e.get("name").value," "),s(12),ie(o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),_(1,ct,4,0,"ng-template",null,2,d),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),oe(6,st,16,2,"div",10,Ce),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),ce(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),ce(21,"number"),r()()()()()()),t&2){let e=l(2);re(ae(11,it)),h("formGroup",e.formGroups),s(4),re(ae(12,rt)),s(2),ie(e.formsArray.controls),s(10),w(" ",me(17,7,e.subtotalDebit)," "),s(4),w(" ",me(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&y(0,pt,22,13,"p-panel",7),t&2){let e=l();F(e.formGroups?0:-1)}}var Le=(()=>{class t{constructor(){this.destroy$=new de,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p($),this.accSetupService=p(S),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(Se),this.roleService=p(z)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(fe(300),he(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ue(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),tt=o.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
|
|
2
2
|
width`,`calc(
|
|
3
3
|
100% - 243px
|
|
4
4
|
)`,`/* adjust width to fit the remaining space */
|
|
5
5
|
z-index`,"91","background-color","white",`/* added background */
|
|
6
6
|
/* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
|
|
7
7
|
padding`,"8px 0",`/* added padding for height */
|
|
8
|
-
border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-A7AIX5OW.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-EMMG7PXA.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-ZSRAYXJU.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-SNUYIITB.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-YM4SHG3Z.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-CNW4OSB5.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-N72UYL5Y.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-ADKIXPGH.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
|
|
8
|
+
border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-R5Q5RJJY.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-THSOUH4P.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-MRIW4627.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-ZPEEG2MX.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-VZSCGFD2.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-TWDYXQSM.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-P55NMMMB.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-3NVMSAHU.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
|