dealposbooks 6.1.2 → 6.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-NMOIUA6X.js → chunk-22GTG56L.js} +1 -1
- package/{chunk-FN4UAN7G.js → chunk-2E2HT3G5.js} +2 -2
- package/{chunk-FT3TVNWY.js → chunk-3Q6VBWXR.js} +1 -1
- package/{chunk-ITZG65LC.js → chunk-73M5VV2Y.js} +1 -1
- package/{chunk-ONEE4PD6.js → chunk-AG7MURVY.js} +1 -1
- package/{chunk-OBPYHPHW.js → chunk-AVNVVDXY.js} +1 -1
- package/{chunk-JSCEZN7L.js → chunk-B4UNNPAU.js} +1 -1
- package/{chunk-QKOOQ5C6.js → chunk-BCFRVBMG.js} +1 -1
- package/{chunk-JHBRCP5H.js → chunk-BD42UNO7.js} +1 -1
- package/{chunk-ET2CSJP4.js → chunk-BLFO3FHK.js} +1 -1
- package/{chunk-UA3NWMTR.js → chunk-BM3SPWC6.js} +1 -1
- package/{chunk-E5DM3TCW.js → chunk-DFTKFA3Q.js} +1 -1
- package/{chunk-YDWQDJEA.js → chunk-DT4J6BJG.js} +1 -1
- package/{chunk-UOXEXJ2S.js → chunk-DZJWXSSZ.js} +1 -1
- package/{chunk-K32QD3HY.js → chunk-ETAZENRK.js} +1 -1
- package/{chunk-V5TE2DDF.js → chunk-FC2OFTSU.js} +1 -1
- package/{chunk-T7VWZPHW.js → chunk-FT4EOTCS.js} +1 -1
- package/{chunk-QJD5K4TQ.js → chunk-G4TD4COA.js} +1 -1
- package/{chunk-OSGJ7FIK.js → chunk-G776QR46.js} +1 -1
- package/{chunk-VF5FAVF2.js → chunk-GJZ7UP2Z.js} +1 -1
- package/chunk-GP65NEEZ.js +1 -0
- package/{chunk-KX5T5GT4.js → chunk-HLUS7VO7.js} +1 -1
- package/{chunk-SOIFEV7G.js → chunk-HZ2BHCDG.js} +1 -1
- package/{chunk-GTX34ZM3.js → chunk-I56EP26W.js} +1 -1
- package/{chunk-3ZUNX7VU.js → chunk-ISXXTIWY.js} +1 -1
- package/{chunk-N2BMSGXB.js → chunk-JEV5ISTD.js} +1 -1
- package/{chunk-DESK3OTZ.js → chunk-JLMT37T7.js} +1 -1
- package/{chunk-IV6U6FEE.js → chunk-JW2NI65U.js} +1 -1
- package/{chunk-BIOJKKEJ.js → chunk-KC5M3DIA.js} +1 -1
- package/{chunk-B3O26J3M.js → chunk-KTLFZGMU.js} +1 -1
- package/{chunk-KH66PYZ6.js → chunk-KTLNMY4J.js} +2 -2
- package/{chunk-IY6CYYHW.js → chunk-LAOZNPHR.js} +1 -1
- package/{chunk-5BR6MXLX.js → chunk-LFVQ3Z3B.js} +1 -1
- package/{chunk-QEGANYLE.js → chunk-LQ4SNQGQ.js} +1 -1
- package/{chunk-WOL3MISH.js → chunk-MBJAFQLX.js} +1 -1
- package/{chunk-SBY42MRN.js → chunk-NJ7NKOXH.js} +1 -1
- package/{chunk-UIAMVGX6.js → chunk-ONBCSOWF.js} +1 -1
- package/{chunk-TP3VPXGY.js → chunk-PDCLVUQ2.js} +1 -1
- package/{chunk-62IWOTCR.js → chunk-Q6QCIP3G.js} +1 -1
- package/{chunk-FMUAKMQ5.js → chunk-RF7QNTVC.js} +1 -1
- package/{chunk-JOMQZ2PR.js → chunk-S22DJH3N.js} +1 -1
- package/{chunk-WUFTR2A3.js → chunk-SEXX6JCY.js} +1 -1
- package/{chunk-BIWU6LQ4.js → chunk-SKLOI6YA.js} +1 -1
- package/{chunk-COGLGLZN.js → chunk-TKCJYGJ7.js} +1 -1
- package/{chunk-BXBME2GW.js → chunk-UDT72757.js} +1 -1
- package/{chunk-S5BG5EGL.js → chunk-VB2L2RLZ.js} +1 -1
- package/{chunk-6KZDDZJR.js → chunk-VGUBFW74.js} +1 -1
- package/{chunk-SL4B7NII.js → chunk-VXLFY653.js} +1 -1
- package/{chunk-AZBEWVID.js → chunk-WAZHYVUK.js} +1 -1
- package/{chunk-GD3XKRKO.js → chunk-WXEWVEA2.js} +1 -1
- package/{chunk-X5H54AB7.js → chunk-XBX5EZLG.js} +1 -1
- package/{chunk-URW7SXYE.js → chunk-XSIUVYDW.js} +1 -1
- package/{chunk-JP63AHXQ.js → chunk-Y2WTQGRZ.js} +1 -1
- package/{chunk-TDKHCTOJ.js → chunk-Y3DRKZYY.js} +1 -1
- package/{chunk-R7JOHC7X.js → chunk-YWHNYO5G.js} +1 -1
- package/{chunk-FFTAVKXN.js → chunk-ZXOOUYEE.js} +2 -2
- package/index.html +1 -1
- package/{main-M7FIUNAZ.js → main-VPM6ZDQZ.js} +1 -1
- package/package.json +1 -1
- package/chunk-MTBBYR5X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk-THW7B5DI.js";import{m as K}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as V,b as I}from"./chunk-YKC7ERDO.js";import{b as ee,g as te,h as ne,i as ie}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as Z}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-THW7B5DI.js";import{m as K}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as V,b as I}from"./chunk-YKC7ERDO.js";import{b as ee,g as te,h as ne,i as ie}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as Z}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as C,c as G,d as J,e as Q,f as W,g as X,h as Y}from"./chunk-3BPX4XM7.js";import{H as O,I as q}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{e as $}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{q as A,t as L}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as R,Ic as F,Mb as h,Nb as S,Sb as b,Sc as D,T,Tb as o,Ub as l,Uc as H,V as N,Vb as P,Wc as _,_c as E,ac as k,c as y,da as u,db as d,fc as M,gc as p,ka as f,la as x,s as z,ub as B,vc as m,wc as w,zc as j}from"./chunk-T6YHDD6J.js";import{a as c,b as s}from"./chunk-PRARYYF3.js";var oe={data:[],count:0,filter:{PageSize:20,PageNumber:1}},U=G(X(oe),Y("Closing Entries Store"),J(e=>({first:E(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:E(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.count())),hasCheckedRows:E(()=>e.data().some(r=>r.checked)),selectedItems:E(()=>e.data().filter(r=>r.checked))})),W(e=>{let r=u(v),t={updateFilter:n=>{C(e,i=>s(c({},i),{filter:c(c({},i.filter),n)}))},onRowSelect(n){C(e,i=>{let a=i.data.map(g=>g.id===n.id?s(c({},g),{checked:!0}):g);return s(c({},i),{data:a})})},onRowUnselect(n){C(e,i=>{let a=i.data.map(g=>g.id===n.id?s(c({},g),{checked:!1}):g);return s(c({},i),{data:a})})},onHeaderCheckboxToggle(n){C(e,i=>{let a=i.data.map(g=>s(c({},g),{checked:n}));return s(c({},i),{data:a})})},getClosingEntries:V(y(T(n=>r.getClosingEntries(n).pipe(z(i=>i.map(a=>s(c({},a),{checked:!1}))),I({next:i=>{C(e,a=>s(c({},a),{data:i})),t.getClosingEntryCount()},error:i=>{console.error("Error fetching closing entries:",i)}}))))),getClosingEntryCount:V(y(T(()=>r.getClosingEntryCount().pipe(I({next:({count:n})=>{C(e,i=>s(c({},i),{count:n}))},error:n=>{console.error("Error fetching closing entry count:",n)}})))))};return t}),Q(e=>({onInit:()=>{e.getClosingEntries(e.filter)}})));function re(e,r){if(e&1){let t=k();o(0,"p-button",10),M("onClick",function(){f(t);let i=p(3);return x(i.onDeleteClosingEntries())}),l()}}function ae(e,r){if(e&1&&h(0,re,1,0,"p-button",9),e&2){let t=p(2);S(t.store.hasCheckedRows()?0:-1)}}function le(e,r){e&1&&(o(0,"a",8),P(1,"i",11),m(2," Add"),l())}function ce(e,r){if(e&1&&(o(0,"div",7),h(1,ae,1,1),h(2,le,3,0,"a",8),l()),e&2){let t=p();d(),S(t.roleService.permissions().accountingSetup.delete?1:-1),d(),S(t.roleService.permissions().accountingSetup.create?2:-1)}}function se(e,r){e&1&&(o(0,"th",13),P(1,"p-tableHeaderCheckbox"),l())}function pe(e,r){if(e&1&&(o(0,"tr"),h(1,se,2,0,"th",13),o(2,"th"),m(3,"Period"),l(),o(4,"th"),m(5,"Note"),l(),o(6,"th"),m(7,"Created"),l(),o(8,"th"),m(9,"CreatedBy"),l()()),e&2){let t=p(2);d(),S(t.roleService.permissions().accountingSetup.delete?1:-1)}}function me(e,r){if(e&1&&(o(0,"td"),P(1,"p-tableCheckbox",14),l()),e&2){let t=p().$implicit;d(),b("value",t)}}function de(e,r){if(e&1&&(o(0,"tr"),h(1,me,2,1,"td"),o(2,"td"),m(3),D(4,"date"),l(),o(5,"td"),m(6),l(),o(7,"td"),m(8),D(9,"date"),l(),o(10,"td"),m(11),l()()),e&2){let t=r.$implicit,n=p(2);d(),S(n.roleService.permissions().accountingSetup.delete?1:-1),d(2),w(H(4,5,t.period,"d MMM y")),d(3),w(t.note),d(2),w(H(9,8,t.created,"d MMM y")),d(3),w(t.creatorName)}}function ge(e,r){if(e&1&&m(0),e&2){let t=p(2);j(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.count()," entries ")}}function _e(e,r){e&1&&(o(0,"tr")(1,"td",15)(2,"span"),m(3," No journal entries found. "),l()()())}function Ce(e,r){if(e&1){let t=k();o(0,"p-table",12),M("onPage",function(i){f(t);let a=p();return x(a.onPageChange(i))})("onRowSelect",function(i){f(t);let a=p();return x(a.onRowSelect(i))})("onRowUnselect",function(i){f(t);let a=p();return x(a.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){f(t);let a=p();return x(a.onHeaderCheckboxToggle(i))}),R(1,pe,10,1,"ng-template",null,2,_)(3,de,12,11,"ng-template",null,3,_)(5,ge,1,3,"ng-template",null,4,_)(7,_e,4,0,"ng-template",null,5,_),l()}if(e&2){let t=p();b("value",t.store.data())("paginator",!0)("totalRecords",t.store.count())("lazy",!0)("rows",t.store.filter().PageSize)("scrollHeight","calc(100vh - 142px)")}}var Ae=(()=>{class e{constructor(){this.store=u(U),this.closingEntryService=u(v),this.roleService=u(K)}onPageChange(t){let n=t.first/t.rows+1;this.store.updateFilter(s(c({},this.store.filter()),{PageSize:n}))}onRowSelect(t){this.store.onRowSelect(t.data)}onRowUnselect(t){if(Array.isArray(t.data)){t.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(t.data)}onHeaderCheckboxToggle(t){this.store.onHeaderCheckboxToggle(t.checked)}onDeleteClosingEntries(){let t=this.store.selectedItems().map(n=>n.id).join(",");console.log("Deleting closing entries with IDs:",t),this.closingEntryService.deleteClosingEntry(t).pipe(N(()=>{this.store.updateFilter(c({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=B({type:e,selectors:[["app-closing-page"]],features:[F([U])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Closing Entries List",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","create",1,"p-button"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"fa-solid","fa-plus"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollHeight"],[2,"width","1rem"],[3,"value"],["colspan","5"]],template:function(n,i){n&1&&(o(0,"app-main-panel",6),R(1,ce,3,2,"ng-template",null,0,_)(3,Ce,9,6,"ng-template",null,1,_),l()),n&2&&b("scrollable",!0)},dependencies:[Z,L,ie,ee,te,ne,$,q,O,A],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{Ae as ClosingPageComponent};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as Oe,b as je}from"./chunk-YBZNHUZR.js";import{a as Je,b as ze}from"./chunk-QVBTMKUV.js";import{a as Ue,b as He}from"./chunk-NNU2L44G.js";import{a as Ge}from"./chunk-HOVGLXVU.js";import{a as S}from"./chunk-SFVYLTAA.js";import{a as Ne}from"./chunk-
|
|
1
|
+
import{a as Oe,b as je}from"./chunk-YBZNHUZR.js";import{a as Je,b as ze}from"./chunk-QVBTMKUV.js";import{a as Ue,b as He}from"./chunk-NNU2L44G.js";import{a as Ge}from"./chunk-HOVGLXVU.js";import{a as S}from"./chunk-SFVYLTAA.js";import{a as Ne}from"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import"./chunk-5TAKHYWV.js";import{m as z}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as Pe,g as Ve,h as Be,i as X}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as ke,b as Ie}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Re}from"./chunk-TTIQSVQF.js";import{a as De,b as Ee}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as Me}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as v}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as k,b as I}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as M,I as Q,y as K,z as E}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{Ta as D,b as T,c as pe,e as A,f as U,j as we,n as Te,o as Ae,p as H,q as W,v as $,x as L,y as q}from"./chunk-OQDKL2MG.js";import{b as Se}from"./chunk-7NZRUZLK.js";import{a as Fe}from"./chunk-WDFE7CAE.js";import{a as ye}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{i as be,r as ve,t as J}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as _,Ac as N,Bc as G,Cc as O,I as fe,Ic as j,Jc as ae,Kc as le,Mb as y,Nb as F,Ob as Ce,Pb as ge,Qb as oe,Rb as ie,Sb as h,Sc as ce,Tb as i,Tc as me,U as he,Ub as r,V,Vb as C,Wc as d,_ as _e,_c as se,ac as g,da as p,db as s,e as de,fc as x,gc as l,ka as u,la as f,nb as ne,s as ue,tc as re,ub as b,vc as a,wa as B,wc as xe,xc as w}from"./chunk-T6YHDD6J.js";import{a as R,b as P}from"./chunk-PRARYYF3.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),y(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),F(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datepicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",27),a(2),r(),i(3,"td"),C(4,"input",28),r(),i(5,"td"),C(6,"input",29),r()()),t&2){let e,n=c.$implicit,o=c.$index,m=l(4);h("formGroupName",o),s(2),w(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),oe(14,mt,7,2,"tr",10,ge),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);h("formGroupName",n),s(2),w(" ",e.get("name").value," "),s(12),ie(o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),_(1,ct,4,0,"ng-template",null,2,d),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),oe(6,st,16,2,"div",10,Ce),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),ce(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),ce(21,"number"),r()()()()()()),t&2){let e=l(2);re(ae(11,it)),h("formGroup",e.formGroups),s(4),re(ae(12,rt)),s(2),ie(e.formsArray.controls),s(10),w(" ",me(17,7,e.subtotalDebit)," "),s(4),w(" ",me(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&y(0,pt,22,13,"p-panel",7),t&2){let e=l();F(e.formGroups?0:-1)}}var Le=(()=>{class t{constructor(){this.destroy$=new de,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p($),this.accSetupService=p(S),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(Se),this.roleService=p(z)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(fe(300),he(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ue(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),tt=o.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
|
|
2
2
|
width`,`calc(
|
|
3
3
|
100% - 243px
|
|
4
4
|
)`,`/* adjust width to fit the remaining space */
|
|
5
5
|
z-index`,"91","background-color","white",`/* added background */
|
|
6
6
|
/* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
|
|
7
7
|
padding`,"8px 0",`/* added padding for height */
|
|
8
|
-
border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-V5TE2DDF.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-E5DM3TCW.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-ET2CSJP4.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-ITZG65LC.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-SOIFEV7G.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-FMUAKMQ5.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-NMOIUA6X.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-QEGANYLE.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
|
|
8
|
+
border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["dateFormat","dd M yy","fluid","","formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,lt,2,1,"ng-template",null,0,d)(3,dt,1,1,"ng-template",null,1,d),r(),C(5,"p-toast",4)),n&2&&h("scrollable",!0)},dependencies:[v,Me,J,Ie,ke,X,Ee,De,L,T,A,U,E,Je,Q,M,I,k,Ge,q,W,H,Te,Ae,He,Ue,ve],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){u(e);let o=l();return f(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),_(2,ht,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),h("formGroup",e.credentialForm),s(5),h("ngClass",le(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),h("ngClass",le(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(S)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(ne($),ne(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,ft,4,0,"ng-template",null,0,d)(3,_t,15,7,"ng-template",null,1,d),r())},dependencies:[J,be,q,T,A,U,W,H,E,K,I,k,v,Q,M,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){u(e);let o=l(2);return f(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&y(0,Ct,2,0,"button",4),t&2){let e=l();F(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),_(2,xt,6,0,"ng-template",null,2,d),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){u(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),f(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(S),this.subdomain=B(""),this.toastrService=p(ye),this.roleService=p(z)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),_(1,gt,1,1,"ng-template",null,0,d)(3,bt,12,1,"ng-template",null,1,d),r())},dependencies:[L,T,A,we,E,K,v,I,k,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(S).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(Fe)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function vt(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){u(e);let o=l(2);return f(o.onFlushCached())}),r()()}}function St(t,c){if(t&1&&y(0,vt,2,0,"div",5),t&2){let e=l();F(e.isAnyCacheSelected?0:-1)}}function yt(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function Ft(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),h("value",e),s(2),w(" ",e.label," "),s(2),xe(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){u(e);let m=l();return f(m.onRowSelect(o))})("onRowUnselect",function(o){u(e);let m=l();return f(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){u(e);let m=l();return f(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){u(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),f(o)}),_(1,yt,7,0,"ng-template",null,2,d)(3,Ft,7,3,"ng-template",null,3,d),r()}if(t&2){let e=l();h("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=se(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=se(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),_(1,St,1,1,"ng-template",null,0,d)(3,wt,5,6,"ng-template",null,1,d),r()),n&2&&h("overflowScroll",!0)("showCancelButton",!1)},dependencies:[v,X,Pe,Ve,Be,M],encapsulation:2})}}return t})();var Kn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-FC2OFTSU.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-DFTKFA3Q.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-BLFO3FHK.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-73M5VV2Y.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-HZ2BHCDG.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-RF7QNTVC.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-22GTG56L.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-LQ4SNQGQ.js").then(t=>t.ClosingFormComponent)}]}];export{Kn as ACCOUNTING_SETUP_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as K}from"./chunk-
|
|
1
|
+
import{a as y,b as K}from"./chunk-G776QR46.js";import"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{o as I,t as O}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as b,Mb as _,Nb as h,R as k,Sb as l,Sc as s,T as w,Tb as o,Tc as m,Ub as n,V as B,Vb as u,Wc as S,ac as x,da as c,db as r,f as M,fc as v,gc as a,ka as C,la as d,ma as P,na as $,s as g,tc as T,ub as A}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,f){if(t&1){let e=x();o(0,"p-button",6),v("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function W(t,f){if(t&1){let e=x();o(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,f){if(t&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ve=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(V),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(j)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.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(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[E([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[J,O,G,N,D,R,L,H,z,q,K,I],encapsulation:2})}}return t})();export{ve as CoaConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-XMARGQLT.js";import{a as K}from"./chunk-MDCWCEZ7.js";import{a as Y,b as H}from"./chunk-Y54QBXKN.js";import{a as U}from"./chunk-TTIQSVQF.js";import{h as Q}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-XMARGQLT.js";import{a as K}from"./chunk-MDCWCEZ7.js";import{a as Y,b as H}from"./chunk-Y54QBXKN.js";import{a as U}from"./chunk-TTIQSVQF.js";import{h as Q}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as W}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as O,y as A}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as R,c as k,e as z,f as G,p as P,q as V,v as B,y as q}from"./chunk-OQDKL2MG.js";import{b as w,d as J}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{i as M}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,C as h,F as T,J as b,Kc as N,Mb as x,Nb as _,Sb as a,T as g,Tb as n,Ub as o,V as v,Vb as m,Wc as y,ac as E,da as c,db as r,fc as j,gc as u,j as C,ka as S,la as I,ub as D,vc as l}from"./chunk-T6YHDD6J.js";import{a as d,b as f}from"./chunk-PRARYYF3.js";var X=t=>({"ng-invalid ng-dirty":t});function Z(t,s){if(t&1){let e=E();n(0,"div")(1,"p-button",3),j("onClick",function(){S(e);let p=u();return I(p.onSubmit())}),o()()}}function $(t,s){t&1&&(n(0,"div",22),l(1," Name is required "),o())}function ee(t,s){if(t&1&&(n(0,"div"),x(1,$,2,0,"div",22),o()),t&2){let e=u(2);r(),_(e.form.controls.name.errors.required?1:-1)}}function te(t,s){if(t&1&&(n(0,"p-panel",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"div",8)(5,"div",9)(6,"div",7)(7,"div",10)(8,"label",11),l(9,"Type Id"),o(),n(10,"div",12)(11,"div",13),m(12,"p-radiobutton",14),n(13,"label",15),l(14,"Generic"),o()(),n(15,"div",13),m(16,"p-radiobutton",16),n(17,"label",17),l(18,"Outlet"),o()()()(),m(19,"div",18),o(),n(20,"div",19)(21,"label",11),l(22,"Name"),o(),m(23,"input",20),x(24,ee,2,1,"div"),o()(),n(25,"div",9)(26,"div",19)(27,"label",11),l(28,"Description"),o(),m(29,"textarea",21),o()()()()()()()),t&2){let e=u();r(),a("formGroup",e.form),r(11),a("value",0),r(4),a("value",1),r(7),a("ngClass",N(6,X,e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched))),r(),_(e.form.controls.name.invalid&&(e.form.controls.name.dirty||e.form.controls.name.touched)?24:-1),r(5),a("autoResize",!0)}}var ye=(()=>{class t{constructor(){this.fb=c(B),this.journalTagService=c(L),this.route=c(w),this.router=c(J)}initForm(){console.log("Initializing form"),this.form=this.fb.group({name:this.fb.control("",[k.required]),description:this.fb.control(""),typeID:this.fb.control(!1)})}ngOnInit(){this.initForm(),this.route.queryParamMap.pipe(h(e=>e.has("id")),g(e=>this.journalTagService.journalTagGet(e.get("id"))),U("Query params"),v(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(b(1),g(i=>{let p=i.get("id");return p?this.journalTagService.journalTagUpdate(f(d({},e),{typeID:Number(e.typeID)}),p):this.journalTagService.journalTagCreate(f(d({},e),{typeID:Number(e.typeID)}))}),v(()=>{console.log("Journal tag saved successfully"),this.router.navigate(["/pages/accounting-setup/journal-tag"])}),T(i=>(console.error("Failed to save journal tag:",i),C))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({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,"row","row-gap-2"],[1,"col-10"],[1,"d-flex","flex-column","h-100"],["for",""],[1,"d-flex","h-100","align-items-center","gap-3"],[1,"d-flex","justify-content-center","gap-2"],["formControlName","typeID","inputId","typeID0","name","typeID",3,"value"],["for","typeID0",1,"m-0"],["formControlName","typeID","inputId","typeID1","name","typeID",3,"value"],["for","typeID1",1,"m-0"],[1,"my-2"],[1,"d-flex","flex-column"],["formControlName","name","pInputText","","size","small","type","text",2,"font-size","14px",3,"ngClass"],["cols","30","formControlName","description","pSize","large","pTextarea","","rows","2",2,"font-size","14px",3,"autoResize"],[1,"invalid-feedback","text-danger","d-block"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),F(1,Z,2,0,"ng-template",null,0,y)(3,te,30,8,"ng-template",null,1,y),o()),i&2&&a("hasMainWrapperPadding",!0)},dependencies:[Q,A,W,q,R,z,G,V,P,K,O,M,H,Y],encapsulation:2})}}return t})();export{ye as JournalTagFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-ISXXTIWY.js";import{a as o}from"./chunk-WDFE7CAE.js";import{_ as i,da as n}from"./chunk-T6YHDD6J.js";var d=(()=>{class r{constructor(){this.httpService=n(o),this.authService=n(u)}getJournalInvoiceLoader(){return this.httpService.get(void 0,"api/GenerateJournal/invoice/Loader")}getCustomerSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:t})}getJournalInvoice(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/invoice/get",t)}generateJournalInvoice(e){return this.httpService.post(void 0,"api/GenerateJournal/invoice/Submit",e)}getGJSupplierBillLoader(){return this.httpService.get(void 0,"api/GenerateJournal/bill/Loader")}getJournalSupplierBill(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/bill/get",t)}generateJournalSupplierBill(e){return this.httpService.post(void 0,"api/GenerateJournal/bill/Submit",e)}getGJShiftLoader(){return this.httpService.get(void 0,"api/GenerateJournal/Shift/Loader")}getJournalShift(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/Shift/get",t)}generateJornalShift(e){return this.httpService.post(void 0,"api/GenerateJournal/Shift/Submit",e)}getARJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinInvoice/Loader")}getARJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinInvoice/get",t)}createARJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinInvoice/Submit",e)}getAPJournalLoader(){return this.httpService.get(void 0,"/api/GenerateJournal/JoinBill/Loader")}getAPJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/JoinBill/get",t)}createAPJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/JoinBill/Submit",e)}getGJAdjustmentLoader(){return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/Loader")}getAdjustmentJournal(e){let t={params:e};return this.httpService.get(void 0,"api/GenerateJournal/InventoryAdjustment/get",t)}createAdjustmentJournal(e){return this.httpService.post(void 0,"api/GenerateJournal/InventoryAdjustment/Submit",e)}getSupplierSuggestions(e){let t={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:t})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=i({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-ISXXTIWY.js";import{a}from"./chunk-WDFE7CAE.js";import{_ as o,da as n}from"./chunk-T6YHDD6J.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-ONEE4PD6.js";import{a as He}from"./chunk-HOVGLXVU.js";import{a as ae}from"./chunk-3ZUNX7VU.js";import{a as Pe}from"./chunk-K32QD3HY.js";import"./chunk-OS646RNF.js";import{a as Be}from"./chunk-XKI7WLHE.js";import{a as ze}from"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import"./chunk-IEOE2XJ7.js";import{a as G,b as U}from"./chunk-YKC7ERDO.js";import{b as ke,g as Ne,h as Re,i as Me}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as Ie,b as Ve}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as De,c as Je}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as Fe}from"./chunk-URW7SXYE.js";import"./chunk-MTPMCC6U.js";import{a as Ce,b as be}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{a as ye,b as w,c as ve,d as je,e as Te,f as Ee,g as Ae}from"./chunk-3BPX4XM7.js";import{H as he,I as xe,J as Se,K as we,y as _e,z as ge}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as le,e as me,f as se,k as pe,p as de,q as ce,v as ue,y as fe}from"./chunk-OQDKL2MG.js";import"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-T7VWZPHW.js";import{i as ie,q as ne,r as oe,t as re}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$a as q,Ab as T,Ac as Y,Bc as B,Cc as Z,Ic as ee,Kc as D,Mb as y,Nb as v,Pb as E,Qb as A,Rb as F,Sb as u,Sc as J,T as M,Tb as a,Tc as te,Ub as r,Uc as H,V as W,Vb as x,Wc as C,_a as K,_c as j,ac as I,c as N,da as b,db as m,fc as V,gc as f,ka as g,la as h,s as R,ub as Q,vc as s,wa as P,wc as S,xc as z,zb as $,zc as X}from"./chunk-T6YHDD6J.js";import{a as p,b as c}from"./chunk-PRARYYF3.js";var Le={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},L=ve(Ae(Le),je(t=>({first:j(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:j(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:j(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:j(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),Ee(t=>{let l=b(k);return{updateFilter(n){w(t,i=>c(p({},i),{filter:p(p({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let o=i.data.data.map(d=>d.id===n.id?c(p({},d),{checked:!0}):d);return c(p({},i),{data:c(p({},i.data),{data:o})})})},onRowUnselect(n){w(t,i=>{let o=i.data.data.map(d=>d.id===n.id?c(p({},d),{checked:!1}):d);return c(p({},i),{data:c(p({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){w(t,i=>{let o=i.data.data.map(d=>c(p({},d),{checked:n}));return c(p({},i),{data:c(p({},i.data),{data:o})})})},getGJAdjustmentLoader:G(N(M(()=>l.getGJAdjustmentLoader().pipe(U({next:n=>{w(t,i=>c(p({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:G(N(R(n=>Object.entries(n).reduce((i,[o,d])=>(d!=null&&(i[o]=d),i),{})),M(n=>l.getAdjustmentJournal(n).pipe(R(i=>c(p({},i),{data:i.data.map(o=>c(p({},o),{checked:!1}))})),U({next:i=>{w(t,o=>c(p({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Te(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function Oe(t,l){if(t&1){let e=I();a(0,"p-button",10),V("onClick",function(){g(e);let i=f(2);return h(i.generateAdjusmentJournal())}),r()}}function We(t,l){if(t&1&&y(0,Oe,1,0,"p-button",9),t&2){let e=f();v(e.store.hasCheckedRows()?0:-1)}}function Ke(t,l){t&1&&(a(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),s(4,"Number"),r(),a(5,"th",14),s(6,"Date"),r(),a(7,"th",13),s(8,"Adjustment Qty"),r(),a(9,"th",15),s(10,"Type"),r(),a(11,"th",16),s(12,"State"),r(),a(13,"th",17),s(14,"Note"),r(),x(15,"th",18),r())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),x(2,"p-tableCheckbox",19),r(),a(3,"td")(4,"div",20)(5,"a",21),s(6),r(),x(7,"p-chip",22),r()(),a(8,"td"),s(9),J(10,"date"),r(),a(11,"td"),s(12),J(13,"number"),r(),a(14,"td"),s(15),r(),a(16,"td"),s(17),r(),a(18,"td"),x(19,"div",23),r(),a(20,"td"),x(21,"p-button",24),r()()),t&2){let e=l.$implicit,n=f(2);m(2),u("value",e),m(3),u("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,q),m(),z(" ",e.number," "),m(),u("label",e.outlet),m(2),S(H(10,12,e.date,"d MMM y")),m(3),S(te(13,15,e.quantitySUM)),m(3),S(e.type),m(2),S(e.state),m(2),u("innerHTML",e.note,K),m(2),u("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Qe(t,l){if(t&1&&s(0),t&2){let e=f(2);X(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",25)(2,"span"),s(3,"No records found."),r()()())}function Xe(t,l){if(t&1){let e=I();a(0,"p-panel")(1,"p-table",11),V("onHeaderCheckboxToggle",function(i){g(e);let o=f();return h(o.onHeaderCheckboxToggle(i))})("onPage",function(i){g(e);let o=f();return h(o.onPageChange(i))})("onRowSelect",function(i){g(e);let o=f();return h(o.onRowSelect(i))})("onRowUnselect",function(i){g(e);let o=f();return h(o.onRowUnselect(i))}),T(2,Ke,16,0,"ng-template",null,3,C)(4,qe,22,17,"ng-template",null,4,C)(6,Qe,1,3,"ng-template",null,5,C)(8,$e,4,0,"ng-template",null,6,C),r()()}if(t&2){let e=f();m(),u("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Ye(t,l){if(t&1&&(a(0,"span",34),s(1),J(2,"truncate"),r()),t&2){let e=l.$implicit;u("pTooltip",e.name),m(),z(" ",H(2,2,e.name,30)," ")}}function Ze(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function et(t,l){if(t&1&&(a(0,"div"),A(1,Ze,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("from"))}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function it(t,l){if(t&1&&(a(0,"div"),A(1,tt,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("to"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function ot(t,l){if(t&1&&(a(0,"div"),A(1,nt,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("pageSize"))}}function rt(t,l){if(t&1&&(a(0,"form",26)(1,"div",27)(2,"label",28),s(3,"Tag"),r(),a(4,"p-select",29),T(5,Ye,3,5,"ng-template",null,7,C),r()(),a(7,"div",27)(8,"label",28),s(9,"From - To"),r(),a(10,"div",30),x(11,"p-datepicker",31),y(12,et,3,0,"div"),x(13,"p-datepicker",32),y(14,it,3,0,"div"),r()(),a(15,"div",27)(16,"label",28),s(17,"Page Size"),r(),x(18,"input",33),y(19,ot,3,0,"div"),r()()),t&2){let e=f();u("formGroup",e.form),m(4),u("options",e.store.meta().options.outlets)("virtualScrollItemSize",50),m(7),u("iconDisplay","input")("ngClass",D(13,O,e.isInvalid("from")))("showIcon",!0),m(),v(e.isInvalid("from")?12:-1),m(),u("iconDisplay","input")("ngClass",D(15,O,e.isInvalid("to")))("showIcon",!0),m(),v(e.isInvalid("to")?14:-1),m(4),u("ngClass",D(17,O,e.isInvalid("pageSize"))),m(),v(e.isInvalid("pageSize")?19:-1)}}var Wt=(()=>{class t extends Be{constructor(){super(),this.store=b(L),this.authService=b(ae),this.isDialogFilterVisible=P(!1),this.isInitDialogFilterVisible=P(!1),this.generateJournalService=b(k),this.fb=b(ue),this.dayjsService=b(Pe)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,pageSize:d,export:_,exportPageNumber:Ge,exportPageSize:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),pageSize:this.fb.control(d),export:this.fb.control(_),exportPageNumber:this.fb.control(Ge),exportPageSize:this.fb.control(Ue)})}onSearch(e){this.store.updateFilter(c(p({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(p({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(W(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=Q({type:t,selectors:[["app-adjustment-journal"]],features:[ee([L]),$],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"filterConfirmed","search","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","isSearchableInput","scrollable"],["label","Generate Journal"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onHeaderCheckboxToggle","onPage","onRowSelect","onRowUnselect","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","14rem"],[2,"width","4rem"],[3,"value"],[1,"d-flex","flex-column","align-items-start","gap-1"],["target","_blank",1,"link","link-primary",3,"href"],[1,"p-1","px-2",3,"label"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","filter","","filterBy","name","formControlName","outletName","optionLabel","name","optionValue","name","placeholder","Select an Tag","showClear","","virtualScroll","",3,"options","virtualScrollItemSize"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","showClear","","styleClass","w-100",3,"iconDisplay","ngClass","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","showClear","","styleClass","w-100",3,"iconDisplay","ngClass","showIcon"],["appMaskNumber","","formControlName","pageSize","pInputText","","type","text",3,"ngClass"],[3,"pTooltip"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=I();a(0,"app-main-panel",8),V("filterConfirmed",function(){return g(o),h(i.onFilterOKEvent())})("search",function(_){return g(o),h(i.onSearch(_))}),Z("isDialogFilterVisibleChange",function(_){return g(o),B(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),h(_)})("isInitDialogFilterVisibleChange",function(_){return g(o),B(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),h(_)}),T(1,We,1,1,"ng-template",null,0,C)(3,Xe,10,5,"ng-template",null,1,C)(5,rt,20,19,"ng-template",null,2,C),r()}n&2&&(Y("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),u("isFilterable",!0)("isSearchableInput",!0)("scrollable",!0))},dependencies:[Fe,Me,ke,Ne,Re,re,ie,be,Ce,xe,he,Ve,Ie,Je,De,fe,pe,le,me,se,ce,de,ge,_e,we,Se,He,ze,oe,ne,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Wt as AdjustmentJournalComponent};
|
|
1
|
+
import{a as k}from"./chunk-AG7MURVY.js";import{a as He}from"./chunk-HOVGLXVU.js";import{a as ae}from"./chunk-ISXXTIWY.js";import{a as Pe}from"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import{a as Be}from"./chunk-XKI7WLHE.js";import{a as ze}from"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import"./chunk-IEOE2XJ7.js";import{a as G,b as U}from"./chunk-YKC7ERDO.js";import{b as ke,g as Ne,h as Re,i as Me}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as Ie,b as Ve}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as De,c as Je}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as Fe}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as Ce,b as be}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{a as ye,b as w,c as ve,d as je,e as Te,f as Ee,g as Ae}from"./chunk-3BPX4XM7.js";import{H as he,I as xe,J as Se,K as we,y as _e,z as ge}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{b as le,e as me,f as se,k as pe,p as de,q as ce,v as ue,y as fe}from"./chunk-OQDKL2MG.js";import"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{i as ie,q as ne,r as oe,t as re}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$a as q,Ab as T,Ac as Y,Bc as B,Cc as Z,Ic as ee,Kc as D,Mb as y,Nb as v,Pb as E,Qb as A,Rb as F,Sb as u,Sc as J,T as M,Tb as a,Tc as te,Ub as r,Uc as H,V as W,Vb as x,Wc as C,_a as K,_c as j,ac as I,c as N,da as b,db as m,fc as V,gc as f,ka as g,la as h,s as R,ub as Q,vc as s,wa as P,wc as S,xc as z,zb as $,zc as X}from"./chunk-T6YHDD6J.js";import{a as p,b as c}from"./chunk-PRARYYF3.js";var Le={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},L=ve(Ae(Le),je(t=>({first:j(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:j(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:j(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:j(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),Ee(t=>{let l=b(k);return{updateFilter(n){w(t,i=>c(p({},i),{filter:p(p({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let o=i.data.data.map(d=>d.id===n.id?c(p({},d),{checked:!0}):d);return c(p({},i),{data:c(p({},i.data),{data:o})})})},onRowUnselect(n){w(t,i=>{let o=i.data.data.map(d=>d.id===n.id?c(p({},d),{checked:!1}):d);return c(p({},i),{data:c(p({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){w(t,i=>{let o=i.data.data.map(d=>c(p({},d),{checked:n}));return c(p({},i),{data:c(p({},i.data),{data:o})})})},getGJAdjustmentLoader:G(N(M(()=>l.getGJAdjustmentLoader().pipe(U({next:n=>{w(t,i=>c(p({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:G(N(R(n=>Object.entries(n).reduce((i,[o,d])=>(d!=null&&(i[o]=d),i),{})),M(n=>l.getAdjustmentJournal(n).pipe(R(i=>c(p({},i),{data:i.data.map(o=>c(p({},o),{checked:!1}))})),U({next:i=>{w(t,o=>c(p({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Te(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function Oe(t,l){if(t&1){let e=I();a(0,"p-button",10),V("onClick",function(){g(e);let i=f(2);return h(i.generateAdjusmentJournal())}),r()}}function We(t,l){if(t&1&&y(0,Oe,1,0,"p-button",9),t&2){let e=f();v(e.store.hasCheckedRows()?0:-1)}}function Ke(t,l){t&1&&(a(0,"tr")(1,"th",12),x(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),s(4,"Number"),r(),a(5,"th",14),s(6,"Date"),r(),a(7,"th",13),s(8,"Adjustment Qty"),r(),a(9,"th",15),s(10,"Type"),r(),a(11,"th",16),s(12,"State"),r(),a(13,"th",17),s(14,"Note"),r(),x(15,"th",18),r())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),x(2,"p-tableCheckbox",19),r(),a(3,"td")(4,"div",20)(5,"a",21),s(6),r(),x(7,"p-chip",22),r()(),a(8,"td"),s(9),J(10,"date"),r(),a(11,"td"),s(12),J(13,"number"),r(),a(14,"td"),s(15),r(),a(16,"td"),s(17),r(),a(18,"td"),x(19,"div",23),r(),a(20,"td"),x(21,"p-button",24),r()()),t&2){let e=l.$implicit,n=f(2);m(2),u("value",e),m(3),u("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,q),m(),z(" ",e.number," "),m(),u("label",e.outlet),m(2),S(H(10,12,e.date,"d MMM y")),m(3),S(te(13,15,e.quantitySUM)),m(3),S(e.type),m(2),S(e.state),m(2),u("innerHTML",e.note,K),m(2),u("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Qe(t,l){if(t&1&&s(0),t&2){let e=f(2);X(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",25)(2,"span"),s(3,"No records found."),r()()())}function Xe(t,l){if(t&1){let e=I();a(0,"p-panel")(1,"p-table",11),V("onHeaderCheckboxToggle",function(i){g(e);let o=f();return h(o.onHeaderCheckboxToggle(i))})("onPage",function(i){g(e);let o=f();return h(o.onPageChange(i))})("onRowSelect",function(i){g(e);let o=f();return h(o.onRowSelect(i))})("onRowUnselect",function(i){g(e);let o=f();return h(o.onRowUnselect(i))}),T(2,Ke,16,0,"ng-template",null,3,C)(4,qe,22,17,"ng-template",null,4,C)(6,Qe,1,3,"ng-template",null,5,C)(8,$e,4,0,"ng-template",null,6,C),r()()}if(t&2){let e=f();m(),u("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Ye(t,l){if(t&1&&(a(0,"span",34),s(1),J(2,"truncate"),r()),t&2){let e=l.$implicit;u("pTooltip",e.name),m(),z(" ",H(2,2,e.name,30)," ")}}function Ze(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function et(t,l){if(t&1&&(a(0,"div"),A(1,Ze,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("from"))}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function it(t,l){if(t&1&&(a(0,"div"),A(1,tt,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("to"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",35),s(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function ot(t,l){if(t&1&&(a(0,"div"),A(1,nt,3,1,"div",null,E),r()),t&2){let e=f(2);m(),F(e.getErrors("pageSize"))}}function rt(t,l){if(t&1&&(a(0,"form",26)(1,"div",27)(2,"label",28),s(3,"Tag"),r(),a(4,"p-select",29),T(5,Ye,3,5,"ng-template",null,7,C),r()(),a(7,"div",27)(8,"label",28),s(9,"From - To"),r(),a(10,"div",30),x(11,"p-datepicker",31),y(12,et,3,0,"div"),x(13,"p-datepicker",32),y(14,it,3,0,"div"),r()(),a(15,"div",27)(16,"label",28),s(17,"Page Size"),r(),x(18,"input",33),y(19,ot,3,0,"div"),r()()),t&2){let e=f();u("formGroup",e.form),m(4),u("options",e.store.meta().options.outlets)("virtualScrollItemSize",50),m(7),u("iconDisplay","input")("ngClass",D(13,O,e.isInvalid("from")))("showIcon",!0),m(),v(e.isInvalid("from")?12:-1),m(),u("iconDisplay","input")("ngClass",D(15,O,e.isInvalid("to")))("showIcon",!0),m(),v(e.isInvalid("to")?14:-1),m(4),u("ngClass",D(17,O,e.isInvalid("pageSize"))),m(),v(e.isInvalid("pageSize")?19:-1)}}var Wt=(()=>{class t extends Be{constructor(){super(),this.store=b(L),this.authService=b(ae),this.isDialogFilterVisible=P(!1),this.isInitDialogFilterVisible=P(!1),this.generateJournalService=b(k),this.fb=b(ue),this.dayjsService=b(Pe)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,pageSize:d,export:_,exportPageNumber:Ge,exportPageSize:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),pageSize:this.fb.control(d),export:this.fb.control(_),exportPageNumber:this.fb.control(Ge),exportPageSize:this.fb.control(Ue)})}onSearch(e){this.store.updateFilter(c(p({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(p({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(W(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=Q({type:t,selectors:[["app-adjustment-journal"]],features:[ee([L]),$],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"filterConfirmed","search","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","isSearchableInput","scrollable"],["label","Generate Journal"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onHeaderCheckboxToggle","onPage","onRowSelect","onRowUnselect","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","14rem"],[2,"width","4rem"],[3,"value"],[1,"d-flex","flex-column","align-items-start","gap-1"],["target","_blank",1,"link","link-primary",3,"href"],[1,"p-1","px-2",3,"label"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","filter","","filterBy","name","formControlName","outletName","optionLabel","name","optionValue","name","placeholder","Select an Tag","showClear","","virtualScroll","",3,"options","virtualScrollItemSize"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","showClear","","styleClass","w-100",3,"iconDisplay","ngClass","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","showClear","","styleClass","w-100",3,"iconDisplay","ngClass","showIcon"],["appMaskNumber","","formControlName","pageSize","pInputText","","type","text",3,"ngClass"],[3,"pTooltip"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=I();a(0,"app-main-panel",8),V("filterConfirmed",function(){return g(o),h(i.onFilterOKEvent())})("search",function(_){return g(o),h(i.onSearch(_))}),Z("isDialogFilterVisibleChange",function(_){return g(o),B(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),h(_)})("isInitDialogFilterVisibleChange",function(_){return g(o),B(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),h(_)}),T(1,We,1,1,"ng-template",null,0,C)(3,Xe,10,5,"ng-template",null,1,C)(5,rt,20,19,"ng-template",null,2,C),r()}n&2&&(Y("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),u("isFilterable",!0)("isSearchableInput",!0)("scrollable",!0))},dependencies:[Fe,Me,ke,Ne,Re,re,ie,be,Ce,xe,he,Ve,Ie,Je,De,fe,pe,le,me,se,ce,de,ge,_e,we,Se,He,ze,oe,ne,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Wt as AdjustmentJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Te}from"./chunk-3ZUNX7VU.js";import{b as Oe}from"./chunk-G7M65KLU.js";import{m as ye}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as ne,b as ie}from"./chunk-YKC7ERDO.js";import{b as oe,g as Be,h as ze,i as ae}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as Je,b as De}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Ie}from"./chunk-TTIQSVQF.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as Me}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as te}from"./chunk-URW7SXYE.js";import"./chunk-MTPMCC6U.js";import{a as K,b as $}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as w,c as X,d as Y,e as Ve,f as Z,g as ee}from"./chunk-3BPX4XM7.js";import{H as Q,I as W,z as Ne}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{e as ve,f as Pe,k as Ue,p as ke,q as Ee,v as Fe,y as Re}from"./chunk-OQDKL2MG.js";import{e as G,l as xe}from"./chunk-7NZRUZLK.js";import{a as we}from"./chunk-WDFE7CAE.js";import{a as Se}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-T7VWZPHW.js";import{C as re,i as H,q as Ce,r as L,t as q}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as U,Ac as _e,Bc as ge,Cc as he,Ic as O,Jc as F,Kc as be,Lc as j,Mb as J,Nb as D,Sb as g,Sc as S,T as N,Tb as o,Tc as A,Ub as a,Uc as k,V,Vb as E,Wc as _,_ as me,_c as v,ac as T,c as R,da as f,db as m,fc as y,gc as d,ka as h,kc as de,la as b,lc as ue,mc as fe,s as se,tc as I,ub as M,vc as p,wa as ce,wc as x,xc as B,zc as z}from"./chunk-T6YHDD6J.js";import{a as s,b as c}from"./chunk-PRARYYF3.js";var P=(()=>{class t{constructor(){this.httpService=f(we)}getGenerateCoa(e){let n={params:new re().set("PageNumber",e.PageNumber).set("PageSize",e.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(e={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,e)}getUnbalanceJournal(e){let i=new re,n=(u,C)=>{C!=null&&C!==""&&(i=i.set(u,String(C)))};n("pageNumber",e.PageNumber),n("pageSize",e.PageSize),n("from",e.From),n("to",e.To),n("numberSearch",e.Number);let r=i.keys().length?{params:i}:{};return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal",r)}loadInitialUnbalanceJournal(){return this.httpService.get(void 0,"api/ToolsLoader/UnbalanceJurnal")}updateUnbalanceJournal(e){let i={ListID:e};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=me({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Le={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},le=X(ee(Le),Y(t=>({first:v(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:v(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count))})),Z(t=>{let l=f(P);return{updateFilter:i=>{w(t,n=>c(s({},n),{filter:s(s({},n.filter),i)}))},getUpdateCOA:ne(R(N(i=>l.getGenerateCoa(i).pipe(ie({next:n=>{w(t,r=>c(s({},r),{data:n}))},error:n=>{console.error(n)}})))))}}),Ve({onInit(t){t.getUpdateCOA(t.filter)}}));var Ke=()=>({height:"calc(100vh - 70px)"}),$e=()=>({"min-width":"50rem"}),Xe=(t,l)=>({"text-danger":t,"text-success":l});function Ye(t,l){if(t&1){let e=T();o(0,"p-button",8),y("onClick",function(){h(e);let n=d(2);return b(n.updateCoaBalance())}),a()}}function Ze(t,l){if(t&1&&J(0,Ye,1,0,"p-button",7),t&2){let e=d();D(e.roleService.permissions().tools.edit?0:-1)}}function et(t,l){t&1&&(o(0,"tr")(1,"th"),p(2,"Code"),a(),o(3,"th"),p(4,"Name"),a(),o(5,"th",10),p(6,"COA Balance"),a(),o(7,"th",10),p(8,"Correct Balance"),a(),o(9,"th",10),p(10,"Difference"),a()())}function tt(t,l){if(t&1&&(o(0,"tr")(1,"td"),p(2),a(),o(3,"td")(4,"a",11),p(5),a()(),o(6,"td",10),p(7),S(8,"number"),a(),o(9,"td",10),p(10),S(11,"number"),a(),o(12,"td",12),p(13),S(14,"number"),a()()),t&2){let e=l.$implicit;m(2),x(e.Code),m(2),g("routerLink","/pages/chart-of-account/account/"+e.ID),m(),x(e.Name),m(2),x(k(8,7,e.Balance,"1.0-0")),m(3),x(k(11,10,e.CorrectBalance,"1.0-0")),m(2),g("ngClass",j(16,Xe,e.CorrectBalance-e.Balance<0,e.CorrectBalance-e.Balance>0)),m(),B(" ",k(14,13,e.CorrectBalance-e.Balance,"1.0-0")," ")}}function nt(t,l){if(t&1&&(o(0,"div",13)(1,"p",14),p(2),a()()),t&2){let e=d(2);m(2),z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function it(t,l){t&1&&(o(0,"tr")(1,"td",15)(2,"span"),p(3,"No records found."),a()()())}function ot(t,l){if(t&1){let e=T();o(0,"p-panel")(1,"p-table",9),y("onPage",function(n){h(e);let r=d();return b(r.onPageChange(n))}),U(2,et,11,0,"ng-template",null,2,_)(4,tt,15,19,"ng-template",null,3,_)(6,nt,3,3,"ng-template",null,4,_)(8,it,4,0,"ng-template",null,5,_),a()()}if(t&2){let e=d();I(F(8,Ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().PageSize)("value",e.store.data().data)("tableStyle",F(9,$e))}}var Ae=(()=>{class t{constructor(){this.store=f(le),this.coaService=f(P),this.toastrService=f(Se),this.roleService=f(ye)}onPageChange(e){this.store.updateFilter(c(s({},this.store.filter()),{PageNumber:Math.floor(e.first/e.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ie("Update COA Balance"),V(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-tools-update-coa"]],features:[O([le])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end",3,"ngClass"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(i,n){i&1&&(o(0,"app-main-panel",6),U(1,Ze,1,1,"ng-template",null,0,_)(3,ot,10,10,"ng-template",null,1,_),a()),i&2&&g("scrollable",!0)},dependencies:[te,ae,oe,Me,q,H,W,Q,$,K,G,L],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} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return t})();var at={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20,From:"",To:"",Number:null}},pe=X(ee(at),Y(t=>({first:v(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:v(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count)),selectedItems:v(()=>t.data().data.filter(l=>l.checked)),hasCheckedRows:v(()=>t.data().data.some(l=>l.checked))})),Z(t=>{let l=f(P);return{updateFilter(i){w(t,n=>c(s({},n),{filter:s(s({},n.filter),i)}))},onRowSelect(i){w(t,n=>{let r=n.data.data.map(u=>u.id===i.id?c(s({},u),{checked:!0}):u);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onRowUnselect(i){w(t,n=>{let r=n.data.data.map(u=>u.id===i.id?c(s({},u),{checked:!1}):u);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){w(t,n=>{let r=n.data.data.map(u=>c(s({},u),{checked:i}));return c(s({},n),{data:c(s({},n.data),{data:r})})})},loadData:ne(R(N(i=>l.getUnbalanceJournal(i).pipe(se(n=>c(s({},n),{data:n.data.map(r=>c(s({},r),{checked:!1}))})),ie({next:n=>{w(t,r=>c(s({},r),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}));var rt=["dp"],lt=()=>({height:"calc(100vh - 70px)"}),pt=t=>["/pages/journal/journal-entry",t],st=(t,l)=>({"text-success":t,"text-danger":l});function mt(t,l){if(t&1){let e=T();o(0,"div",9),E(1,"p-button",10),o(2,"p-button",11),y("onClick",function(){h(e);let n=d(2);return b(n.regenerateUnbalanceJournal())}),p(3,"Regenerate"),a()()}}function ct(t,l){if(t&1&&J(0,mt,4,0,"div",9),t&2){let e=d();D(e.store.hasCheckedRows()?0:-1)}}function dt(t,l){t&1&&(o(0,"tr")(1,"th",13),E(2,"p-tableHeaderCheckbox"),a(),o(3,"th"),p(4,"Date"),a(),o(5,"th"),p(6,"Number"),a(),o(7,"th",14),p(8,"Debit SUM"),a(),o(9,"th",14),p(10,"Credit SUM"),a(),o(11,"th",14),p(12,"Difference"),a()())}function ut(t,l){if(t&1&&(o(0,"tr")(1,"td"),E(2,"p-tableCheckbox",15),a(),o(3,"td"),p(4),S(5,"date"),a(),o(6,"td")(7,"a",16),p(8),a()(),o(9,"td",14),p(10),S(11,"number"),a(),o(12,"td",14),p(13),S(14,"number"),a(),o(15,"td",17),p(16),S(17,"number"),a()()),t&2){let e=l.$implicit;m(2),g("value",e),m(2),x(k(5,8,e.date,"dd MMM yyyy")),m(3),g("routerLink",be(17,pt,e.id)),m(),x(e.number),m(2),x(A(11,11,e.debitSum)),m(3),x(A(14,13,e.creditSum)),m(2),g("ngClass",j(19,st,e.differences>0,e.differences<0)),m(),B(" ",A(17,15,e.differences)," ")}}function ft(t,l){if(t&1&&p(0),t&2){let e=d(2);z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function _t(t,l){t&1&&(o(0,"tr")(1,"td",18)(2,"span"),p(3,"No records found."),a()()())}function gt(t,l){if(t&1){let e=T();o(0,"p-panel")(1,"p-table",12),y("onHeaderCheckboxToggle",function(n){h(e);let r=d();return b(r.onHeaderCheckboxToggle(n))})("onPage",function(n){h(e);let r=d();return b(r.onPageChange(n))})("onRowSelect",function(n){h(e);let r=d();return b(r.onRowSelect(n))})("onRowUnselect",function(n){h(e);let r=d();return b(r.onRowUnselect(n))}),U(2,dt,13,0,"ng-template",null,3,_)(4,ut,18,22,"ng-template",null,4,_)(6,ft,1,3,"ng-template",null,5,_)(8,_t,4,0,"ng-template",null,6,_),a()()}if(t&2){let e=d();I(F(7,lt)),m(),g("lazy",!0)("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)("value",e.store.data().data)}}function ht(t,l){if(t&1){let e=T();o(0,"form",19)(1,"div",20)(2,"label",21),p(3,"From - To"),a(),o(4,"div",22)(5,"p-datepicker",23,7),y("click",function(){h(e);let n=d();return b(n.openCalendar())}),a(),E(7,"p-datepicker",24),a()()()}if(t&2){let e=d();g("formGroup",e.form),m(5),g("iconDisplay","input")("showIcon",!0)("showOnFocus",!1),m(2),g("iconDisplay","input")("showIcon",!0)}}var He=(()=>{class t{constructor(){this.store=f(pe),this.toolsService=f(P),this.authService=f(Te),this.fb=f(Fe),this.isFilterVisible=ce(!1)}ngOnInit(){this.initForm(),this.toolsService.loadInitialUnbalanceJournal().subscribe({next:e=>{let i=e?.filter;i&&(this.store.updateFilter({PageNumber:i.pageNumber??this.store.filter().PageNumber,PageSize:i.pageSize??this.store.filter().PageSize,From:i.from??this.store.filter().From,To:i.to??this.store.filter().To,Number:i.numberSearch??this.store.filter().Number}),this.form&&this.form.patchValue({PageNumber:i.pageNumber??this.form.value.PageNumber,PageSize:i.pageSize??this.form.value.PageSize,from:i.from??this.form.value.from,to:i.to??this.form.value.to,number:i.numberSearch??this.form.value.number}))}})}initForm(){this.form=this.fb.group({PageNumber:this.fb.control(1),PageSize:this.fb.control(20),from:this.fb.control(null),to:this.fb.control(null),number:this.fb.control(null)}),this.form&&this.isFilterVisible.set(!0)}onPageChange(e){let i=e.first/e.rows;this.store.updateFilter({PageNumber:i+1}),this.store.loadData(this.store.filter())}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)}regenerateUnbalanceJournal(){let i=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(i).pipe(V(n=>{n&&n.message&&this.store.loadData(this.store.filter())})).subscribe()}onFilterOKEvent(){let{PageNumber:e,PageSize:i,from:n,to:r,number:u}=this.form.value;this.store.updateFilter({PageNumber:e??this.store.filter().PageNumber,PageSize:i??this.store.filter().PageSize,From:n??this.store.filter().From,To:r??this.store.filter().To,Number:u??this.store.filter().Number}),this.store.loadData(this.store.filter()),this.isFilterVisible.update(C=>!C)}onSearch(e){this.store.updateFilter({Number:e}),this.store.loadData(this.store.filter())}openCalendar(){this.datePicker.overlayVisible=!0,setTimeout(()=>{let e=this.datePicker?.inputfieldViewChild?.nativeElement,i=document.querySelector(".p-datepicker-panel");e&&i&&(i.style.width=`${e.offsetWidth}px`)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-unbalance-journal"]],viewQuery:function(i,n){if(i&1&&de(rt,5),i&2){let r;ue(r=fe())&&(n.datePicker=r.first)}},features:[O([pe])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["dp",""],["pageTitle","Unbalance Journal",3,"filterConfirmed","search","isDialogFilterVisibleChange","isDialogFilterVisible","isFilterable","isSearchableInput","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["dataKey","id","paginatorStyleClass","d-flex justify-content-end",3,"onHeaderCheckboxToggle","onPage","onRowSelect","onRowUnselect","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end",3,"ngClass"],["colspan","6"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dataType","string","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","styleClass","w-100 mb-0",3,"click","iconDisplay","showIcon","showOnFocus"],["appendTo","body","dataType","string","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"]],template:function(i,n){if(i&1){let r=T();o(0,"app-main-panel",8),y("filterConfirmed",function(){return h(r),b(n.onFilterOKEvent())})("search",function(C){return h(r),b(n.onSearch(C))}),he("isDialogFilterVisibleChange",function(C){return h(r),ge(n.isFilterVisible,C)||(n.isFilterVisible=C),b(C)}),U(1,ct,1,1,"ng-template",null,0,_)(3,gt,10,8,"ng-template",null,1,_)(5,ht,8,6,"ng-template",null,2,_),a()}i&2&&(_e("isDialogFilterVisible",n.isFilterVisible),g("isFilterable",!0)("isSearchableInput",!0)("scrollable",!0))},dependencies:[te,ae,oe,Be,ze,Oe,Ne,q,H,Re,Ue,ve,Pe,Ee,ke,W,Q,$,K,xe,G,De,Je,L,Ce],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kn=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:Ae},{path:"unbalance-journal",component:He},{path:"journal-squash",loadComponent:()=>import("./chunk-TP3VPXGY.js").then(t=>t.JournalSquashComponent)},{path:"journal-squash-job",loadComponent:()=>import("./chunk-BIOJKKEJ.js").then(t=>t.SquashJobComponent)},{path:"journal-squash-job-detail/:id",loadComponent:()=>import("./chunk-JHBRCP5H.js").then(t=>t.JournalSquashInfoComponent)}];export{kn as TOOLS_ROUTES};
|
|
1
|
+
import{a as Te}from"./chunk-ISXXTIWY.js";import{b as Oe}from"./chunk-G7M65KLU.js";import{m as ye}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as ne,b as ie}from"./chunk-YKC7ERDO.js";import{b as oe,g as Be,h as ze,i as ae}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import{a as Je,b as De}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Ie}from"./chunk-TTIQSVQF.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as Me}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as te}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as K,b as $}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as w,c as X,d as Y,e as Ve,f as Z,g as ee}from"./chunk-3BPX4XM7.js";import{H as Q,I as W,z as Ne}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{e as ve,f as Pe,k as Ue,p as ke,q as Ee,v as Fe,y as Re}from"./chunk-OQDKL2MG.js";import{e as G,l as xe}from"./chunk-7NZRUZLK.js";import{a as we}from"./chunk-WDFE7CAE.js";import{a as Se}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{C as re,i as H,q as Ce,r as L,t as q}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as U,Ac as _e,Bc as ge,Cc as he,Ic as O,Jc as F,Kc as be,Lc as j,Mb as J,Nb as D,Sb as g,Sc as S,T as N,Tb as o,Tc as A,Ub as a,Uc as k,V,Vb as E,Wc as _,_ as me,_c as v,ac as T,c as R,da as f,db as m,fc as y,gc as d,ka as h,kc as de,la as b,lc as ue,mc as fe,s as se,tc as I,ub as M,vc as p,wa as ce,wc as x,xc as B,zc as z}from"./chunk-T6YHDD6J.js";import{a as s,b as c}from"./chunk-PRARYYF3.js";var P=(()=>{class t{constructor(){this.httpService=f(we)}getGenerateCoa(e){let n={params:new re().set("PageNumber",e.PageNumber).set("PageSize",e.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(e={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,e)}getUnbalanceJournal(e){let i=new re,n=(u,C)=>{C!=null&&C!==""&&(i=i.set(u,String(C)))};n("pageNumber",e.PageNumber),n("pageSize",e.PageSize),n("from",e.From),n("to",e.To),n("numberSearch",e.Number);let r=i.keys().length?{params:i}:{};return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal",r)}loadInitialUnbalanceJournal(){return this.httpService.get(void 0,"api/ToolsLoader/UnbalanceJurnal")}updateUnbalanceJournal(e){let i={ListID:e};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=me({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Le={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},le=X(ee(Le),Y(t=>({first:v(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:v(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count))})),Z(t=>{let l=f(P);return{updateFilter:i=>{w(t,n=>c(s({},n),{filter:s(s({},n.filter),i)}))},getUpdateCOA:ne(R(N(i=>l.getGenerateCoa(i).pipe(ie({next:n=>{w(t,r=>c(s({},r),{data:n}))},error:n=>{console.error(n)}})))))}}),Ve({onInit(t){t.getUpdateCOA(t.filter)}}));var Ke=()=>({height:"calc(100vh - 70px)"}),$e=()=>({"min-width":"50rem"}),Xe=(t,l)=>({"text-danger":t,"text-success":l});function Ye(t,l){if(t&1){let e=T();o(0,"p-button",8),y("onClick",function(){h(e);let n=d(2);return b(n.updateCoaBalance())}),a()}}function Ze(t,l){if(t&1&&J(0,Ye,1,0,"p-button",7),t&2){let e=d();D(e.roleService.permissions().tools.edit?0:-1)}}function et(t,l){t&1&&(o(0,"tr")(1,"th"),p(2,"Code"),a(),o(3,"th"),p(4,"Name"),a(),o(5,"th",10),p(6,"COA Balance"),a(),o(7,"th",10),p(8,"Correct Balance"),a(),o(9,"th",10),p(10,"Difference"),a()())}function tt(t,l){if(t&1&&(o(0,"tr")(1,"td"),p(2),a(),o(3,"td")(4,"a",11),p(5),a()(),o(6,"td",10),p(7),S(8,"number"),a(),o(9,"td",10),p(10),S(11,"number"),a(),o(12,"td",12),p(13),S(14,"number"),a()()),t&2){let e=l.$implicit;m(2),x(e.Code),m(2),g("routerLink","/pages/chart-of-account/account/"+e.ID),m(),x(e.Name),m(2),x(k(8,7,e.Balance,"1.0-0")),m(3),x(k(11,10,e.CorrectBalance,"1.0-0")),m(2),g("ngClass",j(16,Xe,e.CorrectBalance-e.Balance<0,e.CorrectBalance-e.Balance>0)),m(),B(" ",k(14,13,e.CorrectBalance-e.Balance,"1.0-0")," ")}}function nt(t,l){if(t&1&&(o(0,"div",13)(1,"p",14),p(2),a()()),t&2){let e=d(2);m(2),z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function it(t,l){t&1&&(o(0,"tr")(1,"td",15)(2,"span"),p(3,"No records found."),a()()())}function ot(t,l){if(t&1){let e=T();o(0,"p-panel")(1,"p-table",9),y("onPage",function(n){h(e);let r=d();return b(r.onPageChange(n))}),U(2,et,11,0,"ng-template",null,2,_)(4,tt,15,19,"ng-template",null,3,_)(6,nt,3,3,"ng-template",null,4,_)(8,it,4,0,"ng-template",null,5,_),a()()}if(t&2){let e=d();I(F(8,Ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().PageSize)("value",e.store.data().data)("tableStyle",F(9,$e))}}var Ae=(()=>{class t{constructor(){this.store=f(le),this.coaService=f(P),this.toastrService=f(Se),this.roleService=f(ye)}onPageChange(e){this.store.updateFilter(c(s({},this.store.filter()),{PageNumber:Math.floor(e.first/e.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ie("Update COA Balance"),V(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-tools-update-coa"]],features:[O([le])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end",3,"ngClass"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(i,n){i&1&&(o(0,"app-main-panel",6),U(1,Ze,1,1,"ng-template",null,0,_)(3,ot,10,10,"ng-template",null,1,_),a()),i&2&&g("scrollable",!0)},dependencies:[te,ae,oe,Me,q,H,W,Q,$,K,G,L],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} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return t})();var at={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20,From:"",To:"",Number:null}},pe=X(ee(at),Y(t=>({first:v(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:v(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().count)),selectedItems:v(()=>t.data().data.filter(l=>l.checked)),hasCheckedRows:v(()=>t.data().data.some(l=>l.checked))})),Z(t=>{let l=f(P);return{updateFilter(i){w(t,n=>c(s({},n),{filter:s(s({},n.filter),i)}))},onRowSelect(i){w(t,n=>{let r=n.data.data.map(u=>u.id===i.id?c(s({},u),{checked:!0}):u);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onRowUnselect(i){w(t,n=>{let r=n.data.data.map(u=>u.id===i.id?c(s({},u),{checked:!1}):u);return c(s({},n),{data:c(s({},n.data),{data:r})})})},onHeaderCheckboxToggle(i){w(t,n=>{let r=n.data.data.map(u=>c(s({},u),{checked:i}));return c(s({},n),{data:c(s({},n.data),{data:r})})})},loadData:ne(R(N(i=>l.getUnbalanceJournal(i).pipe(se(n=>c(s({},n),{data:n.data.map(r=>c(s({},r),{checked:!1}))})),ie({next:n=>{w(t,r=>c(s({},r),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}));var rt=["dp"],lt=()=>({height:"calc(100vh - 70px)"}),pt=t=>["/pages/journal/journal-entry",t],st=(t,l)=>({"text-success":t,"text-danger":l});function mt(t,l){if(t&1){let e=T();o(0,"div",9),E(1,"p-button",10),o(2,"p-button",11),y("onClick",function(){h(e);let n=d(2);return b(n.regenerateUnbalanceJournal())}),p(3,"Regenerate"),a()()}}function ct(t,l){if(t&1&&J(0,mt,4,0,"div",9),t&2){let e=d();D(e.store.hasCheckedRows()?0:-1)}}function dt(t,l){t&1&&(o(0,"tr")(1,"th",13),E(2,"p-tableHeaderCheckbox"),a(),o(3,"th"),p(4,"Date"),a(),o(5,"th"),p(6,"Number"),a(),o(7,"th",14),p(8,"Debit SUM"),a(),o(9,"th",14),p(10,"Credit SUM"),a(),o(11,"th",14),p(12,"Difference"),a()())}function ut(t,l){if(t&1&&(o(0,"tr")(1,"td"),E(2,"p-tableCheckbox",15),a(),o(3,"td"),p(4),S(5,"date"),a(),o(6,"td")(7,"a",16),p(8),a()(),o(9,"td",14),p(10),S(11,"number"),a(),o(12,"td",14),p(13),S(14,"number"),a(),o(15,"td",17),p(16),S(17,"number"),a()()),t&2){let e=l.$implicit;m(2),g("value",e),m(2),x(k(5,8,e.date,"dd MMM yyyy")),m(3),g("routerLink",be(17,pt,e.id)),m(),x(e.number),m(2),x(A(11,11,e.debitSum)),m(3),x(A(14,13,e.creditSum)),m(2),g("ngClass",j(19,st,e.differences>0,e.differences<0)),m(),B(" ",A(17,15,e.differences)," ")}}function ft(t,l){if(t&1&&p(0),t&2){let e=d(2);z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function _t(t,l){t&1&&(o(0,"tr")(1,"td",18)(2,"span"),p(3,"No records found."),a()()())}function gt(t,l){if(t&1){let e=T();o(0,"p-panel")(1,"p-table",12),y("onHeaderCheckboxToggle",function(n){h(e);let r=d();return b(r.onHeaderCheckboxToggle(n))})("onPage",function(n){h(e);let r=d();return b(r.onPageChange(n))})("onRowSelect",function(n){h(e);let r=d();return b(r.onRowSelect(n))})("onRowUnselect",function(n){h(e);let r=d();return b(r.onRowUnselect(n))}),U(2,dt,13,0,"ng-template",null,3,_)(4,ut,18,22,"ng-template",null,4,_)(6,ft,1,3,"ng-template",null,5,_)(8,_t,4,0,"ng-template",null,6,_),a()()}if(t&2){let e=d();I(F(7,lt)),m(),g("lazy",!0)("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)("value",e.store.data().data)}}function ht(t,l){if(t&1){let e=T();o(0,"form",19)(1,"div",20)(2,"label",21),p(3,"From - To"),a(),o(4,"div",22)(5,"p-datepicker",23,7),y("click",function(){h(e);let n=d();return b(n.openCalendar())}),a(),E(7,"p-datepicker",24),a()()()}if(t&2){let e=d();g("formGroup",e.form),m(5),g("iconDisplay","input")("showIcon",!0)("showOnFocus",!1),m(2),g("iconDisplay","input")("showIcon",!0)}}var He=(()=>{class t{constructor(){this.store=f(pe),this.toolsService=f(P),this.authService=f(Te),this.fb=f(Fe),this.isFilterVisible=ce(!1)}ngOnInit(){this.initForm(),this.toolsService.loadInitialUnbalanceJournal().subscribe({next:e=>{let i=e?.filter;i&&(this.store.updateFilter({PageNumber:i.pageNumber??this.store.filter().PageNumber,PageSize:i.pageSize??this.store.filter().PageSize,From:i.from??this.store.filter().From,To:i.to??this.store.filter().To,Number:i.numberSearch??this.store.filter().Number}),this.form&&this.form.patchValue({PageNumber:i.pageNumber??this.form.value.PageNumber,PageSize:i.pageSize??this.form.value.PageSize,from:i.from??this.form.value.from,to:i.to??this.form.value.to,number:i.numberSearch??this.form.value.number}))}})}initForm(){this.form=this.fb.group({PageNumber:this.fb.control(1),PageSize:this.fb.control(20),from:this.fb.control(null),to:this.fb.control(null),number:this.fb.control(null)}),this.form&&this.isFilterVisible.set(!0)}onPageChange(e){let i=e.first/e.rows;this.store.updateFilter({PageNumber:i+1}),this.store.loadData(this.store.filter())}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)}regenerateUnbalanceJournal(){let i=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(i).pipe(V(n=>{n&&n.message&&this.store.loadData(this.store.filter())})).subscribe()}onFilterOKEvent(){let{PageNumber:e,PageSize:i,from:n,to:r,number:u}=this.form.value;this.store.updateFilter({PageNumber:e??this.store.filter().PageNumber,PageSize:i??this.store.filter().PageSize,From:n??this.store.filter().From,To:r??this.store.filter().To,Number:u??this.store.filter().Number}),this.store.loadData(this.store.filter()),this.isFilterVisible.update(C=>!C)}onSearch(e){this.store.updateFilter({Number:e}),this.store.loadData(this.store.filter())}openCalendar(){this.datePicker.overlayVisible=!0,setTimeout(()=>{let e=this.datePicker?.inputfieldViewChild?.nativeElement,i=document.querySelector(".p-datepicker-panel");e&&i&&(i.style.width=`${e.offsetWidth}px`)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-unbalance-journal"]],viewQuery:function(i,n){if(i&1&&de(rt,5),i&2){let r;ue(r=fe())&&(n.datePicker=r.first)}},features:[O([pe])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["dp",""],["pageTitle","Unbalance Journal",3,"filterConfirmed","search","isDialogFilterVisibleChange","isDialogFilterVisible","isFilterable","isSearchableInput","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["dataKey","id","paginatorStyleClass","d-flex justify-content-end",3,"onHeaderCheckboxToggle","onPage","onRowSelect","onRowUnselect","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end",3,"ngClass"],["colspan","6"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dataType","string","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","styleClass","w-100 mb-0",3,"click","iconDisplay","showIcon","showOnFocus"],["appendTo","body","dataType","string","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"]],template:function(i,n){if(i&1){let r=T();o(0,"app-main-panel",8),y("filterConfirmed",function(){return h(r),b(n.onFilterOKEvent())})("search",function(C){return h(r),b(n.onSearch(C))}),he("isDialogFilterVisibleChange",function(C){return h(r),ge(n.isFilterVisible,C)||(n.isFilterVisible=C),b(C)}),U(1,ct,1,1,"ng-template",null,0,_)(3,gt,10,8,"ng-template",null,1,_)(5,ht,8,6,"ng-template",null,2,_),a()}i&2&&(_e("isDialogFilterVisible",n.isFilterVisible),g("isFilterable",!0)("isSearchableInput",!0)("scrollable",!0))},dependencies:[te,ae,oe,Be,ze,Oe,Ne,q,H,Re,Ue,ve,Pe,Ee,ke,W,Q,$,K,xe,G,De,Je,L,Ce],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kn=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:Ae},{path:"unbalance-journal",component:He},{path:"journal-squash",loadComponent:()=>import("./chunk-PDCLVUQ2.js").then(t=>t.JournalSquashComponent)},{path:"journal-squash-job",loadComponent:()=>import("./chunk-KC5M3DIA.js").then(t=>t.SquashJobComponent)},{path:"journal-squash-job-detail/:id",loadComponent:()=>import("./chunk-BD42UNO7.js").then(t=>t.JournalSquashInfoComponent)}];export{kn as TOOLS_ROUTES};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Oe}from"./chunk-
|
|
1
|
+
import{a as Oe}from"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import{a as Te,b as Se}from"./chunk-MDCWCEZ7.js";import{a as Ee}from"./chunk-TTIQSVQF.js";import{h as xe}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as we}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as ye}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{b as me,e as be}from"./chunk-7NZRUZLK.js";import{a as ve}from"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{q as de,r as ge}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as ue,C as ie,Kc as pe,Mb as dt,Nb as gt,Sb as mt,Sc as tt,T as se,Tb as p,Tc as fe,Ub as h,Uc as it,V as ne,Vb as B,Wc as ce,_ as _e,ac as le,da as H,db as R,fc as he,gc as X,ka as ae,la as re,s as Ct,ub as oe,vc as b,wa as Lt,wc as J,xc as V}from"./chunk-T6YHDD6J.js";import{a as At,b as Nt,e as y,g as Ii}from"./chunk-PRARYYF3.js";var bt=y((Gs,Re)=>{"use strict";function x(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}x.prototype.clone_empty=function(){var t=new x(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t};x.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]};x.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1};x.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};x.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};x.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};x.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1};x.prototype.is_empty=function(){return this.__items.length===0};x.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};x.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf(`
|
|
2
2
|
`);e!==-1?this.__character_count=t.length-e:this.__character_count+=t.length};x.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t};x.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)};x.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)};x.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1};x.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function st(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}st.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e,i};st.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e],i};st.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()};st.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)};function E(t,e){this.__indent_cache=new st(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new x(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}E.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)};E.prototype.get_line_number=function(){return this.__lines.length};E.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)};E.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)};E.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};E.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)};E.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&(e[e.length-1]===`
|
|
3
3
|
`&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
4
4
|
`);return t!==`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk-XMARGQLT.js";import{a as F}from"./chunk-OCKYXLYZ.js";import{a as q}from"./chunk-TTIQSVQF.js";import{h as R}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-XMARGQLT.js";import{a as F}from"./chunk-OCKYXLYZ.js";import{a as q}from"./chunk-TTIQSVQF.js";import{h as R}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as w}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as k}from"./chunk-U2ZZPRP6.js";import{b as P}from"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{b as E,d as D,e as M}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as C,C as g,Jc as b,Kc as I,Mb as h,Nb as j,Sb as u,T as f,Tb as n,Ub as o,V as _,Vb as y,Wc as m,ac as S,da as l,db as p,fc as J,gc as a,ka as x,la as T,ub as v,vc as r,wc as c}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var B=()=>["/pages/accounting-setup/journal-tag/form"],L=t=>({id:t});function W(t,s){if(t&1){let e=S();n(0,"div",3)(1,"p-button-group"),y(2,"p-button",4),n(3,"p-button",5),J("onClick",function(){x(e);let d=a();return T(d.onJournalTagDelete())}),o()()()}if(t&2){let e=a();p(2),u("routerLink",b(2,B))("queryParams",I(3,L,e.journalTag().id))}}function A(t,s){if(t&1&&(n(0,"div",6)(1,"div",7)(2,"p-panel",8)(3,"div",9)(4,"div",6)(5,"div",10),r(6,"Name"),o(),n(7,"div",10),r(8),o()(),n(9,"div",6)(10,"div",10),r(11,"Description"),o(),n(12,"div",10),r(13),o()()()()()()),t&2){let e=a(2);p(8),c(e.journalTag().name),p(5),c(e.journalTag().description)}}function G(t,s){if(t&1&&h(0,A,14,2,"div",6),t&2){let e=a();j(e.journalTag()?0:-1)}}var et=(()=>{class t{constructor(){this.journalTagService=l(V),this.route=l(E),this.router=l(D),this.journalTag=P(this.route.queryParamMap.pipe(g(e=>e.has("id")),f(e=>this.journalTagService.journalTagInfo(e.get("id"))),q("Journal Tag Info ")),{initialValue:null})}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTag().id).pipe(_(()=>this.router.navigate(["/pages/accounting-setup/journal-tag"]))).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-journal-tag-info"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Journal Tag Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",3,"routerLink","queryParams"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"row"],[1,"col-6"],["styleClass","rounded-2"],[1,"d-flex","flex-column","gap-2"],[1,"col"]],template:function(i,d){i&1&&(n(0,"app-main-panel",2),C(1,W,4,5,"ng-template",null,0,m)(3,G,1,1,"ng-template",null,1,m),o()),i&2&&u("hasMainWrapperPadding",!0)},dependencies:[R,w,F,k,M],encapsulation:2})}}return t})();export{et as JournalTagInfoComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as p}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{h as d}from"./chunk-
|
|
1
|
+
import{m as p}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{h as d}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import"./chunk-3BPX4XM7.js";import"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-FT4EOTCS.js";import"./chunk-ISLNIBSF.js";import{Ab as l,Tb as t,Ub as n,Vb as m,Wc as c,da as r,ub as a,vc as i}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";function f(e,u){e&1&&(t(0,"div",2),m(1,"img",3),t(2,"h1",4),i(3,"You are not authorized"),n(),t(4,"p",5),i(5," This page require "),t(6,"span",6),i(7,"Journal"),n(),i(8," role. Please contact your Administrator to gain access! "),n()())}var y=(()=>{class e{constructor(){this.roleService=r(p)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-forbidden"]],decls:3,vars:0,consts:[["content",""],["pageTitle","Unauthorized"],[1,"h-100","d-flex","flex-column","justify-content-center","align-items-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg","alt","Forbidden"],[1,"fs-6","fw-semibold"],[1,"fs-3"],[1,"fw-semibold"]],template:function(o,g){o&1&&(t(0,"app-main-panel",1),l(1,f,9,0,"ng-template",null,0,c),n())},dependencies:[d],encapsulation:2})}}return e})();export{y as ForbiddenComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y}from"./chunk-XMARGQLT.js";import{m as O}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as K,g as G,h as Q,i as X}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as q}from"./chunk-TTIQSVQF.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as W}from"./chunk-
|
|
1
|
+
import{a as Y}from"./chunk-XMARGQLT.js";import{m as O}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{b as K,g as G,h as Q,i as X}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as q}from"./chunk-TTIQSVQF.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{h as W}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as U}from"./chunk-U2ZZPRP6.js";import{a as B,b as A}from"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import{e as L}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as D,Ac as z,Bc as P,Cc as H,I as R,Kc as I,Mb as f,Nb as C,Sb as h,T as E,Tb as a,Ub as o,V as j,Vb as S,Wc as g,_c as k,ac as x,da as v,db as m,fc as b,gc as l,ka as _,la as d,s as J,ub as F,vc as p,wa as w,wc as y,za as M,zc as N}from"./chunk-T6YHDD6J.js";import{a as c,b as u}from"./chunk-PRARYYF3.js";var Z=["class","component"],$=t=>({id:t});function ee(t,r){if(t&1){let e=x();a(0,"p-button",10),b("onClick",function(){_(e);let n=l(2);return d(n.onMigrate())}),o()}}function te(t,r){if(t&1){let e=x();a(0,"p-button",14),b("onClick",function(){_(e);let n=l(3);return d(n.onJournalTagDelete())}),o()}}function ne(t,r){if(t&1&&(f(0,te,1,0,"p-button",11),a(1,"a",12),S(2,"i",13),p(3," Add"),o()),t&2){let e=l(2);C(e.journalTagsChecked().length>0?0:-1)}}function ie(t,r){if(t&1&&(a(0,"div",8),f(1,ee,1,0,"p-button",9),f(2,ne,4,1),o()),t&2){let e=l();m(),C(e.roleService.permissions().accountingSetup.delete?1:-1),m(),C(e.roleService.permissions().accountingSetup.create?2:-1)}}function ae(t,r){t&1&&(a(0,"div",15)(1,"h3",16),p(2," We will copy POS Outlet that are not yet registered as Tag in books.dealpos.app "),o()())}function oe(t,r){t&1&&(a(0,"th",19),S(1,"p-tableHeaderCheckbox"),o())}function le(t,r){if(t&1&&(a(0,"tr"),f(1,oe,2,0,"th",19),a(2,"th"),p(3,"Tag"),o(),a(4,"th"),p(5,"Description"),o(),a(6,"th"),p(7,"Type ID"),o()()),t&2){let e=l(3);m(),C(e.roleService.permissions().accountingSetup.delete?1:-1)}}function re(t,r){if(t&1&&(a(0,"td"),S(1,"p-tableCheckbox",21),o()),t&2){let e=l().$implicit;m(),h("value",e)}}function se(t,r){if(t&1&&(a(0,"tr"),f(1,re,2,1,"td"),a(2,"td")(3,"a",20),p(4),o()(),a(5,"td"),p(6),o(),a(7,"td"),p(8),o()()),t&2){let e=r.$implicit,i=l(3);m(),C(i.roleService.permissions().accountingSetup.delete?1:-1),m(2),h("queryParams",I(5,$,e.id)),m(),y(e.name),m(2),y(e.description),m(2),y(e.typeID===0?"Generic":"Outlet")}}function pe(t,r){if(t&1&&p(0),t&2){let e=l(3);N(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function ce(t,r){t&1&&(a(0,"tr")(1,"td",22)(2,"span"),p(3," No journal entries found. "),o()()())}function me(t,r){if(t&1){let e=x();a(0,"p-table",18),b("onHeaderCheckboxToggle",function(n){_(e);let s=l(2);return d(s.onHeaderCheckboxToggle(n))})("onPage",function(n){_(e);let s=l(2);return d(s.onPageChange(n))})("onRowSelect",function(n){_(e);let s=l(2);return d(s.onRowSelect(n))})("onRowUnselect",function(n){_(e);let s=l(2);return d(s.onRowUnselect(n))}),D(1,le,8,1,"ng-template",null,3,g)(3,se,9,7,"ng-template",null,4,g)(5,pe,1,3,"ng-template",null,5,g)(7,ce,4,0,"ng-template",null,6,g),o()}if(t&2){let e=l(2);h("lazy",!0)("paginator",!0)("rows",e.params().pageSize)("scrollable",!0)("totalRecords",e.journalTags().count)("value",e.journalTags().data)}}function _e(t,r){if(t&1&&f(0,me,9,6,"p-table",17),t&2){let e=l();C(e.journalTags()?0:-1)}}var je=(()=>{class t{constructor(){this.journalTagService=v(Y),this.isDialogFilterVisible=w(!1),this.params=w({pageNumber:1,pageSize:100}),this.roleService=v(O),this.first=k(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=k(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=A(B(this.params).pipe(R(300),E(e=>this.journalTagService.journalTagList(e).pipe(J(i=>u(c({},i),{data:i.data.map(n=>u(c({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=w(null),this.journalTagsChecked=k(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),M(()=>{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(i=>u(c({},i),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let i=e.data.map(n=>n.id);this.updateCheckedRows(i,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let i=e.data.map(n=>n.id);this.updateCheckedRows(i,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,i){this.journalTags.update(n=>{if(!n)return n;let s=n.data.map(T=>e.includes(T.id)?u(c({},T),{checked:i}):T);return u(c({},n),{data:s})})}onHeaderCheckboxToggle(e){this.journalTags.update(i=>u(c({},i),{data:i.data.map(n=>u(c({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagBulkDelete(this.journalTagsChecked().map(e=>e.id)).pipe(j(()=>this.params.update(e=>c({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(j(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>c({},e))})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Z,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["dialogTitle","Migrate Outlet as Tag","pageTitle","Journal Tag List",3,"filterConfirmed","isDialogFilterVisibleChange","isDialogFilterVisible","overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined"],["label","Migrate","variant","outlined",3,"onClick"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["icon","fa-solid fa-trash","label","Delete","severity","danger",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,"lazy","paginator","rows","scrollable","totalRecords","value"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onHeaderCheckboxToggle","onPage","onRowSelect","onRowUnselect","lazy","paginator","rows","scrollable","totalRecords","value"],[2,"width","1rem"],["routerLink","form",1,"link","link-primary",3,"queryParams"],[3,"value"],["colspan","5"]],template:function(i,n){if(i&1){let s=x();a(0,"app-main-panel",7),b("filterConfirmed",function(){return _(s),d(n.onFilterConfirmed())}),H("isDialogFilterVisibleChange",function(V){return _(s),P(n.isDialogFilterVisible,V)||(n.isDialogFilterVisible=V),d(V)}),D(1,ie,3,2,"ng-template",null,0,g)(3,ae,3,0,"ng-template",null,1,g)(5,_e,1,1,"ng-template",null,2,g),o()}i&2&&(z("isDialogFilterVisible",n.isDialogFilterVisible),h("overflowScroll",!0)("showCancelButton",!1))},dependencies:[W,X,K,G,Q,U,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{je as JournalTagComponent};
|