dealposbooks 5.45.2 → 5.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +5 -23
- package/assets/scss/components/_tables.scss +29 -3
- package/assets/scss/style.scss +4 -0
- package/{chunk-QY6YO5GR.js → chunk-325YO3CB.js} +1 -1
- package/{chunk-OZG2M6UV.js → chunk-53W5RLOG.js} +4 -4
- package/{chunk-W325ZFGZ.js → chunk-56N6E5N3.js} +1 -1
- package/{chunk-WO62II7E.js → chunk-6HNKPNHQ.js} +1 -1
- package/{chunk-26UQWFZL.js → chunk-7UGQCTEO.js} +1 -1
- package/{chunk-WZQ3ORPU.js → chunk-A3XYHEBB.js} +1 -1
- package/chunk-AS6FT6H3.js +1 -0
- package/{chunk-FXATM6DM.js → chunk-BPBHYTKN.js} +1 -1
- package/{chunk-MLC5Q3HL.js → chunk-BPZ7LLVJ.js} +1 -1
- package/{chunk-AJUXGEAH.js → chunk-C2KFSD3V.js} +1 -1
- package/chunk-CRRQQY3W.js +1 -0
- package/{chunk-DWCZUCH4.js → chunk-DAUF3TQ2.js} +1 -1
- package/{chunk-66OMKKIW.js → chunk-FXWKWGGZ.js} +1 -1
- package/{chunk-GZYN6L4H.js → chunk-FYFSBGP3.js} +1 -1
- package/chunk-G25NFEKL.js +1 -0
- package/chunk-GKXIOXWW.js +8 -0
- package/{chunk-NMNIOSPK.js → chunk-HXXN64RL.js} +1 -1
- package/chunk-ICH2UTRM.js +1 -0
- package/{chunk-QTPVRMTB.js → chunk-IZCYMXSH.js} +1 -1
- package/chunk-JGRTH5OW.js +1 -0
- package/{chunk-GNLE4WCA.js → chunk-JYEZYL2U.js} +1 -1
- package/{chunk-BSDEDT6G.js → chunk-KGTXHU4K.js} +1 -1
- package/{chunk-JTUKNSIL.js → chunk-KYQ3HOYB.js} +1 -1
- package/{chunk-CDM64DTS.js → chunk-LLPR22QN.js} +1 -1
- package/{chunk-BXJSXLQV.js → chunk-LWIIL6RI.js} +1 -1
- package/{chunk-PYQLVU3L.js → chunk-ME7O3OZS.js} +1 -1
- package/chunk-MOUK63TZ.js +4 -0
- package/{chunk-FPBO6QHG.js → chunk-MYE27TEJ.js} +1 -1
- package/{chunk-HWYLSS7R.js → chunk-NID2PW3N.js} +1 -1
- package/{chunk-Y4NMBCL7.js → chunk-NLRLM4WP.js} +1 -1
- package/{chunk-HSCJP74Q.js → chunk-O4TXGGHF.js} +1 -1
- package/chunk-OBX4APL6.js +1 -0
- package/chunk-OKX4P7HR.js +1 -0
- package/{chunk-SZPSOPM4.js → chunk-PQB7CIVB.js} +1 -1
- package/chunk-PRW2K6L4.js +129 -0
- package/{chunk-4LXFEAO3.js → chunk-QKRPHDSG.js} +1 -1
- package/{chunk-JOKE4TMJ.js → chunk-QXZZJ543.js} +1 -1
- package/{chunk-4TTCPL3N.js → chunk-R7TX5W65.js} +1 -1
- package/{chunk-XBIY3I5H.js → chunk-SBAIX6FL.js} +1 -1
- package/{chunk-3KUSIKRO.js → chunk-SLUPHKW6.js} +1 -1
- package/{chunk-KUECUVZ7.js → chunk-SPFVPLUI.js} +1 -1
- package/{chunk-OX6CAMTK.js → chunk-SZUKKFRX.js} +1 -1
- package/{chunk-MMQTWRG5.js → chunk-TOSO7HJJ.js} +1 -1
- package/chunk-TYVIEINK.js +1 -0
- package/{chunk-GJJEUBYR.js → chunk-VBCL4G4V.js} +1 -1
- package/{chunk-UP4DWDNE.js → chunk-W4HYYYPX.js} +1 -1
- package/{chunk-OQD4ZKBU.js → chunk-XILZA7G5.js} +1 -1
- package/{chunk-Y7P7BGVH.js → chunk-Y2PXP5OT.js} +2 -2
- package/{chunk-2CZSVC7E.js → chunk-Y3UB475V.js} +1 -1
- package/chunk-YM5BXLAN.js +1 -0
- package/{chunk-AOJUTF6L.js → chunk-YUNKEY4N.js} +1 -1
- package/{chunk-YDFJ65ST.js → chunk-Z2ADGCWR.js} +1 -1
- package/{chunk-A2PK5UDL.js → chunk-ZYDAEVQY.js} +1 -1
- package/index.html +2 -2
- package/{main-TUODCJBC.js → main-7RGHX2IL.js} +1 -1
- package/package.json +1 -1
- package/{styles-TEWF6HBI.css → styles-4HAX3IDP.css} +1 -1
- package/chunk-3HOFEEIL.js +0 -1
- package/chunk-5M4DFZYR.js +0 -8
- package/chunk-BTVPGIVW.js +0 -1
- package/chunk-DHA762N3.js +0 -1
- package/chunk-JRVYSBUZ.js +0 -5
- package/chunk-KQGEEF2E.js +0 -129
- package/chunk-N4CQ65FU.js +0 -1
- package/chunk-OVHHHUDY.js +0 -1
- package/chunk-P63CD72K.js +0 -1
- package/chunk-QUL4J2CF.js +0 -1
- package/chunk-VEALQLJ2.js +0 -1
- package/chunk-YVO6JHL7.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-BPBHYTKN.js";import{a as ze}from"./chunk-G4XX7EU2.js";import{a as je}from"./chunk-MOUK63TZ.js";import{a as Oe,b as Be}from"./chunk-BLR3HBYP.js";import{a as oe}from"./chunk-FYFSBGP3.js";import{b as D}from"./chunk-JYEZYL2U.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import"./chunk-IGWIRCAS.js";import{a as z,b as j}from"./chunk-3A4BFUGD.js";import{d as Je,i as Ne,j as ke,k as Me}from"./chunk-EL5BUFMO.js";import{a as Ve,b as De}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import"./chunk-2AAVNIG7.js";import{a as Ae,b as Fe}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{g as Te,h as Ee}from"./chunk-Y2PXP5OT.js";import{b as Re,c as Ie}from"./chunk-VGNJD35F.js";import{a as xe,b as Ce}from"./chunk-2XUSZCQL.js";import{a as y,b as be,c as Se,d as ve,e as ye,f as we}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as fe,o as _e,w as ge,x as he}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as re,c as ae,e as le,f as me,k as pe,l as se,o as ce,u as de,x as ue}from"./chunk-OIBDX2CA.js";import"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as Y,j as Z,k as ee,n as te,p as ie,s as ne}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as w,Bb as K,Cc as Q,Db as g,Ec as E,Ha as k,Lb as c,Nc as I,Oc as X,Pc as V,Rc as v,Vb as r,Wb as o,Xb as b,Y as N,_ as H,bd as T,c as F,cb as U,db as L,ec as R,fc as _,hb as m,ia as C,qa as h,ra as x,rc as s,s as J,sc as S,tc as M,vc as W,wc as $,xb as G,xc as P,yc as q}from"./chunk-NMCKMUY4.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var We={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},O=be(we(We),Se(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),ye(t=>{let a=C(A),e=C(D);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(F(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(F(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var B=t=>({"ng-invalid ng-dirty":t});function $e(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function qe(t,a){if(t&1&&g(0,$e,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Qe(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Xe(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,L),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,U),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ye(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ze(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function et(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Qe,18,0,"ng-template",null,3,v)(4,Xe,22,18,"ng-template",null,4,v)(6,Ye,1,3,"ng-template",null,5,v)(8,Ze,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function tt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function it(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function nt(t,a){if(t&1&&(r(0,"div"),g(1,it,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function mt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),g(5,tt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,nt,2,1,"div",30),b(13,"p-datepicker",31),g(14,rt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,lt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(16,B,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(18,B,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",X(19,14,e.customerSuggestions$)),m(5),c("ngClass",E(20,B,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var Yt=(()=>{class t extends Pe{constructor(){super(),this.store=C(O),this.generateJournalService=C(A),this.authService=C(oe),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:He,exportPageSize:Ue,outletName:Le,customerID:Ge,paymentState:Ke}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),pageSize:this.fb.control(u,[ae.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(He),exportPageSize:this.fb.control(Ue),outletName:this.fb.control(Le),customerID:this.fb.control(Ge),paymentState:this.fb.control(Ke)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=ze);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(H(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([O]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AR Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,qe,1,1,"ng-template",null,0,v)(3,et,10,5,"ng-template",null,1,v),s(5," <"),g(6,mt,25,22,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ee,ne,Y,Z,ee,te,ie,Me,Je,Ne,ke,he,ge,Ce,xe,ue,pe,re,le,me,se,ce,Fe,Ae,De,Ve,Be,Oe,_e,fe,Te,Ie,Re,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Yt as ARJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-FYFSBGP3.js";import"./chunk-IGWIRCAS.js";import{d as n}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{ia as e}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var a=(t,m)=>{let o=e(r),i=e(n),p=o.isAuthenticated(),s=!o.isTokenExpired(),u=o.checkAuthKeysExists();return p&&s&&u?(i.navigateByUrl("/pages/dashboard"),!1):!0};var C=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-HXXN64RL.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-U5XXKH2H.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-CVL3S2HY.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6NX36ZC2.js").then(t=>t.TimeoutComponent)}];export{C as AuthenticationRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-IZCYMXSH.js";import{a as W}from"./chunk-EB6NEJHF.js";import{a as O}from"./chunk-QF4D5YPK.js";import{h as B}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as A}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as z,w as D}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as I,c as N,e as w,f as R,l as P,o as V,u as G,x as q}from"./chunk-OIBDX2CA.js";import{b as M,d as k}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as E,k as J}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as F,D as x,Db as p,Ec as j,I as h,Lb as r,N as T,Rc as v,Vb as i,Wb as n,Xb as g,Y as d,_ as f,ec as S,fc as s,hb as a,ia as m,k as _,qa as C,ra as b,rc as c,xb as y}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var U=t=>({"ng-invalid ng-dirty":t});function Y(t,u){if(t&1){let e=F();i(0,"div")(1,"p-button",3),S("onClick",function(){C(e);let l=s();return b(l.onSubmit())}),n()()}}function H(t,u){t&1&&(i(0,"div",14),c(1," Name is required "),n())}function K(t,u){if(t&1&&(i(0,"div"),p(1,H,2,0,"div",13),n()),t&2){let e=s(2);a(),r("ngIf",e.form.controls.name.errors.required)}}function L(t,u){if(t&1&&(i(0,"p-panel",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"label",9),c(6,"Name"),n(),g(7,"input",10),p(8,K,2,1,"div",11),n()(),i(9,"div",7)(10,"div",8)(11,"label",9),c(12,"Description"),n(),g(13,"textarea",12),n()()()()()),t&2){let e=s();a(),r("formGroup",e.form),a(6),r("ngClass",j(4,U,e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched))),a(),r("ngIf",e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched)),a(5),r("autoResize",!0)}}var ue=(()=>{class t{constructor(){this.fb=m(G),this.journalTagService=m(Q),this.route=m(M),this.router=m(k)}initForm(){console.log("Initializing form"),this.form=this.fb.group({name:this.fb.control("",[N.required]),description:this.fb.control("")})}ngOnInit(){this.initForm(),this.route.queryParamMap.pipe(x(e=>e.has("id")),d(e=>this.journalTagService.journalTagGet(e.get("id"))),O("Query params"),f(e=>{console.log("Got journal tag:",e),this.form.patchValue({name:e.name,description:e.description})})).subscribe()}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=this.form.getRawValue();this.route.queryParamMap.pipe(T(1),d(o=>{let l=o.get("id");return l?this.journalTagService.journalTagUpdate(e,l):this.journalTagService.journalTagCreate(e)}),f(()=>{console.log("Journal tag saved successfully"),this.router.navigate(["/pages/accounting-setup/journal-tag"])}),h(o=>(console.error("Failed to save journal tag:",o),_))).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=y({type:t,selectors:[["app-journal-tag-form"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["rows","2","pSize","large","cols","30","pTextarea","","formControlName","description",3,"autoResize"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"]],template:function(o,l){o&1&&(i(0,"app-main-panel",2),p(1,Y,2,0,"ng-template",null,0,v)(3,L,14,6,"ng-template",null,1,v),n()),o&2&&r("hasMainWrapperPadding",!0)},dependencies:[B,z,J,A,q,I,w,R,P,V,W,D,E],encapsulation:2})}}return t})();export{ue as JournalTagFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,b as T}from"./chunk-IGWIRCAS.js";import{d as s}from"./chunk-AOOG6YOT.js";import{a as l,d as m}from"./chunk-
|
|
1
|
+
import{a as i,b as T}from"./chunk-IGWIRCAS.js";import{d as s}from"./chunk-AOOG6YOT.js";import{a as l,d as m}from"./chunk-R7TX5W65.js";import{_ as a,ca as c,ia as r}from"./chunk-NMCKMUY4.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as re}from"./chunk-G4XX7EU2.js";import{a as ut}from"./chunk-MOUK63TZ.js";import{a as dt,b as gt}from"./chunk-BLR3HBYP.js";import{a as Ke}from"./chunk-FYFSBGP3.js";import{a as Rt,b as ot}from"./chunk-JYEZYL2U.js";import{a as mt}from"./chunk-XKI7WLHE.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as st,b as ct}from"./chunk-EB6NEJHF.js";import{a as et}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as ne,b as ie}from"./chunk-3A4BFUGD.js";import{b as at,d as Me,i as lt,j as pt,k as ke}from"./chunk-EL5BUFMO.js";import{a as it,b as rt}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Ve}from"./chunk-QF4D5YPK.js";import{a as ye,b as Re}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Pe,b as De}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as Q}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{f as nt,h as L}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as N,b as A}from"./chunk-2XUSZCQL.js";import{a as T,b as Ie,c as tt,d as Te,e as we,f as Fe}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as Se,o as Ce,w as Y,x as J}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as xe,c as K,e as X,f as _e,i as Xe,j as Ye,k as he,l as Ee,o as ve,u as Je,v as Qe,w as Ze,x as be}from"./chunk-OIBDX2CA.js";import{b as de,d as ge,e as k,l as V}from"./chunk-AOOG6YOT.js";import{a as fe}from"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as We,k as D,p as ue,q as W,s as M}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as y,Bb as ze,Cc as me,Db as h,Dc as $e,Ec as C,Ha as q,J as Oe,Lb as m,Nc as S,Oc as F,Pc as U,Qb as Ge,Rb as G,Rc as x,Tb as H,Ub as $,Vb as r,Wb as n,Xb as d,Y as O,_ as w,bd as te,c as ee,ca as le,ec as R,fc as g,hb as l,ia as u,qa as v,ra as b,rc as a,s as z,sc as E,tc as I,ua as qe,vc as He,wc as pe,xa as Ue,xb as P,xc as se,yc as ce}from"./chunk-NMCKMUY4.js";import{a as f,b as _,e as yt}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{#e=u(fe);#t=u(Ke);getRecurringExpenseLoader(){return this.#e.get(void 0,"api/RecurringExpenseLoader/GetList")}getRecurringExpenses(e){return this.#e.post(void 0,"api/RecurringExpense/GetList",e)}fetchRecurringExpenseForm(e){return this.#e.get(void 0,`api/RecurringExpense/form/${e??""}`)}fetchSupplierSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",o)}fetchCustomerSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",o)}submitRecurringExpense(e,o={}){return this.#e.post(void 0,"api/RecurringExpense/submit",e,o)}removeRecurringExpense(e){return this.#e.delete(void 0,`api/RecurringExpense/${e}`,void 0)}removeRecurringExpenses(e){let o={body:e};return this.#e.delete(void 0,"api/RecurringExpense/Batch",o)}getRecurringExpenseByID(e){return this.#e.get(void 0,`api/RecurringExpense/Info/${e}`)}getAssetValueList(){return this.#e.get(void 0,"api/AssetValue/GetListt")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var It={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}},Ne=Ie(Fe(It),tt(t=>({first:te(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:te(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:te(()=>t.data().data.some(c=>c.checked)),checkedInvoice:te(()=>t.data().data.filter(c=>c.checked).map(c=>c.id))})),we(t=>{let c=u(B);return{updateFilter(o){T(t,i=>_(f({},i),{filter:f(f({},i.filter),o)}))},onRowSelect(o){T(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!0}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onRowUnselect(o){T(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!1}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onHeaderCheckboxToggle(o){T(t,i=>{let s=i.data.data.map(p=>_(f({},p),{checked:o}));return _(f({},i),{data:_(f({},i.data),{data:s})})})},getRecurringExpenseLoader:ne(ee(O(()=>c.getRecurringExpenseLoader().pipe(ie({next:o=>{T(t,i=>_(f({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ne(ee(z(o=>Object.entries(o).reduce((i,[s,p])=>(p!=null&&(i[s]=p),i),{})),O(o=>c.getRecurringExpenses(o).pipe(ie({next:i=>{T(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),Te(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var Ft=["class","page"],Pt=t=>["details/",t];function Dt(t,c){if(t&1){let e=y();r(0,"p-button",12),R("onClick",function(){v(e);let i=g(2);return b(i.onDeleteSelected())}),n()}}function Mt(t,c){if(t&1&&(r(0,"div",8),h(1,Dt,1,0,"p-button",9),r(2,"a",10),d(3,"i",11),r(4,"span"),a(5,"Add"),n()()()),t&2){let e=g();l(),m("ngIf",e.store.hasCheckedRows())}}function kt(t,c){t&1&&(r(0,"tr")(1,"th"),d(2,"p-tableHeaderCheckbox"),n(),r(3,"th"),a(4,"Outlet"),n(),r(5,"th"),a(6,"Name"),n(),r(7,"th"),a(8,"Expense Account"),n(),r(9,"th"),a(10,"Start Date"),n(),r(11,"th"),a(12,"End Date"),n(),r(13,"th"),a(14,"Last Expense"),n(),r(15,"th"),a(16,"Amount"),n(),r(17,"th"),a(18,"Frequency"),n()())}function Vt(t,c){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",14),n(),r(3,"td"),a(4),n(),r(5,"td")(6,"a",15),a(7),n()(),r(8,"td"),a(9),n(),r(10,"td"),a(11),S(12,"date"),n(),r(13,"td"),a(14),S(15,"date"),n(),r(16,"td"),a(17),S(18,"date"),n(),r(19,"td"),a(20),S(21,"number"),n(),r(22,"td"),a(23),n()()),t&2){let e=c.$implicit;l(2),m("value",e),l(2),E(e.outletName),l(2),m("routerLink",C(21,Pt,e.id)),l(),E(e.name),l(2),E(e.expenseName),l(2),E(U(12,10,e.startDate,"d MMM y")),l(3),E(U(15,13,e.endDate,"d MMM y")),l(3),E(U(18,16,e.lastExpenseDate,"d MMM y")),l(3),E(F(21,19,e.amount)),l(3),E(e.repeatTypeLabel)}}function Nt(t,c){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=g(2);l(),He(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function At(t,c){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Lt(t,c){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",13),R("onPage",function(i){v(e);let s=g();return b(s.onPageChange(i))})("onHeaderCheckboxToggle",function(i){v(e);let s=g();return b(s.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){v(e);let s=g();return b(s.onRowSelect(i))})("onRowUnselect",function(i){v(e);let s=g();return b(s.onRowUnselect(i))}),h(2,kt,19,0,"ng-template",null,3,x)(4,Vt,24,23,"ng-template",null,4,x)(6,Nt,2,3,"ng-template",null,5,x)(8,At,4,0,"ng-template",null,6,x),n()()}if(t&2){let e=g();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function Bt(t,c){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),d(4,"p-select",20),n()()),t&2){let e=g();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var _t=(()=>{class t extends mt{constructor(){super(...arguments),this.store=u(Ne),this.recurringExpenseService=u(B),this.fb=u(Je),this.isDialogFilterVisible=q(!1)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(w(()=>{this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(f({},this.store.filter()),{text:e}))}onFilterEvent(){this.onSubmitFilterDialog()}onSubmitFilterDialog(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((o,[i,s])=>(s!=null&&(o[i]=s),o),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(o=>!o)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}initForm(){let{text:e,Frequency:o,pageNumber:i,pageSize:s,export:p,exportPageNumber:j,exportPageSize:Ct}=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(s),export:this.fb.control(p),exportPageNumber:this.fb.control(j),exportPageSize:this.fb.control(Ct)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=qe(t)))(i||t)}})()}static{this.\u0275cmp=P({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[me([Ne]),ze],attrs:Ft,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Recurring Expenses",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[3,"value"],[1,"link-primary",3,"routerLink"],["colspan","9"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","Frequency","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Type",3,"options"]],template:function(o,i){if(o&1){let s=y();r(0,"app-main-panel",7),R("search",function(j){return v(s),b(i.onSearchEvent(j))}),ce("isDialogFilterVisibleChange",function(j){return v(s),se(i.isDialogFilterVisible,j)||(i.isDialogFilterVisible=j),b(j)}),R("filterConfirmed",function(){return v(s),b(i.onFilterEvent())}),h(1,Mt,6,1,"ng-template",null,0,x)(3,Lt,10,5,"ng-template",null,1,x)(5,Bt,5,2,"ng-template",null,2,x),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),pe("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[L,k,Q,ke,Me,lt,pt,M,D,W,ue,V,nt,De,Pe,J,Y,be,he,X,_e,Ee,ve,A,N],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Z=yt(Rt());var qt=["class","page"],Ut=()=>["/pages/recurring/recurring-expense"],ae=t=>({"ng-dirty ng-invalid":t});function zt(t,c){if(t&1){let e=y();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),R("click",function(){v(e);let i=g();return b(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",$e(1,Ut)))}function Gt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Ht(t,c){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=c.$implicit;l(2),I(" ",e.name," ")}}function $t(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Wt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Kt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Xt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Yt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Jt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Qt(t,c){if(t&1){let e=y();r(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-scroll-panel")(4,"div",12)(5,"div",13)(6,"form",14)(7,"div",15)(8,"div",13)(9,"div",16)(10,"label",17),a(11,"Name"),n(),d(12,"input",18),r(13,"div"),H(14,Gt,2,1,"small",19,G),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Outlet"),n(),r(21,"p-select",21),h(22,Ht,3,1,"ng-template",null,3,x),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),R("completeMethod",function(i){v(e);let s=g(2);return b(s.searchContact(i))}),n()(),r(30,"div"),H(31,$t,2,1,"small",19,G),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),d(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),d(42,"p-datepicker",24),n()(),d(43,"div",25),n(),d(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),d(50,"input",26),r(51,"div"),H(52,Wt,2,1,"small",19,G),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),d(58,"p-select",27),n()(),r(59,"div",20)(60,"div",16)(61,"label",17),a(62,"Expense (Debit)"),n(),r(63,"p-select",28),h(64,Kt,6,2,"ng-template",null,3,x),n()(),r(66,"div"),H(67,Xt,2,1,"small",19,G),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),h(74,Yt,6,2,"ng-template",null,3,x),n()(),r(76,"div"),H(77,Jt,2,1,"small",19,G),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),d(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,s,p=g(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",C(16,ae,p.isInvalid("name"))),l(2),$(p.getErrors("name")),l(7),m("options",(e=p.recurringExpenseData())==null||e.options==null?null:e.options.entities),l(8),m("showClear",!0)("ngClass",C(18,ae,p.isInvalid("contact")))("suggestions",p.customerSupplierSuggestions()),l(2),$(p.getErrors("contact")),l(6),m("iconDisplay","input")("showIcon",!0),l(5),m("iconDisplay","input")("showIcon",!0),l(8),m("ngClass",C(20,ae,p.isInvalid("amount"))),l(2),$(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses)("ngClass",C(22,ae,p.isInvalid("expenseAccountID"))),l(4),$(p.getErrors("expenseAccountID")),l(6),m("ngClass",C(24,ae,p.isInvalid("paymentAccountID")))("options",(s=p.recurringExpenseData())==null||s.options==null?null:s.options.assets),l(4),$(p.getErrors("paymentAccountID"))}}function Zt(t,c){if(t&1&&h(0,Qt,84,26,"div",8),t&2){let e=g();m("ngIf",e.recurringExpenseData())}}var Be=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.fb=u(Qe),this.destroyRef=u(Ue),this.route=u(de),this.recurringExpenseData=q(null),this.customerSupplierSuggestions=q([]),this.router=u(ge),this.contactType=new Xe(0),this.dayjsService=u(ot)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[K.required]),repeatTypeID:this.fb.control(1,[K.required]),startDate:this.fb.control((0,Z.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[K.required]),paymentAccountID:this.fb.control(null,[K.required]),expenseAccountID:this.fb.control(null,[K.required]),contact:this.fb.control("",[]),description:this.fb.control(""),repeatTypeLabel:this.fb.control(""),outletID:this.fb.control(""),creatorID:this.fb.control(""),created:this.fb.control(""),modifierID:this.fb.control(""),modified:this.fb.control("")})}fetchRecurringExpenseForm(){this.route.paramMap.pipe(z(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,[s,p])=>{switch(s){case"startDate":i[s]=(0,Z.default)(p).isSame((0,Z.default)("0001-01-01T00:00:00"))?(0,Z.default)().toDate():(0,Z.default)(p).toDate();break;case"repeatTypeID":i[s]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[s]=p===re?null:p;break;case"expenseAccountID":i[s]=p===re?null:p;break;default:i[s]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(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,[s,p])=>{switch(s){case"amount":i[s]=+p;break;case"startDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"contact":typeof p=="string"?i.contactID=p:typeof p=="object"&&p!==null?i.contactID=p&&Object.prototype.hasOwnProperty.call(p,"Key")?p.Key:p:i.contactID=re;break;default:i[s]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(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[s,p]of Object.entries(o.errors))switch(s){case"required":i.push("This field is required.");break;case"minlength":i.push(`Minimum length is ${p.requiredLength} characters.`);break;case"maxlength":i.push(`Maximum length is ${p.requiredLength} characters.`);break;case"email":i.push("Please enter a valid email address.");break;case"pattern":i.push("The format is invalid.");break;case"min":i.push(`Minimum value is ${p.min}.`);break;case"max":i.push(`Maximum value is ${p.max}.`);break;default:i.push("Invalid value.")}return i}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:qt,decls:5,vars:2,consts:[["actionButton",""],["content",""],["outlet",""],["item",""],["pageTitle","Recurring Expense Form",3,"hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit","icon","fa-solid fa-plus",3,"click"],["class","row justify-content-center",4,"ngIf"],[1,"row","justify-content-center"],[1,"col-6"],[1,"h-100","d-flex"],[1,"row","justify-content-center","h-100"],[1,"col-12"],[1,"d-flex","flex-column","row-gap-2",3,"formGroup"],[1,"row","row-gap-2"],[1,"d-flex","flex-column"],["for",""],["formControlName","name","type","text","pInputText","",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["filter","","filterBy","name","appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["formControlName","contact","inputStyleClass","w-100","styleClass","w-100","optionLabel","Value","optionValue","Key",3,"completeMethod","showClear","ngClass","suggestions"],["dateFormat","mm/dd/yy","appendTo","body","formControlName","startDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],["appendTo","body","formControlName","endDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"col"],["formControlName","amount","type","text","appMaskNumber","","pInputText","",3,"ngClass"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense","filter","","filterBy","code,value",3,"options","ngClass"],["appendTo","body","formControlName","paymentAccountID","optionLabel","value","optionValue","key","filter","","filterBy","code,value","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["formControlName","description","rows","3","cols","30","pTextarea",""],[1,"flex","items-center","gap-2"],[1,"text-truncate","d-inline-block",2,"max-width","250px"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,zt,4,2,"ng-template",null,0,x)(3,Zt,1,1,"ng-template",null,1,x),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[L,Q,Ce,Se,De,Pe,rt,it,gt,dt,ct,st,Re,ye,M,We,D,be,he,xe,X,_e,Ee,ve,V,k,J,Y,ut,A,N,at],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var en=["class","page"],tn=t=>["/pages/recurring/recurring-expense/edit",t];function nn(t,c){if(t&1&&(r(0,"a",7),d(1,"i",8),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=g(4);m("routerLink",C(1,tn,e.currentRecurringExpense().id))}}function rn(t,c){if(t&1){let e=y();r(0,"p-button",9),R("onClick",function(){v(e);let i=g(4);return b(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function on(t,c){if(t&1&&(r(0,"div",4),h(1,nn,4,3,"a",5)(2,rn,1,0,"p-button",6),n()),t&2){let e=g(3);l(),m("ngIf",e.roleService.setup().recurring),l(),m("ngIf",e.roleService.setup().recurring)}}function an(t,c){if(t&1&&h(0,on,3,2,"div",3),t&2){let e=g(2);m("ngIf",e.currentRecurringExpense())}}function ln(t,c){if(t&1){let e=y();r(0,"p-panel",13)(1,"p-scroll-panel")(2,"div",10)(3,"div",14)(4,"div",15)(5,"div",14)(6,"div",16)(7,"div",17)(8,"div",18)(9,"label",19),a(10,"Outlet"),n(),r(11,"input",20),ce("ngModelChange",function(i){v(e);let s=g(3);return se(s.currentRecurringExpense().outletName,i)||(s.currentRecurringExpense().outletName=i),b(i)}),n()()(),r(12,"div",17)(13,"div",18)(14,"label",19),a(15,"Supplier"),n(),d(16,"input",21),n()(),r(17,"div",17)(18,"div",18)(19,"label",19),a(20,"From"),n(),d(21,"input",22),S(22,"date"),n()(),r(23,"div",17)(24,"div",18)(25,"label",19),a(26,"To"),n(),d(27,"input",22),S(28,"date"),n()()(),d(29,"hr"),r(30,"div",16)(31,"div",17)(32,"div",18)(33,"label",19),a(34,"Amount"),n(),d(35,"input",22),S(36,"number"),n()(),r(37,"div",17)(38,"div",18)(39,"label",19),a(40,"Frequency"),n(),d(41,"input",22),n()(),r(42,"div",17)(43,"div",18)(44,"label",19),a(45,"Expense (Debit)"),n(),d(46,"input",22),n()(),r(47,"div",17)(48,"div",18)(49,"label",19),a(50,"Payment (Credit)"),n(),d(51,"input",22),n()(),r(52,"div",23)(53,"div",18)(54,"label",19),a(55,"Description"),n(),d(56,"textarea",24),n()()()()()()()()()}if(t&2){let e=g(3);l(11),pe("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",U(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",U(28,12,e.currentRecurringExpense().endDate,"d MMM y")),l(8),m("value",F(36,15,e.currentRecurringExpense().amount)),l(6),m("value",e.currentRecurringExpense().repeatTypeLabel),l(5),m("value",e.currentRecurringExpense().expenseName),l(5),m("value",e.currentRecurringExpense().paymentName),l(5),m("value",e.currentRecurringExpense().description)}}function pn(t,c){if(t&1&&(r(0,"div",10)(1,"div",11),h(2,ln,57,17,"p-panel",12),n()()),t&2){let e=g(2);l(2),m("ngIf",e.currentRecurringExpense())}}function sn(t,c){if(t&1&&(r(0,"app-main-panel",2),h(1,an,1,1,"ng-template",null,0,x)(3,pn,3,1,"ng-template",null,1,x),n()),t&2){let e=g();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var Et=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.route=u(de),this.router=u(ge),this.currentRecurringExpense=q(null),this.roleService=u(et)}ngOnInit(){this.route.paramMap.pipe(z(e=>e.get("id")),Ve("params"),Oe(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),w(e=>this.currentRecurringExpense.set(e)),Ve("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=P({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:en,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["class","p-button p-button-outlined p-button-secondary d-flex gap-2 align-items-center",3,"routerLink",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],[1,"row","justify-content-center"],[1,"col-6"],["class","h-100 d-flex",4,"ngIf"],[1,"h-100","d-flex"],[1,"col"],[1,"row"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["readonly","","type","text","pInputText","",3,"ngModelChange","ngModel"],["type","text","readonly","","pInputText","",3,"value"],["readonly","","type","text","pInputText","",3,"value"],[1,"col","col-lg-12"],["readonly","","rows","5","cols","30","pTextarea","",3,"value"]],template:function(o,i){o&1&&h(0,sn,5,3,"app-main-panel",2),o&2&&Ge(i.currentRecurringExpense()?0:-1)},dependencies:[L,Q,M,D,W,ue,Ce,Se,Ze,xe,X,Ye,J,Y,V,k,A,N,Re,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vt=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:_t},{path:"create",component:Be},{path:"details/:id",component:Et},{path:"edit/:id",component:Be}]}];var bt=(()=>{class t{constructor(){this.httpService=u(fe)}getAssetValue(e){return this.httpService.post(void 0,"/api/AssetValue/GetList",e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var cn={filter:{Text:"",Frequency:0,PageNumber:1,PageSize:10},data:null},je=Ie(Fe(cn),we(t=>{let c=u(bt);return{getAssetValue:ne(ee(O(o=>c.getAssetValue(o).pipe(ie({next:i=>{T(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{T(t,i=>_(f({},i),{filter:o}))}}}),Te({onInit:t=>{t.getAssetValue(t.filter())}}));var mn=t=>["/pages/recurring/recurring-expense/details/",t];function un(t,c){t&1&&d(0,"div",5)}function dn(t,c){t&1&&(r(0,"tr")(1,"th"),a(2,"Outlet"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",8),a(8,"Price on Purchase"),n(),r(9,"th",8),a(10,"Accomulated Depreciation"),n(),r(11,"th",8),a(12,"Book Value"),n(),r(13,"th",8),a(14,"Frequency"),n()())}function gn(t,c){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",9),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",8),a(9),S(10,"number"),n(),r(11,"td",8),a(12),S(13,"number"),n(),r(14,"td",8),a(15),S(16,"number"),n(),r(17,"td",8),a(18),S(19,"number"),n()()),t&2){let e=c.$implicit;l(2),E(e.entityName),l(2),m("routerLink",C(16,mn,e.id)),l(),E(e.name),l(2),E(e.accountCode),l(2),E(F(10,8,e.priceOnPurchase)),l(3),I(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),I(" ",F(16,12,e.bookValue)," "),l(3),I(" ",F(19,14,e.depreciationPerYear)," ")}}function fn(t,c){if(t&1&&(r(0,"p-panel")(1,"p-table",7),h(2,dn,15,0,"ng-template",null,2,x)(4,gn,20,18,"ng-template",null,3,x),n()()),t&2){let e=g(2);l(),m("value",e.store.data().data)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)}}function xn(t,c){if(t&1&&h(0,fn,6,3,"p-panel",6),t&2){let e=g();m("ngIf",e.store.data())}}var St=(()=>{class t{constructor(){this.store=u(je)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-asset-value"]],features:[me([je])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],[4,"ngIf"],["styleClass","h-100","dataKey","id",1,"",3,"value","rows","totalRecords"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,un,1,0,"ng-template",null,0,x)(3,xn,1,1,"ng-template",null,1,x),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[L,M,D,W,A,N,ke,Me,V,k],encapsulation:2})}}return t})();var mr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:vt},{path:"asset-value",component:St},{path:"post-to-journal",loadComponent:()=>import("./chunk-ICH2UTRM.js").then(t=>t.PostRecurringExpenseComponent)}];export{mr as RECURRING_ROUTES};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as He,b as Ke,c as Qe,d as Xe,e as Ye,f as Ze}from"./chunk-XD7VHCRC.js";import{a as Le,b as $e,c as ze,d as Ue}from"./chunk-UP67MADL.js";import{a as qe,b as We}from"./chunk-NCDT6JPP.js";import{a as je}from"./chunk-MOUK63TZ.js";import{b as we}from"./chunk-JYEZYL2U.js";import{a as Re,b as Je}from"./chunk-HG5MKVNR.js";import"./chunk-NZN6QJR3.js";import{a as Be,b as ke,k as Oe}from"./chunk-EL5BUFMO.js";import{a as Te,b as Me}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Ve}from"./chunk-QF4D5YPK.js";import{a as Q,b as X}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Ge,b as Pe}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import{a as Ne,b as De}from"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as Y}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as A}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as R,b as J}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as K,o as F,w as O,x as V}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{Ha as k,b as w,c as le,e as y,f as N,j as Ie,l as D,m as W,n as Ee,o as G,u as P,w as H,x as B}from"./chunk-OIBDX2CA.js";import{b as xe,e as Se,l as ye}from"./chunk-AOOG6YOT.js";import{a as Ae}from"./chunk-R7TX5W65.js";import{a as Fe}from"./chunk-2MKKFLNJ.js";import{h as he,j as ve,k as Ce,q as _e,s as S}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as C,Cc as q,Db as g,Dc as z,Ec as oe,Ha as j,L as se,Lb as p,Nc as re,Ob as L,Oc as ae,Rb as E,Rc as f,Tb as T,Ub as M,Vb as i,Wb as n,Xb as c,Z as ue,_ as I,ca as de,ec as _,fc as d,g as pe,hb as l,ia as u,nb as ie,qa as b,ra as h,rc as r,s as ce,sc as U,tc as $,wc as fe,xb as x,xc as ge,yc as be}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var v=(()=>{class t{#e=u(Ae);fetchLoaderConfiguration(){return this.#e.get("","api/SetupLoader/Load")}updateAccountingIntegrationConfiguration(e){return this.#e.post(void 0,"/api/setup/SubmitConfig",e)}fetchOpeningBalanceFormConfiguration(){return this.#e.get("","/api/setup/OpeningBalance/Form")}submitOpeningBalanceFormConfiguration(e){return this.#e.post("","api/setup/OpeningBalance/Submit",e)}fetchAPICredential(){return this.#e.get(void 0,"/api/AccountConfig")}updateAPICredential(e){return this.#e.put(void 0,"/api/AccountConfig",e)}verifyAPICredential(e){return this.#e.post(void 0,"/api/AccountConfig/Validate",e)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ct=()=>({height:"calc(100vh - 100px)"});function st(t,m){if(t&1){let e=C();i(0,"div",4)(1,"a",5),r(2,"Cancel"),n(),i(3,"p-button",6),_("click",function(){b(e);let a=d();return h(a.updateAccountingIntegration())}),n()()}}function ut(t,m){if(t&1&&(i(0,"p-tab",8),r(1),n()),t&2){let e=m.$implicit,o=m.$index;p("value",o),l(),U(e)}}function dt(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",41),i(2,"label",42),r(3),n()()),t&2){let e=m.$implicit;l(),p("value",e.key)("inputId",e.value),l(),p("for",e.value),l(),U(e.value)}}function ft(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",43),i(3,"label",42),r(4),n()()()),t&2){let e=m.$implicit;l(2),p("value",e.key)("inputId",e.key.toString()),l(),p("for",e.key),l(),U(e.value)}}function gt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),T(4,ut,2,2,"p-tab",8,E),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),r(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),r(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),r(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),r(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),r(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),r(37,"Reset Every"),n(),i(38,"div",24),T(39,dt,4,4,"div",25,E),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),r(45,"Journal Generate"),n(),i(46,"p"),r(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),r(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),r(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),r(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),r(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),r(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),r(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),r(88,"Accounting For Treatment"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),T(92,ft,5,4,"div",40,E),n()()()()()()()()()()()()),t&2){let e,o,a,s=d();L(z(8,ct)),l(2),p("value",0)("formGroup",s.form),l(2),M(s.tabs()),l(3),p("value",0),l(26),p("options",(e=s.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),l(6),M((o=s.accountingIntegration())==null||o.options==null?null:o.options.resetPeriods),l(2),p("value",1),l(38),p("value",2),l(13),M((a=s.accountingIntegration())==null||a.options==null?null:a.options.generatePrepaidJournal)}}var tt=(()=>{class t{constructor(){this.accountingSetupService=u(v),this.fb=u(P).nonNullable,this.tabs=j(["Numbering","Journal","Report"]),this.accountingIntegration=j(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(I(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,st,4,0,"ng-template",null,0,f)(3,gt,94,9,"ng-template",null,1,f),n())},dependencies:[S,Ze,Ye,Xe,Qe,He,Ke,A,Y,ke,Be,B,y,N,D,G,W,F,Pe,Ge,Je,Re,ye,Se,V,O,De,Ne,X,Q],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var ht=()=>({height:"cacl(100vh - 200px)"}),vt=()=>({height:"calc(100vh - 250px)"});function Ct(t,m){if(t&1){let e=C();i(0,"div")(1,"p-button",5),_("onClick",function(){b(e);let a=d();return h(a.submitForm())}),n()()}}function _t(t,m){t&1&&(i(0,"div",17)(1,"h3",18),r(2,"Date"),n(),c(3,"p-datePicker",19),n())}function xt(t,m){if(t&1&&(i(0,"tr",9)(1,"td",27),r(2),n(),i(3,"td"),c(4,"input",28),n(),i(5,"td"),c(6,"input",29),n()()),t&2){let e,o=m.$implicit,a=m.index,s=d(4);p("formGroupName",a),l(2),$(" ",(e=s.asFormGroup(o).get("accountName"))==null?null:e.value," ")}}function St(t,m){if(t&1&&(i(0,"div",9)(1,"h4",20),r(2),n(),i(3,"div",21)(4,"table",22)(5,"thead",23)(6,"tr")(7,"th",24),r(8,"Account Name"),n(),i(9,"th",25),r(10,"Debit"),n(),i(11,"th",25),r(12,"Credit"),n()()(),i(13,"tbody"),g(14,xt,7,2,"tr",26),n()()()()),t&2){let e=m.$implicit,o=m.$index,a=d(3);p("formGroupName",o),l(2),$(" ",e.get("name").value," "),l(12),p("ngForOf",a.getItemsArray(a.asFormGroup(e)).controls)}}function yt(t,m){if(t&1&&(i(0,"p-panel",7),g(1,_t,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",8),T(6,St,15,3,"div",9,E),n()(),i(8,"div",10)(9,"table",11)(10,"tr")(11,"td",12)(12,"p",13),r(13," Total: "),n()(),i(14,"td",14)(15,"p",15),r(16),re(17,"number"),n()(),i(18,"td",16)(19,"p",15),r(20),re(21,"number"),n()()()()()()),t&2){let e=d(2);L(z(11,ht)),p("formGroup",e.formGroups),l(4),L(z(12,vt)),l(2),M(e.formsArray.controls),l(10),$(" ",ae(17,7,e.subtotalDebit)," "),l(4),$(" ",ae(21,9,e.subtotalCredit)," ")}}function Ft(t,m){if(t&1&&g(0,yt,22,13,"p-panel",6),t&2){let e=d();p("ngIf",e.formGroups)}}var it=(()=>{class t{constructor(){this.destroy$=new pe,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(P),this.accSetupService=u(v),this.dayjsService=u(we),this.date=new Date,this.routes=u(xe)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(se(300),ue(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 o=e.map(a=>this.createItemGroup(a));return this.fb.array(o)}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(ce(e=>e.data),Ve("response"),I(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(a=>a.items&&a.items.length>0).forEach(a=>{this.formsArray.push(this.createFormGroup(a))})})).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(o=>{let a=this.getItemsArray(o),s=a.controls.reduce((ee,te)=>{let ne=te.get("debitAmount").value||0;return ee+ne},0),mt=a.controls.reduce((ee,te)=>{let ne=te.get("creditAmount").value||0;return ee+ne},0);this.subtotalDebit+=s,this.subtotalCredit+=mt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((o,[a,s])=>(a==="date"?o[a]=s instanceof Date?this.dayjsService.format(s):s:a==="forms"?o.form=s:o[a]=s,o),{});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(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-acc-opening-balance-form"]],features:[q([k])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[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
|
+
width`,`calc(
|
|
3
|
+
100% - 243px
|
|
4
|
+
)`,`/* adjust width to fit the remaining space */
|
|
5
|
+
z-index`,"91","background-color","white",`/* added background */
|
|
6
|
+
/* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
|
|
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"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[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(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Ct,2,0,"ng-template",null,0,f)(3,Ft,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",4)),o&2&&p("scrollable",!0)},dependencies:[A,Y,S,ve,Ce,_e,Me,Te,Oe,X,Q,H,w,y,N,F,ze,V,O,J,R,je,B,D,G,W,Ee,We,qe],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var ot=t=>({"ng-invalid ng-dirty":t});function It(t,m){if(t&1){let e=C();i(0,"p-button",4),_("onClick",function(){b(e);let a=d();return h(a.verifyCredentials())}),r(1,"Verify"),n(),i(2,"p-button",4),_("onClick",function(){b(e);let a=d();return h(a.saveCredentials())}),r(3,"Update"),n()}}function Et(t,m){t&1&&(i(0,"div",12)(1,"h3",13),r(2,"Account"),n(),i(3,"small",14),r(4,"Configure Client ID and Client Secret"),n()())}function Tt(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,Et,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),r(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),r(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=d();l(4),p("formGroup",e.credentialForm),l(5),p("ngClass",oe(3,ot,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),p("ngClass",oe(5,ot,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var rt=(()=>{class t{constructor(e,o){this.fb=e,this.messageService=o,this.setupService=u(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(I(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[le.required]],clientSecret:["",[le.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:o=>{console.log("Verify result:",o),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:o=>{console.error("Verify failed:",o),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(o){return new(o||t)(ie(P),ie(k))}}static{this.\u0275cmp=x({type:t,selectors:[["app-api-credential"]],features:[q([k])],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(o,a){o&1&&(i(0,"app-main-panel",3),g(1,It,4,0,"ng-template",null,0,f)(3,Tt,15,7,"ng-template",null,1,f),n())},dependencies:[S,he,B,w,y,N,D,G,F,K,J,R,A,V,O,Ue],encapsulation:2})}}return t})();function Mt(t,m){if(t&1){let e=C();i(0,"button",4),_("click",function(){b(e);let a=d();return h(a.onFormatJournal())}),r(1," Format "),n()}}function wt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),r(3,"Journal Configuration"),n(),i(4,"small",15),r(5," Enter your account information to format journal entries "),n()()())}function Nt(t,m){if(t&1){let e=C();i(0,"div",5)(1,"p-panel"),g(2,wt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),be("ngModelChange",function(a){b(e);let s=d();return ge(s.subdomain,a)||(s.subdomain=a),h(a)}),n(),i(8,"label",10),r(9,"Subdomain"),n()(),i(10,"small",11),r(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=d();l(7),fe("ngModel",e.subdomain)}}var at=(()=>{class t{constructor(){this.setupService=u(v),this.subdomain=j(""),this.toastrService=u(Fe)}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(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[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(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Mt,2,0,"ng-template",null,0,f)(3,Nt,12,1,"ng-template",null,1,f),n())},dependencies:[S,H,w,y,Ie,F,K,A,J,R,$e,Le],encapsulation:2})}}return t})();var lt=()=>u(v).fetchOpeningBalanceFormConfiguration();var di=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"journal-tag",loadComponent:()=>import("./chunk-JGRTH5OW.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-BPZ7LLVJ.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-FXWKWGGZ.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:tt},{path:"opening-balance-form",component:it,resolve:{data:lt}},{path:"api-crendetial",component:rt},{path:"format-journal",component:at},{path:"closing-entries",loadComponent:()=>import("./chunk-Y3UB475V.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-7UGQCTEO.js").then(t=>t.ClosingFormComponent)}]}];export{di as ACCOUNTING_SETUP_ROUTES};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as un}from"./chunk-
|
|
1
|
+
import{a as un}from"./chunk-FYFSBGP3.js";import{a as qn}from"./chunk-KIBBRAL5.js";import{a as Xn}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as Fn}from"./chunk-H7Q35Y7G.js";import{a as $n}from"./chunk-R7N6BWL5.js";import{b as Wn}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-Q5CVMJZC.js";import"./chunk-MFK5RQPJ.js";import{b as jn}from"./chunk-KJ2WX3FC.js";import{a as Dn}from"./chunk-6GN3MGBY.js";import{a as Vn}from"./chunk-Q24GCSGD.js";import{b as Yn,c as Ti}from"./chunk-VGNJD35F.js";import{b as Gn}from"./chunk-2XUSZCQL.js";import{c as Mn}from"./chunk-ARH3WEEF.js";import{a as et,c as An,f as ai,o as Bn,p as Rn,t as Hn,u as Si,w as Nn,x as oi}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{Da as si,G as Sn,Ia as Ln,J as Tn,Ja as kn,K as Pn,Ka as zn,La as ri,Ma as ge,P as Ie,Q as _t,R as Nt,S as En,Ua as Je,b as mn,e as fn,f as gn,h as hn,ia as On,j as vn,k as wn,ma as In,p as bn,q as yn,r as _n,s as Cn,w as ni,x as xn}from"./chunk-OIBDX2CA.js";import{b as rn,d as an,e as on,f as ln,l as Ht}from"./chunk-AOOG6YOT.js";import{a as cn,c as Mi}from"./chunk-R7TX5W65.js";import{a as pn}from"./chunk-2MKKFLNJ.js";import{H as sn,h as ct,j as ii,k as Ft,l as Bt,m as Rt,n as tn,s as we,t as Oe,z as nn}from"./chunk-VZ5CMS5O.js";import{c as dn,d as _i,f as Ci,h as xi}from"./chunk-F2X3VGZZ.js";import{$b as ve,$c as Vt,Aa as We,Ab as Qi,Ba as Wi,Bb as Ke,Cc as Ze,Da as qi,Db as X,Dc as Ji,Ea as xe,Ec as pe,Fa as wt,Fc as Be,Gc as ti,Ha as Ee,Kb as Z,La as Ui,Lb as $,Nb as Ki,Nc as Dt,Ob as Qt,Oc as $t,Pb as ye,Qb as Kt,Rb as Zt,Rc as dt,Tb as Jt,Ub as ei,Vb as G,W as Xi,Wb as N,Xb as te,Yb as at,Zb as ot,_b as Me,_c as pt,ba as Yi,bd as en,ca as Ye,cb as bi,da as je,db as qe,ec as ie,fc as H,gc as bt,hb as R,hc as lt,ia as ae,kc as fe,lc as yt,mc as ne,nb as Ue,nc as se,pa as ji,qa as U,qc as Lt,ra as Q,rc as le,s as wi,sb as Ut,sc as Fe,t as Gi,tc as yi,ua as Ae,uc as Zi,wc as kt,xb as he,xc as zt,yb as Qe,yc as At}from"./chunk-NMCKMUY4.js";import{a as me,b as It}from"./chunk-YQFG5XE2.js";var sr=["*"],rr=({dt:i})=>`
|
|
2
2
|
.p-inputgroup,
|
|
3
3
|
.p-inputgroup .p-floatlabel,
|
|
4
4
|
.p-inputgroup .p-iftalabel {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ve,b as Ae}from"./chunk-NCDT6JPP.js";import{b as De}from"./chunk-JYEZYL2U.js";import{a as je}from"./chunk-XKI7WLHE.js";import{a as Fe,b as Me}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as N,b as H}from"./chunk-3A4BFUGD.js";import{d as ye,i as ke,j as Ie,k as Te}from"./chunk-EL5BUFMO.js";import{a as we,b as ve}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as D}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as Pe}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import{a as xe,b as he}from"./chunk-2XUSZCQL.js";import{a as h,b as _e,c as Ee,d as Re,e as be,f as Se,g as Ce}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as fe,x as ge}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{c as L,e as le,f as pe,l as ce,o as me,u as de,x as ue}from"./chunk-OIBDX2CA.js";import{e as oe,l as ae}from"./chunk-AOOG6YOT.js";import{a as se}from"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as Z,j as ee,k as te,p as ie,q as ne,s as re}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as F,Bb as K,Cc as Q,D as U,Db as _,Dc as W,Ec as j,L as B,Lb as f,Nc as V,Ob as z,Oc as X,P as G,Pc as Y,Rc as b,Vb as a,Wb as o,Xb as E,Y as I,_ as T,bd as A,c as k,ca as q,ec as M,fc as x,hb as u,ia as g,qa as w,ra as v,rc as m,s as P,sc as R,tc as J,xb as $}from"./chunk-NMCKMUY4.js";import{a as s,b as c}from"./chunk-YQFG5XE2.js";var y=(()=>{class t{constructor(){this.httpService=g(se)}getPostRecurringExpenseLoader(){return this.httpService.get(void 0,"api/RecurringExpenseLoader/RecurringExpensesGenerate")}previewPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGeneratePreview",e)}submitPostRecurringExpense(e){return this.httpService.post(void 0,"api/RecurringExpense/RecurringExpensesGenerate",e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=q({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ne={data:{data:[]},meta:{options:{expenses:[]},form:{date:"",number:"",listIDs:[]}},filter:{date:"",number:"",listIDs:[]}},O=_e(Se(Ne),Ce("PostRecurringExpenseStore"),Ee(t=>({hasCheckedRows:A(()=>t.data().data.some(p=>p.checked)),checkedPRE:A(()=>t.data().data.filter(p=>p.checked))})),be(t=>{let p=g(y);return{updateFilter:i=>{h(t,n=>c(s({},n),{filter:s(s({},n.filter),i)}))},emptyData(){h(t,i=>c(s({},i),{data:{data:[],totalCount:0}}))},onRowSelect(i){h(t,n=>{let r=n.data.data.map(l=>l.lastExpenseDate===i.lastExpenseDate?c(s({},l),{checked:!0}):l);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onRowUnselect(i){h(t,n=>{let r=n.data.data.map(l=>l.lastExpenseDate===i.lastExpenseDate?c(s({},l),{checked:!1}):l);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){h(t,n=>{let r=n.data.data.map(l=>c(s({},l),{checked:i}));return c(s({},n),{data:c(s({},n.data),{data:r})})})},getPRELoader:N(k(I(()=>p.getPostRecurringExpenseLoader().pipe(H({next:i=>{h(t,n=>c(s({},n),{meta:i}))},error:i=>{console.error("Error fetching PRE Loader:",i)}}))))),getPREPreview:N(k(U(i=>i.date&&i.listIDs.length>0),P(i=>({Date:i.date,Number:i.number,ListIDs:i.listIDs})),I(i=>p.previewPostRecurringExpense(i).pipe(P(n=>c(s({},n),{data:n.data.map(r=>c(s({},r),{checked:!1}))})),H({next:n=>{h(t,r=>c(s({},r),{data:n}))},error:n=>{console.error("Error fetching PRE Preview:",n)}})))))}}),Re(t=>({onInit:()=>{t.getPRELoader(),t.getPREPreview(t.filter)}})));var He=()=>({height:"calc(100vh - 70px)"}),Oe=t=>({"ng-invalid ng-dirty":t}),Ue=t=>["/pages/recurring/recurring-expense/details/",t];function Be(t,p){if(t&1){let e=F();a(0,"p-button",7),M("onClick",function(){w(e);let n=x(2);return v(n.onSubmitPRE())}),o()}}function Ge(t,p){if(t&1&&_(0,Be,1,0,"p-button",6),t&2){let e=x();f("ngIf",e.store.hasCheckedRows())}}function qe(t,p){if(t&1&&(a(0,"div")(1,"span",19),m(2),o()()),t&2){let e=p.$implicit;u(2),R(e)}}function $e(t,p){if(t&1&&(a(0,"div"),_(1,qe,3,1,"div",18),o()),t&2){let e=x(2);u(),f("ngForOf",e.getErrors("listIDs"))}}function Ke(t,p){t&1&&(a(0,"tr")(1,"th",20),E(2,"p-tableHeaderCheckbox"),o(),a(3,"th"),m(4,"Name"),o(),a(5,"th"),m(6,"Date"),o(),a(7,"th"),m(8,"Asset Account"),o(),a(9,"th"),m(10,"Expense Account"),o(),a(11,"th",21),m(12,"Amount"),o()())}function ze(t,p){if(t&1&&(a(0,"tr")(1,"td"),E(2,"p-tableCheckbox",22),o(),a(3,"td")(4,"a",23),m(5),o()(),a(6,"td"),m(7),V(8,"date"),o(),a(9,"td"),m(10),o(),a(11,"td"),m(12),o(),a(13,"td",21),m(14),V(15,"number"),o()()),t&2){let e=p.$implicit;u(2),f("value",e),u(2),f("routerLink",j(12,Ue,e.id)),u(),J(" ",e.name," "),u(2),R(Y(8,7,e.nextExpenseDate,"d MMM y")),u(3),R(e.paymentName),u(2),R(e.expenseName),u(2),R(X(15,10,e.amount))}}function Je(t,p){t&1&&(a(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function Qe(t,p){if(t&1){let e=F();a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12)(6,"label",13),m(7,"Date"),o(),E(8,"p-datepicker",14),o()(),a(9,"div",11)(10,"div",12)(11,"label",13),m(12,"Recurring Expense"),o(),E(13,"p-multiselect",15),_(14,$e,2,1,"div",16),o()()()()(),E(15,"p-divider"),a(16,"p-table",17),M("onRowSelect",function(n){w(e);let r=x();return v(r.onRowSelect(n))})("onRowUnselect",function(n){w(e);let r=x();return v(r.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){w(e);let r=x();return v(r.onHeaderCheckboxToggle(n))}),_(17,Ke,13,0,"ng-template",null,2,b)(19,ze,16,14,"ng-template",null,3,b)(21,Je,4,0,"ng-template",null,4,b),o()()}if(t&2){let e=x();z(W(7,He)),u(),f("formGroup",e.form),u(12),f("ngClass",j(8,Oe,e.isInvalid("listIDs")))("options",e.store.meta().options.expenses),u(),f("ngIf",e.isInvalid("listIDs")),u(2),f("value",e.store.data().data)}}var Lt=(()=>{class t extends je{constructor(){super(),this.store=g(O),this.fb=g(de),this.dayjsService=g(De),this.PREService=g(y)}ngOnInit(){this.initForm(),this.form.valueChanges.pipe(B(300),G(),D("Form Value Changes"),P(e=>Object.entries(e).reduce((i,[n,r])=>{switch(n){case"date":typeof r=="object"&&r!==null&&!Array.isArray(r)?i[n]=this.dayjsService.from(r)?this.dayjsService.format(r):null:(typeof r=="string"||typeof r=="number"||r instanceof Date)&&!Array.isArray(r)?i[n]=r!=null?String(r):null:i[n]=null;break;default:i[n]=r===null?"":r;break}return i},{})),D("Mapped Form Value"),T(e=>{(!e.listIDs||e.listIDs.length===0)&&this.store.emptyData(),this.store.updateFilter(e)})).subscribe()}initForm(){let{date:e,listIDs:i,number:n}=this.store.filter();this.form=this.fb.group({date:this.fb.control(this.dayjsService.from(e)?this.dayjsService.from(e).toDate():this.dayjsService.now.toDate(),[L.required]),number:this.fb.control(n||""),listIDs:this.fb.control(i,[L.required])})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(i=>{this.store.onRowUnselect(i)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onSubmitPRE(){console.log(this.store.checkedPRE());let i=this.store.checkedPRE().reduce((r,l)=>(r[l.id]||(r[l.id]={ID:l.id,ListDate:[]}),r[l.id].ListDate.push(l.lastExpenseDate),r),{}),n=Object.values(i);console.log("Submitting PRE with body:",n),this.PREService.submitPostRecurringExpense(n).pipe(D("Submit Post Recurring Expense"),T(()=>{let r=this.form.getRawValue(),l=Object.entries(r).reduce((S,[C,d])=>{switch(C){case"date":typeof d=="object"&&d!==null&&!Array.isArray(d)?S[C]=this.dayjsService.from(d)?this.dayjsService.format(d):null:(typeof d=="string"||typeof d=="number"||d instanceof Date)&&!Array.isArray(d)?S[C]=d!=null?String(d):null:S[C]=null;break;default:S[C]=d===null?"":d;break}return S},{});this.store.updateFilter(l)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["app-post-recurring-expense"]],features:[Q([O]),K],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["emptymessage",""],["pageTitle","Post Recurring Expense",3,"scrollable"],["label","Submit",3,"onClick",4,"ngIf"],["label","Submit",3,"onClick"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"row"],[1,"col"],[1,"d-flex","flex-column"],["for",""],["fluid","","formControlName","date"],["display","chip","formControlName","listIDs","optionLabel","name","optionValue","id","placeholder","Select Recurring Expenses","fluid","",3,"ngClass","options"],[4,"ngIf"],["dataKey","lastExpenseDate",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[4,"ngFor","ngForOf"],[1,"text-danger"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["colspan","6"]],template:function(i,n){i&1&&(a(0,"app-main-panel",5),_(1,Ge,1,1,"ng-template",null,0,b)(3,Qe,23,10,"ng-template",null,1,b),o()),i&2&&f("scrollable",!0)},dependencies:[Pe,re,Z,ee,te,ne,ie,he,xe,Ae,Ve,ve,we,Me,Fe,ue,le,pe,ce,me,Te,ye,ke,Ie,ge,fe,ae,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Lt as PostRecurringExpenseComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-R7TX5W65.js";import{z as n}from"./chunk-VZ5CMS5O.js";import{ca as a,ia as i}from"./chunk-NMCKMUY4.js";var d=(()=>{class e{constructor(){this.httpService=i(o)}journalTagList({pageNumber:t,pageSize:r}={}){let u={params:new n().set("pageNumber",t).set("pageSize",r)};return this.httpService.get(void 0,"/api/journalTag/list",u)}journalTagCreate(t){return this.httpService.post(void 0,"/api/journalTag",t)}journalTagGet(t){return this.httpService.get(void 0,`/api/journalTag?ID=${t}`)}journalTagUpdate(t,r){return this.httpService.put(void 0,`/api/journalTag?ID=${r}`,t)}journalTagDelete(t){return this.httpService.delete(void 0,`/api/journaltag?ID=${t}`)}journalTagInfo(t){return this.httpService.get(void 0,`/api/journaltag?ID=${t}`)}journalTagMigrate(){return this.httpService.post(void 0,"/api/JournalTag/migrate",{})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as X}from"./chunk-IZCYMXSH.js";import{d as W,i as q,j as K,k as G}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Q}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as O}from"./chunk-Y2PXP5OT.js";import"./chunk-VGNJD35F.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as B}from"./chunk-H6HNANYB.js";import{a as N,b as U}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{k as I}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as T,Db as h,Ec as A,Ha as b,L as R,Lb as d,Qb as v,Rc as _,Vb as i,Wb as o,Xb as w,Y as J,_ as k,bd as S,cd as H,ec as x,fc as r,hb as f,ia as D,qa as m,ra as c,rc as u,s as j,sc as V,vc as F,wc as M,xb as E,xc as z,yc as P}from"./chunk-NMCKMUY4.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0)}}function re(t,p){if(t&1&&h(0,le,9,6,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(Q("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows","scrollable"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,G,W,q,K,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as rt}from"./chunk-4TTCPL3N.js";import{ca as it}from"./chunk-NMCKMUY4.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
1
|
+
import{c as rt}from"./chunk-R7TX5W65.js";import{ca as it}from"./chunk-NMCKMUY4.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-QKRPHDSG.js";import"./chunk-JYEZYL2U.js";import{a as E,b as O}from"./chunk-VJ3IBUVO.js";import"./chunk-KJ2WX3FC.js";import{h as H}from"./chunk-Y2PXP5OT.js";import{b as N,c as G}from"./chunk-VGNJD35F.js";import{a as R,b as D}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as V,x as j}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-R7TX5W65.js";import{a as I}from"./chunk-2MKKFLNJ.js";import{n as A,s as F}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as P,Cc as $,Db as B,Dc as _,Lb as p,Nc as m,Ob as d,Oc as l,Rc as x,Vb as o,W as y,Wb as n,Xb as c,Y as M,_ as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as C,s as u,sa as S,ta as k,xb as w}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Fe,b as ke}from"./chunk-
|
|
1
|
+
import{a as Fe,b as ke}from"./chunk-ZYDAEVQY.js";import{a as _e,b as ve,c as be,d as xe,e as Ce,f as ye}from"./chunk-XD7VHCRC.js";import"./chunk-NCDT6JPP.js";import{a as he}from"./chunk-XKI7WLHE.js";import{a as fe,b as ge}from"./chunk-EB6NEJHF.js";import{a as se}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import"./chunk-R7N6BWL5.js";import{a as oe,b as re}from"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-Q24GCSGD.js";import{h as ue}from"./chunk-Y2PXP5OT.js";import{b as ce,c as de}from"./chunk-VGNJD35F.js";import{a as pe,b as me}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as ie,o as ne,w as ae,x as le}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{b as L,c as H,e as J,f as K,k as Q,l as W,m as X,n as Y,o as Z,u as ee,x as te}from"./chunk-OIBDX2CA.js";import{b as z,d as U}from"./chunk-AOOG6YOT.js";import"./chunk-R7TX5W65.js";import"./chunk-2MKKFLNJ.js";import{h as B,j as $,k as j,s as q}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as O,Bb as P,Db as f,Dc as v,Ec as b,Ha as A,Lb as a,Ob as _,Pb as y,Rb as F,Rc as T,Tb as k,Ub as M,Vb as i,Vc as V,Wb as n,Xb as g,Y as I,_ as C,ec as w,fc as d,hb as r,ia as c,qa as G,ra as E,rc as h,sc as S,tc as R,ua as N,xb as D}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var Ie=()=>({height:"calc(100vh - 70px)"}),Ge=t=>({"ng-invalid ng-dirty":t}),Me=t=>({"ps-0":t}),Se=()=>({display:"flex"});function Ee(t,l){if(t&1){let e=O();i(0,"p-button",4),w("onClick",function(){G(e);let p=d(2);return E(p.onSubmit())}),n()}}function Ne(t,l){if(t&1&&f(0,Ee,1,0,"p-button",3),t&2){let e=d();a("ngIf",e.roleService.user().edit)}}function Ae(t,l){if(t&1&&(i(0,"div")(1,"span",16),h(2),n()()),t&2){let e=l.$implicit;r(2),S(e)}}function De(t,l){if(t&1&&(i(0,"div"),f(1,Ae,3,1,"div",15),n()),t&2){let e=d(2);r(),a("ngForOf",e.getErrors("name"))}}function Pe(t,l){if(t&1&&(i(0,"div",25)(1,"div",26),g(2,"p-checkbox",27),i(3,"p",28),h(4),n()()()),t&2){let e=l.$implicit,o=l.$index;a("formGroupName",o)("pTooltip",e.get("description").value),r(2),_(v(6,Se)),a("binary",!0),r(2),R(" ",e.get("name").value," ")}}function Oe(t,l){if(t&1&&(i(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),h(4),n()(),g(5,"p-checkbox",22),n(),i(6,"div",23)(7,"div",24),k(8,Pe,5,7,"div",25,F),n()()()),t&2){let e=l.$implicit,o=l.$index,p=d(3);a("formGroupName",o),r(4),S(e.get("groupName").value),r(),_(v(5,Se)),a("binary",!0),r(3),M(p.getRolesArray(o).controls)}}function we(t,l){if(t&1&&(i(0,"div",17),k(1,Oe,10,6,"div",18,F),n()),t&2){let e=d(2);r(),M(e.rolesFormArray.controls)}}function Re(t,l){if(t&1&&(i(0,"p-panel")(1,"div",5),g(2,"app-user-tabs"),i(3,"form",6),g(4,"input",7),f(5,De,2,1,"div",8),n(),i(6,"p-tabs",9)(7,"p-tablist")(8,"p-tab",9),h(9,"Permission"),n(),i(10,"p-tab",10),h(11,"Description"),n()(),i(12,"p-tabpanels",11)(13,"p-tabpanel",9)(14,"form",6),f(15,we,3,0,"div",12),n()(),i(16,"p-tabpanel",10)(17,"div",13),g(18,"textarea",14),n()()()()()()),t&2){let e=d();_(v(13,Ie)),r(3),a("formGroup",e.form),r(),a("fluid",!0)("ngClass",b(14,Ge,e.isInvalid("name"))),r(),a("ngIf",e.isInvalid("name")),r(3),y(b(16,Me,e.router.url.includes("forms"))),r(2),y(b(18,Me,e.router.url.includes("forms"))),r(4),a("formGroup",e.form),r(),a("ngIf",e.rolesFormArray.length>0),r(2),a("formGroup",e.form)}}var ut=(()=>{class t extends he{constructor(){super(...arguments),this.service=c(Fe),this.fb=c(ee),this.cdr=c(V),this.route=c(z),this.router=c(U),this.roleService=c(se),this.form=this.fb.group({groupID:this.fb.control(""),name:this.fb.control("",[H.required]),description:this.fb.control(""),roles:this.fb.array([])}),this.groupFormMeta=A(null)}ngOnInit(){this.route.queryParamMap.pipe(I(e=>this.service.getGroupFormMeta(e.get("groupID")).pipe(C(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(p=>{let s=this.fb.array(p.roles.map(m=>this.fb.group({id:this.fb.control(m.id),name:this.fb.control(m.name),checked:this.fb.control({value:e.form.rolesID.includes(m.id),disabled:!this.roleService.user().edit}),description:this.fb.control(m.description||"")}))),u=this.fb.group({groupName:this.fb.control(p.name),groupChecked:this.fb.control(!1),roles:s}),Te=s.controls.every(m=>m.get("checked").value);u.get("groupChecked").setValue(Te,{emitEvent:!1}),this.roleService.user().edit?u.get("groupChecked").enable():u.get("groupChecked").disable(),u.get("groupChecked").valueChanges.subscribe(m=>{s.controls.forEach(x=>{x.get("checked").setValue(m,{emitEvent:!1})})}),s.valueChanges.subscribe(()=>{let m=s.controls.every(x=>x.get("checked").value);u.get("groupChecked").setValue(m,{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(s=>{s.get("checked").value&&e.push(s.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(C(()=>{this.router.navigate(["/pages/users/groups"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(p){return(e||(e=N(t)))(p||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-group-form"]],features:[P],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Group Form",3,"overflowScroll"],["label","Submit",3,"onClick",4,"ngIf"],["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"],[4,"ngIf"],["value","0"],["value","1"],[2,"padding-left","0"],["formArrayName","roles","class","container-fluid d-flex flex-column row-gap-3",4,"ngIf"],[3,"formGroup"],["formControlName","description","fluid","","rows","5","cols","30","pTextarea",""],[4,"ngFor","ngForOf"],[1,"text-danger"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[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,p){o&1&&(i(0,"app-main-panel",2),f(1,Ne,1,1,"ng-template",null,0,T)(3,Re,19,20,"ng-template",null,1,T),n()),o&2&&a("overflowScroll",!0)},dependencies:[ue,re,oe,te,Q,L,J,K,W,Z,X,Y,q,B,$,j,ne,ie,ye,Ce,xe,be,_e,ve,ge,fe,le,ae,ke,me,pe,de,ce],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{ut as GroupFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-QKRPHDSG.js";import"./chunk-JYEZYL2U.js";import{a as I,b as E}from"./chunk-VJ3IBUVO.js";import"./chunk-KJ2WX3FC.js";import{h as H}from"./chunk-Y2PXP5OT.js";import{b as N,c as G}from"./chunk-VGNJD35F.js";import{a as R,b as D}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as V,x as j}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-R7TX5W65.js";import{a as F}from"./chunk-2MKKFLNJ.js";import{n as O,s as $}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as B,Cc as P,Db as w,Dc as _,Lb as p,Nc as s,Ob as h,Oc as m,Rc as x,Vb as o,W as y,Wb as n,Xb as l,Y as M,_ as b,ec as C,fc as c,h as T,hb as a,ia as f,qa as g,ra as d,s as u,sa as S,ta as A,xb as k}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.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(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
|