dealposbooks 5.49.2 → 5.49.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.
Files changed (56) hide show
  1. package/{chunk-F4WXASVJ.js → chunk-26LXGKDF.js} +1 -1
  2. package/{chunk-M5M3M3GU.js → chunk-3KEAMVYI.js} +1 -1
  3. package/{chunk-66YEZ4LP.js → chunk-4G57L7HS.js} +1 -1
  4. package/{chunk-B4CNCOTT.js → chunk-4OZIHMKI.js} +1 -1
  5. package/{chunk-3LOZ6OKX.js → chunk-4UVBCZJG.js} +1 -1
  6. package/chunk-5LGAO5J4.js +1 -0
  7. package/{chunk-MGGC32PD.js → chunk-A3P24MDP.js} +3 -3
  8. package/{chunk-TJQSE35W.js → chunk-A7OYELWP.js} +1 -1
  9. package/{chunk-HA7LLTOG.js → chunk-ATFRJZK3.js} +1 -1
  10. package/{chunk-P5ICG7YE.js → chunk-BJMEZV24.js} +1 -1
  11. package/{chunk-MQPKGA4I.js → chunk-C5EDHVD7.js} +1 -1
  12. package/{chunk-WBGCOYQJ.js → chunk-C7ZPOAWO.js} +1 -1
  13. package/{chunk-Q52A3GQ5.js → chunk-CTINUVLP.js} +1 -1
  14. package/{chunk-7P5XATXL.js → chunk-D2CH2T3I.js} +1 -1
  15. package/{chunk-ULBVUV32.js → chunk-DJTQ4KQ7.js} +1 -1
  16. package/{chunk-LXHUCAAY.js → chunk-DTAREQVV.js} +1 -1
  17. package/{chunk-TSPM6IPU.js → chunk-E3SH454T.js} +1 -1
  18. package/{chunk-F6G7POPA.js → chunk-I2IEFBTX.js} +1 -1
  19. package/{chunk-33JUCBXH.js → chunk-IHKBTP2Y.js} +1 -1
  20. package/{chunk-BZUZKZY4.js → chunk-IQ4SHFOC.js} +1 -1
  21. package/{chunk-C4W7XYJD.js → chunk-KGNH5JRZ.js} +1 -1
  22. package/{chunk-2RI2WRFG.js → chunk-KJCHFIF4.js} +1 -1
  23. package/{chunk-JJ2G2ITS.js → chunk-L3CQJPFS.js} +1 -1
  24. package/{chunk-X57GOVJJ.js → chunk-LG5TMEPP.js} +1 -1
  25. package/chunk-LNFCBMAA.js +1 -0
  26. package/{chunk-ADC7G7M6.js → chunk-LOMHQKQX.js} +1 -1
  27. package/{chunk-BVXHSTT4.js → chunk-LUS3QGR4.js} +1 -1
  28. package/{chunk-LO2GGXGQ.js → chunk-ME4V3YFW.js} +1 -1
  29. package/{chunk-7NY7TIU4.js → chunk-N6LQW4C4.js} +1 -1
  30. package/{chunk-L7WPJUZ6.js → chunk-NXJQMUGV.js} +1 -1
  31. package/{chunk-OARM3UHP.js → chunk-OBT3IJJQ.js} +1 -1
  32. package/{chunk-CIPN4BTQ.js → chunk-OFI2JX7N.js} +1 -1
  33. package/{chunk-YSZN7YTG.js → chunk-OFLGX5N4.js} +2 -2
  34. package/{chunk-HY3WGTQF.js → chunk-PW4Y2UWU.js} +1 -1
  35. package/{chunk-ZVEQIMYP.js → chunk-PZZCPZ6Q.js} +1 -1
  36. package/{chunk-2BTS7BEP.js → chunk-QFFI46W6.js} +1 -1
  37. package/{chunk-YUS2B7BT.js → chunk-QJ5XIVKM.js} +1 -1
  38. package/{chunk-RIBVS2ZL.js → chunk-RX37I2ZC.js} +1 -1
  39. package/{chunk-W6V2QFA7.js → chunk-S6S265JY.js} +2 -2
  40. package/{chunk-UM2HOJJR.js → chunk-SUWUVFH4.js} +1 -1
  41. package/{chunk-6KSTIWOD.js → chunk-UD23HDLE.js} +1 -1
  42. package/{chunk-4YH7A4M6.js → chunk-UK5OOIPU.js} +1 -1
  43. package/{chunk-GWKQHO7M.js → chunk-V2P3PRZY.js} +1 -1
  44. package/{chunk-KGZUIHAZ.js → chunk-V65ONV6D.js} +1 -1
  45. package/{chunk-TG6Y7ANZ.js → chunk-VMI7LQOW.js} +1 -1
  46. package/{chunk-EEQIJSRK.js → chunk-WRTIQGAC.js} +2 -2
  47. package/{chunk-JD4TR3G6.js → chunk-XJFNZBHG.js} +1 -1
  48. package/{chunk-RTMNVCIM.js → chunk-XWXTYJHR.js} +1 -1
  49. package/{chunk-S72FLLKS.js → chunk-YIEUIWT7.js} +1 -1
  50. package/chunk-ZZEOPBUT.js +1 -0
  51. package/index.html +2 -2
  52. package/{main-OZKRZLSC.js → main-WMHNA6IG.js} +1 -1
  53. package/package.json +1 -1
  54. package/chunk-BRKRIPYY.js +0 -1
  55. package/chunk-EOU5D6FS.js +0 -1
  56. package/chunk-KDCDSUGW.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b as L}from"./chunk-3LOZ6OKX.js";import"./chunk-33JUCBXH.js";import{a as I,b as E}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as H}from"./chunk-7P5XATXL.js";import"./chunk-S27Z7D3D.js";import{a as R,b as D}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as V,x as j,y as N,z as G}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-C4W7XYJD.js";import"./chunk-5DRALZZF.js";import{a as F}from"./chunk-2BI7WNJP.js";import{n as O,s as $}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as P,Eb as w,Ec as _,Mb as p,Oc as s,Pb as h,Pc as m,Sc as x,W as y,Wb as o,Xb as n,Y as M,Yb as l,_ as b,ac as B,fc as C,gc as c,h as T,ia as f,ib as a,qa as g,ra as d,s as u,sa as S,ta as A,yb as k}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
1
+ import{a as v,b as L}from"./chunk-4UVBCZJG.js";import"./chunk-IHKBTP2Y.js";import{a as I,b as E}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as H}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as R,b as D}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as V,x as j,y as N,z as G}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-KGNH5JRZ.js";import"./chunk-5DRALZZF.js";import{a as F}from"./chunk-2BI7WNJP.js";import{n as O,s as $}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as P,Eb as w,Ec as _,Mb as p,Oc as s,Pb as h,Pc as m,Sc as x,W as y,Wb as o,Xb as n,Y as M,Yb as l,_ as b,ac as B,fc as C,gc as c,h as T,ia as f,ib as a,qa as g,ra as d,s as u,sa as S,ta as A,yb as k}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=B();o(0,"div",3)(1,"p-button",4),C("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),C("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",m(3,2,t.countInBooks$)!==0)("pTooltip",m(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),s(4,"async"),S(),o(5,"svg",8),l(6,"path",9),n(),A(),l(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();h(_(12,q)),a(),h(_(13,q)),a(2),p("migrationCount",m(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",m(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getCOACount()),b(e=>console.log("API response:",e)),y(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOA().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-chart-of-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),w(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,O,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-LO2GGXGQ.js";import{a as ze}from"./chunk-G4XX7EU2.js";import{a as je}from"./chunk-KZHI6PGZ.js";import{a as Be,b as He}from"./chunk-UVSR4LPB.js";import{a as oe}from"./chunk-2RI2WRFG.js";import{b as D}from"./chunk-33JUCBXH.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import"./chunk-U2VDC52W.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{d as Je,i as Ne,j as ke,k as Me}from"./chunk-DGACZ747.js";import{a as Ve,b as De}from"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import{a as Fe,b as Ae}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{i as Ee}from"./chunk-7P5XATXL.js";import"./chunk-S27Z7D3D.js";import{a as xe,b as Ce}from"./chunk-AD247LWQ.js";import{a as ve,b as y,c as ye,d as we,e as Re,f as Ie,g as Te}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as fe,o as _e,w as ge,x as he,y as be,z as Se}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as me,k as pe,l as se,o as ce,u as de,x as ue}from"./chunk-VMI3QWC6.js";import"./chunk-F7PVAVLQ.js";import"./chunk-C4W7XYJD.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as Y,j as Z,k as ee,n as te,p as ie,s as ne}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as K,Dc as Q,Eb as g,Fc as E,Ha as k,Mb as c,Oc as I,Pc as X,Qc as V,Sc as v,Wb as r,Xb as o,Y as N,Yb as b,_ as U,ac as w,bd as T,c as A,db as L,eb as O,fc as R,gc as _,ia as C,ib as m,qa as h,ra as x,s as J,sc as s,tc as S,uc as M,wc as W,xc as $,yb as G,yc as P,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var We={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},B=ye(Te(We),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(D);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(A(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(A(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Re(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function $e(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function qe(t,a){if(t&1&&g(0,$e,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Qe(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Xe(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,O),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,L),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ye(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ze(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function et(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Qe,18,0,"ng-template",null,3,v)(4,Xe,22,18,"ng-template",null,4,v)(6,Ye,1,3,"ng-template",null,5,v)(8,Ze,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function tt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function it(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function nt(t,a){if(t&1&&(r(0,"div"),g(1,it,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function mt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),g(5,tt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,nt,2,1,"div",30),b(13,"p-datepicker",31),g(14,rt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,lt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(16,H,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(18,H,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",X(19,14,e.customerSuggestions$)),m(5),c("ngClass",E(20,H,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var Yt=(()=>{class t extends Pe{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Oe,customerID:Ge,paymentState:Ke}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),pageSize:this.fb.control(u,[ae.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Oe),customerID:this.fb.control(Ge),paymentState:this.fb.control(Ke)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=ze);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(U(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([B]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,qe,1,1,"ng-template",null,0,v)(3,et,10,5,"ng-template",null,1,v),s(5," <"),g(6,mt,25,22,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ee,ne,Y,Z,ee,te,ie,Me,Je,Ne,ke,he,ge,Ce,xe,ue,pe,re,le,me,se,ce,Ae,Fe,De,Ve,He,Be,_e,fe,ve,Se,be,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Yt as ARJournalComponent};
1
+ import{a as F}from"./chunk-ME4V3YFW.js";import{a as ze}from"./chunk-G4XX7EU2.js";import{a as je}from"./chunk-KZHI6PGZ.js";import{a as Be,b as He}from"./chunk-UVSR4LPB.js";import{a as oe}from"./chunk-KJCHFIF4.js";import{b as D}from"./chunk-IHKBTP2Y.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import"./chunk-U2VDC52W.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{d as Je,i as Ne,j as ke,k as Me}from"./chunk-DGACZ747.js";import{a as Ve,b as De}from"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import{a as Fe,b as Ae}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{i as Ee}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as xe,b as Ce}from"./chunk-AD247LWQ.js";import{a as ve,b as y,c as ye,d as we,e as Re,f as Ie,g as Te}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as fe,o as _e,w as ge,x as he,y as be,z as Se}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as me,k as pe,l as se,o as ce,u as de,x as ue}from"./chunk-VMI3QWC6.js";import"./chunk-F7PVAVLQ.js";import"./chunk-KGNH5JRZ.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as Y,j as Z,k as ee,n as te,p as ie,s as ne}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as K,Dc as Q,Eb as g,Fc as E,Ha as k,Mb as c,Oc as I,Pc as X,Qc as V,Sc as v,Wb as r,Xb as o,Y as N,Yb as b,_ as U,ac as w,bd as T,c as A,db as L,eb as O,fc as R,gc as _,ia as C,ib as m,qa as h,ra as x,s as J,sc as s,tc as S,uc as M,wc as W,xc as $,yb as G,yc as P,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var We={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}},B=ye(Te(We),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(D);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:z(A(N(()=>a.getARJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:z(A(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Re(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function $e(t,a){if(t&1){let e=w();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function qe(t,a){if(t&1&&g(0,$e,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Qe(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function Xe(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,O),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,L),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Ye(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ze(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function et(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Qe,18,0,"ng-template",null,3,v)(4,Xe,22,18,"ng-template",null,4,v)(6,Ye,1,3,"ng-template",null,5,v)(8,Ze,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function tt(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function it(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function nt(t,a){if(t&1&&(r(0,"div"),g(1,it,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function rt(t,a){if(t&1&&(r(0,"div"),g(1,ot,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function lt(t,a){if(t&1&&(r(0,"div"),g(1,at,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function mt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),g(5,tt,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,nt,2,1,"div",30),b(13,"p-datepicker",31),g(14,rt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,lt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(16,H,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(18,H,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",X(19,14,e.customerSuggestions$)),m(5),c("ngClass",E(20,H,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var Yt=(()=>{class t extends Pe{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,pageSize:u,export:p,exportPageNumber:Ue,exportPageSize:Le,outletName:Oe,customerID:Ge,paymentState:Ke}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),pageSize:this.fb.control(u,[ae.required]),export:this.fb.control(p),exportPageNumber:this.fb.control(Ue),exportPageSize:this.fb.control(Le),outletName:this.fb.control(Oe),customerID:this.fb.control(Ge),paymentState:this.fb.control(Ke)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=ze);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(U(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([B]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,qe,1,1,"ng-template",null,0,v)(3,et,10,5,"ng-template",null,1,v),s(5," <"),g(6,mt,25,22,"ng-template",null,2,v),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ee,ne,Y,Z,ee,te,ie,Me,Je,Ne,ke,he,ge,Ce,xe,ue,pe,re,le,me,se,ce,Ae,Fe,De,Ve,He,Be,_e,fe,ve,Se,be,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Yt as ARJournalComponent};
@@ -1,8 +1,8 @@
1
- import{a as qe,b as We,c as He,d as Ke,e as Qe,f as Xe}from"./chunk-RM5HLXNW.js";import{a as Je,b as je,c as $e,d as Le}from"./chunk-3UAQHNUY.js";import{a as ze,b as Ue}from"./chunk-E6SW7I4D.js";import{a as Re}from"./chunk-KZHI6PGZ.js";import{a as h}from"./chunk-NMU2YBAB.js";import{b as Be}from"./chunk-33JUCBXH.js";import{a as Ve,b as Oe}from"./chunk-B4C3ZPN6.js";import"./chunk-MHRSQRHT.js";import{a as Ge,b as Pe,k as ke}from"./chunk-DGACZ747.js";import{a as Ae,b as Ie}from"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as Te}from"./chunk-BT7Y4ADP.js";import{a as Q,b as X}from"./chunk-DJXQKSLT.js";import"./chunk-VKNINE5Q.js";import{a as Me,b as we}from"./chunk-E7QWESN4.js";import{a as Ne,b as De}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{b as Y}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{i as E}from"./chunk-7P5XATXL.js";import"./chunk-S27Z7D3D.js";import{a as R,b as J}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as K,o as F,w as V,x as O}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Ha as B,b as w,c as ae,e as y,f as N,j as Fe,l as D,m as W,n as Ee,o as G,u as P,w as H,x as k}from"./chunk-VMI3QWC6.js";import{b as xe,e as Ce,l as Se}from"./chunk-F7PVAVLQ.js";import"./chunk-C4W7XYJD.js";import"./chunk-5DRALZZF.js";import{a as ye}from"./chunk-2BI7WNJP.js";import{h as be,j as ve,k as he,q as _e,s as S}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as q,Eb as g,Ec as z,Fc as ie,Ha as j,L as se,Mb as p,Oc as oe,Pb as $,Pc as re,Sb as I,Sc as f,Ub as T,Vb as M,Wb as i,Xb as n,Yb as c,Z as ue,_ as A,ac as _,fc as x,g as pe,gc as u,ia as d,ib as l,ob as ne,qa as b,ra as v,s as ce,sc as r,tc as U,uc as L,xc as de,yb as C,yc as fe,zc as ge}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var mt=()=>({height:"calc(100vh - 100px)"});function pt(t,m){if(t&1){let e=_();i(0,"div",4)(1,"a",5),r(2,"Cancel"),n(),i(3,"p-button",6),x("click",function(){b(e);let a=u();return v(a.updateAccountingIntegration())}),n()()}}function ct(t,m){if(t&1&&(i(0,"p-tab",8),r(1),n()),t&2){let e=m.$implicit,o=m.$index;p("value",o),l(),U(e)}}function st(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",41),i(2,"label",42),r(3),n()()),t&2){let e=m.$implicit;l(),p("value",e.key)("inputId",e.value),l(),p("for",e.value),l(),U(e.value)}}function ut(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",43),i(3,"label",42),r(4),n()()()),t&2){let e=m.$implicit;l(2),p("value",e.key)("inputId",e.key.toString()),l(),p("for",e.key),l(),U(e.value)}}function dt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),T(4,ct,2,2,"p-tab",8,I),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),r(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),r(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),r(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),r(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),r(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),r(37,"Reset Every"),n(),i(38,"div",24),T(39,st,4,4,"div",25,I),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),r(45,"Journal Generate"),n(),i(46,"p"),r(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),r(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),r(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),r(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),r(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),r(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),r(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),r(88,"Accounting For Treatment"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),T(92,ut,5,4,"div",40,I),n()()()()()()()()()()()()),t&2){let e,o,a,s=u();$(z(8,mt)),l(2),p("value",0)("formGroup",s.form),l(2),M(s.tabs()),l(3),p("value",0),l(26),p("options",(e=s.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),l(6),M((o=s.accountingIntegration())==null||o.options==null?null:o.options.resetPeriods),l(2),p("value",1),l(38),p("value",2),l(13),M((a=s.accountingIntegration())==null||a.options==null?null:a.options.generatePrepaidJournal)}}var Ze=(()=>{class t{constructor(){this.accountingSetupService=d(h),this.fb=d(P).nonNullable,this.tabs=j(["Numbering","Journal","Report"]),this.accountingIntegration=j(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(A(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,pt,4,0,"ng-template",null,0,f)(3,dt,94,9,"ng-template",null,1,f),n())},dependencies:[S,Xe,Qe,Ke,He,qe,We,E,Y,Pe,Ge,k,y,N,D,G,W,F,De,Ne,Oe,Ve,Se,Ce,O,V,we,Me,X,Q],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var gt=()=>({height:"cacl(100vh - 200px)"}),bt=()=>({height:"calc(100vh - 250px)"});function vt(t,m){if(t&1){let e=_();i(0,"div")(1,"p-button",5),x("onClick",function(){b(e);let a=u();return v(a.submitForm())}),n()()}}function ht(t,m){t&1&&(i(0,"div",17)(1,"h3",18),r(2,"Date"),n(),c(3,"p-datePicker",19),n())}function _t(t,m){if(t&1&&(i(0,"tr",9)(1,"td",27),r(2),n(),i(3,"td"),c(4,"input",28),n(),i(5,"td"),c(6,"input",29),n()()),t&2){let e,o=m.$implicit,a=m.index,s=u(4);p("formGroupName",a),l(2),L(" ",(e=s.asFormGroup(o).get("accountName"))==null?null:e.value," ")}}function xt(t,m){if(t&1&&(i(0,"div",9)(1,"h4",20),r(2),n(),i(3,"div",21)(4,"table",22)(5,"thead",23)(6,"tr")(7,"th",24),r(8,"Account Name"),n(),i(9,"th",25),r(10,"Debit"),n(),i(11,"th",25),r(12,"Credit"),n()()(),i(13,"tbody"),g(14,_t,7,2,"tr",26),n()()()()),t&2){let e=m.$implicit,o=m.$index,a=u(3);p("formGroupName",o),l(2),L(" ",e.get("name").value," "),l(12),p("ngForOf",a.getItemsArray(a.asFormGroup(e)).controls)}}function Ct(t,m){if(t&1&&(i(0,"p-panel",7),g(1,ht,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",8),T(6,xt,15,3,"div",9,I),n()(),i(8,"div",10)(9,"table",11)(10,"tr")(11,"td",12)(12,"p",13),r(13," Total: "),n()(),i(14,"td",14)(15,"p",15),r(16),oe(17,"number"),n()(),i(18,"td",16)(19,"p",15),r(20),oe(21,"number"),n()()()()()()),t&2){let e=u(2);$(z(11,gt)),p("formGroup",e.formGroups),l(4),$(z(12,bt)),l(2),M(e.formsArray.controls),l(10),L(" ",re(17,7,e.subtotalDebit)," "),l(4),L(" ",re(21,9,e.subtotalCredit)," ")}}function St(t,m){if(t&1&&g(0,Ct,22,13,"p-panel",6),t&2){let e=u();p("ngIf",e.formGroups)}}var tt=(()=>{class t{constructor(){this.destroy$=new pe,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=d(P),this.accSetupService=d(h),this.dayjsService=d(Be),this.date=new Date,this.routes=d(xe)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(se(300),ue(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let o=e.map(a=>this.createItemGroup(a));return this.fb.array(o)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ce(e=>e.data),Te("response"),A(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(a=>a.items&&a.items.length>0).forEach(a=>{this.formsArray.push(this.createFormGroup(a))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(o=>{let a=this.getItemsArray(o),s=a.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),at=a.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=s,this.subtotalCredit+=at})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((o,[a,s])=>(a==="date"?o[a]=s instanceof Date?this.dayjsService.format(s):s:a==="forms"?o.form=s:o[a]=s,o),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-acc-opening-balance-form"]],features:[q([B])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
1
+ import{a as qe,b as We,c as He,d as Ke,e as Qe,f as Xe}from"./chunk-RM5HLXNW.js";import{a as Je,b as je,c as $e,d as Le}from"./chunk-3UAQHNUY.js";import{a as ze,b as Ue}from"./chunk-E6SW7I4D.js";import{a as Re}from"./chunk-KZHI6PGZ.js";import{a as h}from"./chunk-NMU2YBAB.js";import{b as Be}from"./chunk-IHKBTP2Y.js";import{a as Ve,b as Oe}from"./chunk-B4C3ZPN6.js";import"./chunk-MHRSQRHT.js";import{a as Ge,b as Pe,k as ke}from"./chunk-DGACZ747.js";import{a as Ae,b as Ie}from"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as Te}from"./chunk-BT7Y4ADP.js";import{a as Q,b as X}from"./chunk-DJXQKSLT.js";import"./chunk-VKNINE5Q.js";import{a as Me,b as we}from"./chunk-E7QWESN4.js";import{a as Ne,b as De}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{b as Y}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{i as E}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as R,b as J}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as K,o as F,w as V,x as O}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Ha as B,b as w,c as ae,e as y,f as N,j as Fe,l as D,m as W,n as Ee,o as G,u as P,w as H,x as k}from"./chunk-VMI3QWC6.js";import{b as xe,e as Ce,l as Se}from"./chunk-F7PVAVLQ.js";import"./chunk-KGNH5JRZ.js";import"./chunk-5DRALZZF.js";import{a as ye}from"./chunk-2BI7WNJP.js";import{h as be,j as ve,k as he,q as _e,s as S}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as q,Eb as g,Ec as z,Fc as ie,Ha as j,L as se,Mb as p,Oc as oe,Pb as $,Pc as re,Sb as I,Sc as f,Ub as T,Vb as M,Wb as i,Xb as n,Yb as c,Z as ue,_ as A,ac as _,fc as x,g as pe,gc as u,ia as d,ib as l,ob as ne,qa as b,ra as v,s as ce,sc as r,tc as U,uc as L,xc as de,yb as C,yc as fe,zc as ge}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var mt=()=>({height:"calc(100vh - 100px)"});function pt(t,m){if(t&1){let e=_();i(0,"div",4)(1,"a",5),r(2,"Cancel"),n(),i(3,"p-button",6),x("click",function(){b(e);let a=u();return v(a.updateAccountingIntegration())}),n()()}}function ct(t,m){if(t&1&&(i(0,"p-tab",8),r(1),n()),t&2){let e=m.$implicit,o=m.$index;p("value",o),l(),U(e)}}function st(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",41),i(2,"label",42),r(3),n()()),t&2){let e=m.$implicit;l(),p("value",e.key)("inputId",e.value),l(),p("for",e.value),l(),U(e.value)}}function ut(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",43),i(3,"label",42),r(4),n()()()),t&2){let e=m.$implicit;l(2),p("value",e.key)("inputId",e.key.toString()),l(),p("for",e.key),l(),U(e.value)}}function dt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),T(4,ct,2,2,"p-tab",8,I),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),r(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),r(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),r(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),r(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),r(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),r(37,"Reset Every"),n(),i(38,"div",24),T(39,st,4,4,"div",25,I),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),r(45,"Journal Generate"),n(),i(46,"p"),r(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),r(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),r(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),r(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),r(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),r(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),r(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),r(88,"Accounting For Treatment"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),T(92,ut,5,4,"div",40,I),n()()()()()()()()()()()()),t&2){let e,o,a,s=u();$(z(8,mt)),l(2),p("value",0)("formGroup",s.form),l(2),M(s.tabs()),l(3),p("value",0),l(26),p("options",(e=s.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),l(6),M((o=s.accountingIntegration())==null||o.options==null?null:o.options.resetPeriods),l(2),p("value",1),l(38),p("value",2),l(13),M((a=s.accountingIntegration())==null||a.options==null?null:a.options.generatePrepaidJournal)}}var Ze=(()=>{class t{constructor(){this.accountingSetupService=d(h),this.fb=d(P).nonNullable,this.tabs=j(["Numbering","Journal","Report"]),this.accountingIntegration=j(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(A(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,pt,4,0,"ng-template",null,0,f)(3,dt,94,9,"ng-template",null,1,f),n())},dependencies:[S,Xe,Qe,Ke,He,qe,We,E,Y,Pe,Ge,k,y,N,D,G,W,F,De,Ne,Oe,Ve,Se,Ce,O,V,we,Me,X,Q],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var gt=()=>({height:"cacl(100vh - 200px)"}),bt=()=>({height:"calc(100vh - 250px)"});function vt(t,m){if(t&1){let e=_();i(0,"div")(1,"p-button",5),x("onClick",function(){b(e);let a=u();return v(a.submitForm())}),n()()}}function ht(t,m){t&1&&(i(0,"div",17)(1,"h3",18),r(2,"Date"),n(),c(3,"p-datePicker",19),n())}function _t(t,m){if(t&1&&(i(0,"tr",9)(1,"td",27),r(2),n(),i(3,"td"),c(4,"input",28),n(),i(5,"td"),c(6,"input",29),n()()),t&2){let e,o=m.$implicit,a=m.index,s=u(4);p("formGroupName",a),l(2),L(" ",(e=s.asFormGroup(o).get("accountName"))==null?null:e.value," ")}}function xt(t,m){if(t&1&&(i(0,"div",9)(1,"h4",20),r(2),n(),i(3,"div",21)(4,"table",22)(5,"thead",23)(6,"tr")(7,"th",24),r(8,"Account Name"),n(),i(9,"th",25),r(10,"Debit"),n(),i(11,"th",25),r(12,"Credit"),n()()(),i(13,"tbody"),g(14,_t,7,2,"tr",26),n()()()()),t&2){let e=m.$implicit,o=m.$index,a=u(3);p("formGroupName",o),l(2),L(" ",e.get("name").value," "),l(12),p("ngForOf",a.getItemsArray(a.asFormGroup(e)).controls)}}function Ct(t,m){if(t&1&&(i(0,"p-panel",7),g(1,ht,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",8),T(6,xt,15,3,"div",9,I),n()(),i(8,"div",10)(9,"table",11)(10,"tr")(11,"td",12)(12,"p",13),r(13," Total: "),n()(),i(14,"td",14)(15,"p",15),r(16),oe(17,"number"),n()(),i(18,"td",16)(19,"p",15),r(20),oe(21,"number"),n()()()()()()),t&2){let e=u(2);$(z(11,gt)),p("formGroup",e.formGroups),l(4),$(z(12,bt)),l(2),M(e.formsArray.controls),l(10),L(" ",re(17,7,e.subtotalDebit)," "),l(4),L(" ",re(21,9,e.subtotalCredit)," ")}}function St(t,m){if(t&1&&g(0,Ct,22,13,"p-panel",6),t&2){let e=u();p("ngIf",e.formGroups)}}var tt=(()=>{class t{constructor(){this.destroy$=new pe,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=d(P),this.accSetupService=d(h),this.dayjsService=d(Be),this.date=new Date,this.routes=d(xe)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(se(300),ue(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let o=e.map(a=>this.createItemGroup(a));return this.fb.array(o)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ce(e=>e.data),Te("response"),A(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(a=>a.items&&a.items.length>0).forEach(a=>{this.formsArray.push(this.createFormGroup(a))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(o=>{let a=this.getItemsArray(o),s=a.controls.reduce((Z,ee)=>{let te=ee.get("debitAmount").value||0;return Z+te},0),at=a.controls.reduce((Z,ee)=>{let te=ee.get("creditAmount").value||0;return Z+te},0);this.subtotalDebit+=s,this.subtotalCredit+=at})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((o,[a,s])=>(a==="date"?o[a]=s instanceof Date?this.dayjsService.format(s):s:a==="forms"?o.form=s:o[a]=s,o),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-acc-opening-balance-form"]],features:[q([B])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
2
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"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,vt,2,0,"ng-template",null,0,f)(3,St,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",4)),o&2&&p("scrollable",!0)},dependencies:[E,Y,S,ve,he,_e,Ie,Ae,ke,X,Q,H,w,y,N,F,$e,O,V,J,R,Re,k,D,G,W,Ee,Ue,ze],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var nt=t=>({"ng-invalid ng-dirty":t});function Ft(t,m){if(t&1){let e=_();i(0,"p-button",4),x("onClick",function(){b(e);let a=u();return v(a.verifyCredentials())}),r(1,"Verify"),n(),i(2,"p-button",4),x("onClick",function(){b(e);let a=u();return v(a.saveCredentials())}),r(3,"Update"),n()}}function Et(t,m){t&1&&(i(0,"div",12)(1,"h3",13),r(2,"Account"),n(),i(3,"small",14),r(4,"Configure Client ID and Client Secret"),n()())}function At(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,Et,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),r(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),r(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=u();l(4),p("formGroup",e.credentialForm),l(5),p("ngClass",ie(3,nt,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),p("ngClass",ie(5,nt,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var it=(()=>{class t{constructor(e,o){this.fb=e,this.messageService=o,this.setupService=d(h)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(A(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ae.required]],clientSecret:["",[ae.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:o=>{console.log("Verify result:",o),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:o=>{console.error("Verify failed:",o),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(o){return new(o||t)(ne(P),ne(B))}}static{this.\u0275cmp=C({type:t,selectors:[["app-api-credential"]],features:[q([B])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Ft,4,0,"ng-template",null,0,f)(3,At,15,7,"ng-template",null,1,f),n())},dependencies:[S,be,k,w,y,N,D,G,F,K,J,R,E,O,V,Le],encapsulation:2})}}return t})();function It(t,m){if(t&1){let e=_();i(0,"button",4),x("click",function(){b(e);let a=u();return v(a.onFormatJournal())}),r(1," Format "),n()}}function Tt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),r(3,"Journal Configuration"),n(),i(4,"small",15),r(5," Enter your account information to format journal entries "),n()()())}function Mt(t,m){if(t&1){let e=_();i(0,"div",5)(1,"p-panel"),g(2,Tt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),ge("ngModelChange",function(a){b(e);let s=u();return fe(s.subdomain,a)||(s.subdomain=a),v(a)}),n(),i(8,"label",10),r(9,"Subdomain"),n()(),i(10,"small",11),r(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=u();l(7),de("ngModel",e.subdomain)}}var ot=(()=>{class t{constructor(){this.setupService=d(h),this.subdomain=j(""),this.toastrService=d(ye)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,It,2,0,"ng-template",null,0,f)(3,Mt,12,1,"ng-template",null,1,f),n())},dependencies:[S,H,w,y,Fe,F,K,E,J,R,je,Je],encapsulation:2})}}return t})();var rt=()=>d(h).fetchOpeningBalanceFormConfiguration();var li=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-KDCDSUGW.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-X57GOVJJ.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-BVXHSTT4.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-UM2HOJJR.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:Ze},{path:"opening-balance-form",component:tt,resolve:{data:rt}},{path:"api-crendetial",component:it},{path:"format-journal",component:ot},{path:"closing-entries",loadComponent:()=>import("./chunk-L7WPJUZ6.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-ADC7G7M6.js").then(t=>t.ClosingFormComponent)}]}];export{li 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"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,vt,2,0,"ng-template",null,0,f)(3,St,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",4)),o&2&&p("scrollable",!0)},dependencies:[E,Y,S,ve,he,_e,Ie,Ae,ke,X,Q,H,w,y,N,F,$e,O,V,J,R,Re,k,D,G,W,Ee,Ue,ze],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var nt=t=>({"ng-invalid ng-dirty":t});function Ft(t,m){if(t&1){let e=_();i(0,"p-button",4),x("onClick",function(){b(e);let a=u();return v(a.verifyCredentials())}),r(1,"Verify"),n(),i(2,"p-button",4),x("onClick",function(){b(e);let a=u();return v(a.saveCredentials())}),r(3,"Update"),n()}}function Et(t,m){t&1&&(i(0,"div",12)(1,"h3",13),r(2,"Account"),n(),i(3,"small",14),r(4,"Configure Client ID and Client Secret"),n()())}function At(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,Et,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),r(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),r(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=u();l(4),p("formGroup",e.credentialForm),l(5),p("ngClass",ie(3,nt,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),p("ngClass",ie(5,nt,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var it=(()=>{class t{constructor(e,o){this.fb=e,this.messageService=o,this.setupService=d(h)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(A(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ae.required]],clientSecret:["",[ae.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:o=>{console.log("Verify result:",o),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:o=>{console.error("Verify failed:",o),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(o){return new(o||t)(ne(P),ne(B))}}static{this.\u0275cmp=C({type:t,selectors:[["app-api-credential"]],features:[q([B])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Ft,4,0,"ng-template",null,0,f)(3,At,15,7,"ng-template",null,1,f),n())},dependencies:[S,be,k,w,y,N,D,G,F,K,J,R,E,O,V,Le],encapsulation:2})}}return t})();function It(t,m){if(t&1){let e=_();i(0,"button",4),x("click",function(){b(e);let a=u();return v(a.onFormatJournal())}),r(1," Format "),n()}}function Tt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),r(3,"Journal Configuration"),n(),i(4,"small",15),r(5," Enter your account information to format journal entries "),n()()())}function Mt(t,m){if(t&1){let e=_();i(0,"div",5)(1,"p-panel"),g(2,Tt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),ge("ngModelChange",function(a){b(e);let s=u();return fe(s.subdomain,a)||(s.subdomain=a),v(a)}),n(),i(8,"label",10),r(9,"Subdomain"),n()(),i(10,"small",11),r(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=u();l(7),de("ngModel",e.subdomain)}}var ot=(()=>{class t{constructor(){this.setupService=d(h),this.subdomain=j(""),this.toastrService=d(ye)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=C({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,It,2,0,"ng-template",null,0,f)(3,Mt,12,1,"ng-template",null,1,f),n())},dependencies:[S,H,w,y,Fe,F,K,E,J,R,je,Je],encapsulation:2})}}return t})();var rt=()=>d(h).fetchOpeningBalanceFormConfiguration();var li=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-5LGAO5J4.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-LG5TMEPP.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-LUS3QGR4.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-SUWUVFH4.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:Ze},{path:"opening-balance-form",component:tt,resolve:{data:rt}},{path:"api-crendetial",component:it},{path:"format-journal",component:ot},{path:"closing-entries",loadComponent:()=>import("./chunk-NXJQMUGV.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-LOMHQKQX.js").then(t=>t.ClosingFormComponent)}]}];export{li as ACCOUNTING_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{a}from"./chunk-6KSTIWOD.js";import"./chunk-2RI2WRFG.js";import"./chunk-U2VDC52W.js";import"./chunk-F7PVAVLQ.js";import"./chunk-C4W7XYJD.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-66YEZ4LP.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
1
+ import{a}from"./chunk-UD23HDLE.js";import"./chunk-KJCHFIF4.js";import"./chunk-U2VDC52W.js";import"./chunk-F7PVAVLQ.js";import"./chunk-KGNH5JRZ.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-4G57L7HS.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
@@ -1 +1 @@
1
- import{a as we}from"./chunk-LXHUCAAY.js";import"./chunk-2RI2WRFG.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-5B5AMMR3.js";import{a as ye,b as Ve,c as Se}from"./chunk-JD3HX7VY.js";import"./chunk-U2VDC52W.js";import{d as _e,f as ue,g as fe,h as xe,k as ge}from"./chunk-DGACZ747.js";import"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-DJXQKSLT.js";import"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{a as ce,b as de}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{e as pe,f as me,i as se}from"./chunk-7P5XATXL.js";import"./chunk-S27Z7D3D.js";import{a as ae,b as le}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as oe,x as re}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{d as ne}from"./chunk-F7PVAVLQ.js";import"./chunk-C4W7XYJD.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as X,k as Y,p as Z,q as ee,s as te}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
1
+ import{a as we}from"./chunk-DTAREQVV.js";import"./chunk-KJCHFIF4.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-5B5AMMR3.js";import{a as ye,b as Ve,c as Se}from"./chunk-JD3HX7VY.js";import"./chunk-U2VDC52W.js";import{d as _e,f as ue,g as fe,h as xe,k as ge}from"./chunk-DGACZ747.js";import"./chunk-EBEY2MBR.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-DJXQKSLT.js";import"./chunk-VKNINE5Q.js";import"./chunk-E7QWESN4.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-PPXXWO4E.js";import"./chunk-3DBSHDAQ.js";import"./chunk-M4SSELXT.js";import{a as ce,b as de}from"./chunk-WXIG4CXY.js";import"./chunk-QPPFPDWZ.js";import"./chunk-WMZF4DQK.js";import{e as pe,f as me,i as se}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as ae,b as le}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as oe,x as re}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{d as ne}from"./chunk-F7PVAVLQ.js";import"./chunk-KGNH5JRZ.js";import"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{h as X,k as Y,p as Z,q as ee,s as te}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
@@ -1 +1 @@
1
- import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-RM5HLXNW.js";import"./chunk-UPSNJEHO.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import{i as w}from"./chunk-7P5XATXL.js";import"./chunk-S27Z7D3D.js";import{a as S}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-C4W7XYJD.js";import{a as P}from"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{s as M}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as h,Ec as _,Ha as u,Pb as v,Sb as m,Sc as C,Ub as c,Vb as s,Wb as o,Xb as r,_ as f,ca as d,gc as g,ia as l,ib as n,sc as p,tc as x,uc as y,yb as b}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var D=(()=>{class e{constructor(){this.httpService=l(P)}getUserProfile(){return this.httpService.get(void 0,"api/MyProfile")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var A=()=>({height:"calc(100vh - 70px)"});function B(e,a){if(e&1&&(o(0,"div",10)(1,"div",11)(2,"p",12),p(3),r()()()),e&2){let t=a.$implicit;n(3),y(" ",t.roleName," ")}}function L(e,a){if(e&1&&(o(0,"div",4)(1,"div",5)(2,"div",6)(3,"span",7),p(4),r()()(),o(5,"div",8)(6,"div",9),c(7,B,4,1,"div",10,m),r()()()),e&2){let t=a.$implicit;n(4),x(t.roleGroupName),n(3),s(t.listRole)}}function $(e,a){if(e&1&&(o(0,"p-panel")(1,"p-tabs",2)(2,"p-tablist")(3,"p-tab",2),p(4,"Roles"),r()(),o(5,"p-tabpanels")(6,"p-tabpanel",2)(7,"div",3),c(8,L,9,1,"div",4,m),r()()()()()),e&2){let t,i=g();v(_(2,A)),n(8),s((t=i.roles())==null?null:t.Roles)}}var N=(()=>{class e{constructor(){this.profileService=l(D),this.roles=u(null)}ngOnInit(){this.profileService.getUserProfile().pipe(E("response"),f(t=>this.roles.set(t))).subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-my-profile"]],decls:3,vars:0,consts:[["content",""],["pageTitle","My Profile"],["value","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","50px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],[1,"col"],["formArrayName","roles",1,"row","h-100"],[1,"col-3","border-top","border-bottom","border-end","p-0","bg-white"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],[1,"fs-2","text-dark","m-0"]],template:function(i,G){i&1&&(o(0,"app-main-panel",1),h(1,$,10,3,"ng-template",null,0,C),r())},dependencies:[w,S,O,R,j,F,I,k,M,T],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding-top:0!important}"],changeDetection:0})}}return e})();var le=[{path:"",redirectTo:"my-profile",pathMatch:"full"},{path:"",children:[{path:"my-profile",component:N}]}];export{le as PROFILE_ROUTES};
1
+ import{a as I,b as k,c as F,d as j,e as R,f as O}from"./chunk-RM5HLXNW.js";import"./chunk-UPSNJEHO.js";import{a as E}from"./chunk-BT7Y4ADP.js";import{b as T}from"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-QPPFPDWZ.js";import{i as w}from"./chunk-D2CH2T3I.js";import"./chunk-S27Z7D3D.js";import{a as S}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-KGNH5JRZ.js";import{a as P}from"./chunk-5DRALZZF.js";import"./chunk-2BI7WNJP.js";import{s as M}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as h,Ec as _,Ha as u,Pb as v,Sb as m,Sc as C,Ub as c,Vb as s,Wb as o,Xb as r,_ as f,ca as d,gc as g,ia as l,ib as n,sc as p,tc as x,uc as y,yb as b}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var D=(()=>{class e{constructor(){this.httpService=l(P)}getUserProfile(){return this.httpService.get(void 0,"api/MyProfile")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var A=()=>({height:"calc(100vh - 70px)"});function B(e,a){if(e&1&&(o(0,"div",10)(1,"div",11)(2,"p",12),p(3),r()()()),e&2){let t=a.$implicit;n(3),y(" ",t.roleName," ")}}function L(e,a){if(e&1&&(o(0,"div",4)(1,"div",5)(2,"div",6)(3,"span",7),p(4),r()()(),o(5,"div",8)(6,"div",9),c(7,B,4,1,"div",10,m),r()()()),e&2){let t=a.$implicit;n(4),x(t.roleGroupName),n(3),s(t.listRole)}}function $(e,a){if(e&1&&(o(0,"p-panel")(1,"p-tabs",2)(2,"p-tablist")(3,"p-tab",2),p(4,"Roles"),r()(),o(5,"p-tabpanels")(6,"p-tabpanel",2)(7,"div",3),c(8,L,9,1,"div",4,m),r()()()()()),e&2){let t,i=g();v(_(2,A)),n(8),s((t=i.roles())==null?null:t.Roles)}}var N=(()=>{class e{constructor(){this.profileService=l(D),this.roles=u(null)}ngOnInit(){this.profileService.getUserProfile().pipe(E("response"),f(t=>this.roles.set(t))).subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-my-profile"]],decls:3,vars:0,consts:[["content",""],["pageTitle","My Profile"],["value","0"],["formArrayName","roles",1,"container-fluid","d-flex","flex-column","row-gap-3"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between",2,"height","50px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100"],[1,"text-dark","fw-semibold","fs-2"],[1,"col"],["formArrayName","roles",1,"row","h-100"],[1,"col-3","border-top","border-bottom","border-end","p-0","bg-white"],[1,"d-flex","h-100","align-items-center","gap-2","px-2"],[1,"fs-2","text-dark","m-0"]],template:function(i,G){i&1&&(o(0,"app-main-panel",1),h(1,$,10,3,"ng-template",null,0,C),r())},dependencies:[w,S,O,R,j,F,I,k,M,T],styles:["[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding-top:0!important}"],changeDetection:0})}}return e})();var le=[{path:"",redirectTo:"my-profile",pathMatch:"full"},{path:"",children:[{path:"my-profile",component:N}]}];export{le as PROFILE_ROUTES};
@@ -0,0 +1 @@
1
+ import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-RX37I2ZC.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-V65ONV6D.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-CTINUVLP.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-I2IEFBTX.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-C5EDHVD7.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-4OZIHMKI.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-UK5OOIPU.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-OFI2JX7N.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-A7OYELWP.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};