dealposbooks 6.1.3 → 6.1.5

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 (60) hide show
  1. package/{chunk-ISXXTIWY.js → chunk-4KF3KHXX.js} +1 -1
  2. package/{chunk-KTLFZGMU.js → chunk-4VZFUZN3.js} +1 -1
  3. package/{chunk-VGUBFW74.js → chunk-5L24JVVB.js} +1 -1
  4. package/{chunk-TKCJYGJ7.js → chunk-5PLSLDXB.js} +1 -1
  5. package/{chunk-3Q6VBWXR.js → chunk-6VQJXF3K.js} +1 -1
  6. package/{chunk-AVNVVDXY.js → chunk-7EQCJ5CQ.js} +1 -1
  7. package/{chunk-SEXX6JCY.js → chunk-7GNDXSVY.js} +1 -1
  8. package/{chunk-GJZ7UP2Z.js → chunk-7MLRRYZZ.js} +1 -1
  9. package/{chunk-JW2NI65U.js → chunk-AOHYKLIT.js} +1 -1
  10. package/{chunk-22GTG56L.js → chunk-AQDR7BVQ.js} +1 -1
  11. package/{chunk-NJ7NKOXH.js → chunk-AR5EEXGB.js} +1 -1
  12. package/{chunk-B4UNNPAU.js → chunk-CQISMYK5.js} +1 -1
  13. package/{chunk-VB2L2RLZ.js → chunk-EWYKAZAY.js} +1 -1
  14. package/{chunk-WXEWVEA2.js → chunk-FOJ4EAHH.js} +1 -1
  15. package/{chunk-KTLNMY4J.js → chunk-HBTNFCXV.js} +2 -2
  16. package/{chunk-S22DJH3N.js → chunk-HV6ZDKJ5.js} +1 -1
  17. package/{chunk-FT4EOTCS.js → chunk-I7ILLKBI.js} +1 -1
  18. package/{chunk-I56EP26W.js → chunk-JON7V5CU.js} +1 -1
  19. package/{chunk-2E2HT3G5.js → chunk-JSLZAF2Y.js} +2 -2
  20. package/{chunk-ONBCSOWF.js → chunk-KBTV3NPW.js} +1 -1
  21. package/{chunk-SKLOI6YA.js → chunk-KHRXWNAN.js} +1 -1
  22. package/{chunk-DFTKFA3Q.js → chunk-LXJLUSSJ.js} +1 -1
  23. package/{chunk-XSIUVYDW.js → chunk-M5REWZUB.js} +1 -1
  24. package/{chunk-VXLFY653.js → chunk-NOUUMN37.js} +1 -1
  25. package/{chunk-G776QR46.js → chunk-NW5V6GOA.js} +1 -1
  26. package/{chunk-FC2OFTSU.js → chunk-NZCDGIN4.js} +1 -1
  27. package/{chunk-HLUS7VO7.js → chunk-O2J27MAM.js} +1 -1
  28. package/{chunk-ZXOOUYEE.js → chunk-OARXJ2AO.js} +2 -2
  29. package/{chunk-JLMT37T7.js → chunk-OULIZI64.js} +1 -1
  30. package/{chunk-BLFO3FHK.js → chunk-OWMX3IFG.js} +1 -1
  31. package/{chunk-WAZHYVUK.js → chunk-PDPZPFQS.js} +1 -1
  32. package/{chunk-BD42UNO7.js → chunk-PLMWRDFD.js} +1 -1
  33. package/{chunk-DT4J6BJG.js → chunk-Q7FUIPT2.js} +1 -1
  34. package/{chunk-Q6QCIP3G.js → chunk-QZQU2G4E.js} +1 -1
  35. package/{chunk-LAOZNPHR.js → chunk-RHV4VUI7.js} +1 -1
  36. package/{chunk-ETAZENRK.js → chunk-RO7LUIWT.js} +1 -1
  37. package/{chunk-AG7MURVY.js → chunk-RUT3FCAS.js} +1 -1
  38. package/{chunk-PDCLVUQ2.js → chunk-SDHBM3YN.js} +1 -1
  39. package/{chunk-73M5VV2Y.js → chunk-SI2DEGWZ.js} +1 -1
  40. package/{chunk-KC5M3DIA.js → chunk-SKYGDXWY.js} +1 -1
  41. package/{chunk-HZ2BHCDG.js → chunk-SMFOFPNU.js} +1 -1
  42. package/{chunk-Y3DRKZYY.js → chunk-T6K7MUTR.js} +1 -1
  43. package/{chunk-MBJAFQLX.js → chunk-TBH6VN5B.js} +1 -1
  44. package/{chunk-UDT72757.js → chunk-TICMSVO3.js} +1 -1
  45. package/{chunk-JEV5ISTD.js → chunk-TM4U3T2J.js} +1 -1
  46. package/{chunk-BM3SPWC6.js → chunk-U32YS43S.js} +1 -1
  47. package/{chunk-RF7QNTVC.js → chunk-UGMPIL3A.js} +1 -1
  48. package/{chunk-BCFRVBMG.js → chunk-VA3QYJUH.js} +1 -1
  49. package/{chunk-LFVQ3Z3B.js → chunk-VM743OBI.js} +1 -1
  50. package/{chunk-LQ4SNQGQ.js → chunk-VT4YRDJV.js} +1 -1
  51. package/{chunk-Y2WTQGRZ.js → chunk-WGQWRGS2.js} +1 -1
  52. package/{chunk-DZJWXSSZ.js → chunk-WQKIZUTB.js} +2 -2
  53. package/{chunk-YWHNYO5G.js → chunk-WZUHLZAW.js} +1 -1
  54. package/chunk-X2KQGYGV.js +1 -0
  55. package/{chunk-XBX5EZLG.js → chunk-YKKTSCC6.js} +1 -1
  56. package/{chunk-G4TD4COA.js → chunk-YSOIQYNN.js} +1 -1
  57. package/index.html +1 -1
  58. package/{main-VPM6ZDQZ.js → main-UX527QNU.js} +1 -1
  59. package/package.json +1 -1
  60. package/chunk-GP65NEEZ.js +0 -1
@@ -1 +1 @@
1
- import{a as i,b as T}from"./chunk-IEOE2XJ7.js";import{d as s}from"./chunk-7NZRUZLK.js";import{a as l}from"./chunk-WDFE7CAE.js";import{c as m}from"./chunk-FT4EOTCS.js";import{V as a,_ as c,da as r}from"./chunk-T6YHDD6J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
1
+ import{a as i,b as T}from"./chunk-IEOE2XJ7.js";import{d as s}from"./chunk-7NZRUZLK.js";import{a as l}from"./chunk-WDFE7CAE.js";import{c as m}from"./chunk-I7ILLKBI.js";import{V as a,_ as c,da as r}from"./chunk-T6YHDD6J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
@@ -1,4 +1,4 @@
1
- import{a as ne}from"./chunk-QTJQPJZS.js";import{f as Et}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{a as Dt}from"./chunk-KIJKVEX5.js";import{a as St}from"./chunk-XKI7WLHE.js";import{a as It}from"./chunk-7UYG2IJ5.js";import"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{m as ze}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as ee,b as te}from"./chunk-YKC7ERDO.js";import{b as vt,g as yt,h as Tt,i as kt}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as Ct,c as xt}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{a as gt,b as wt,h as bt}from"./chunk-XSIUVYDW.js";import{a as rt}from"./chunk-MTPMCC6U.js";import{a as pt,b as dt}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as E,c as mt,d as ct,e as ut,f as ft,g as _t,h as ht}from"./chunk-3BPX4XM7.js";import{D as st,H as Y,I as lt,b as Ke,c as Xe,d as B,g as Ye,h as et,k as tt,l as nt,o as O,t as it,w as ot,z as at}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{Ka as fe,T as ce,V as Ze,Xa as Je,Ya as X,ab as We,c as K,e as $e,f as He,ga as ue,p as je,q as Ge,v as qe,y as Qe}from"./chunk-OQDKL2MG.js";import{b as Be,d as Oe,e as Ne}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{i as Z,l as J,n as Ae,q as Re,t as W}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$ as we,$b as F,Ab as h,Ac as pe,Bc as de,Cc as me,Da as oe,Ic as Q,Jb as M,Jc as Ue,Kc as U,Mb as ae,Nb as se,Ob as L,Qb as P,Rb as A,Sb as p,Sc as Ve,T as z,Tb as l,Ub as s,Uc as Le,V as re,Vb as y,Wc as x,Zb as Te,_ as ge,_b as ke,_c as v,ac as k,ba as be,bd as R,c as N,da as b,db as a,fc as C,gc as d,hc as Ie,ic as Se,jc as De,ka as f,kc as Ee,la as _,lc as I,ld as D,ma as Ce,mc as S,md as Pe,qc as Me,sa as $,tc as G,ub as H,uc as le,vb as ve,vc as c,wa as V,wc as T,xc as q,yb as ye,za as xe,zb as j,zc as Fe}from"./chunk-T6YHDD6J.js";import{a as u,b as g}from"./chunk-PRARYYF3.js";var Lt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1,listJournalTagID:[]},options:{users:[],groups:[],accessTypes:[],journalTags:[]}}},_e=mt(ht("UserStore"),_t(Lt),ct(t=>({first:v(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:v(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:v(()=>t.data().some(o=>o.checked)),checkedData:v(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:v(()=>t.data().find(o=>o.checked)?.userID||null)})),ft(t=>{let o=b(ne);return{setFilter(i){E(t,n=>g(u({},n),{filter:i}))},onRowSelect(i){E(t,n=>{let r=n.data.map(m=>m.userID===i.userID?g(u({},m),{checked:!0}):m);return g(u({},n),{data:r})})},onRowUnselect(i){E(t,n=>{let r=n.data.map(m=>m.userID===i.userID?g(u({},m),{checked:!1}):m);return g(u({},n),{data:r})})},onHeaderCheckboxToggle(i){let n=localStorage.getItem("AUTH_USERNAME");E(t,r=>{let m=r.data.map(w=>w.userName!==n?g(u({},w),{checked:i}):g(u({},w),{checked:!1}));return g(u({},r),{data:m})})},getUserLoader:ee(N(z(()=>o.getUserLoaderList().pipe(te({next:i=>{E(t,n=>g(u({},n),{meta:i}))},error:i=>{console.error("Failed to fetch user loader list:",i)}}))))),getUserFormMeta:ee(N(z(i=>o.getUserFormMeta(i).pipe(te({next:n=>{E(t,r=>g(u({},r),{metaForm:n}))},error:n=>{console.error("Failed to fetch user form meta:",n)}}))))),getUsers:ee(N(z(i=>o.getUsers(i).pipe(te({next:n=>{E(t,r=>g(u({},r),{data:n.data.map(m=>g(u({},m),{checked:!1})),count:n.count}))},error:n=>{console.error("Failed to fetch users:",n)}})))))}}),ut({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Mt=`
1
+ import{a as ne}from"./chunk-QTJQPJZS.js";import{f as Et}from"./chunk-AP2QQRNJ.js";import"./chunk-NNU2L44G.js";import{a as Dt}from"./chunk-KIJKVEX5.js";import{a as St}from"./chunk-XKI7WLHE.js";import{a as It}from"./chunk-7UYG2IJ5.js";import"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{m as ze}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as ee,b as te}from"./chunk-YKC7ERDO.js";import{b as vt,g as yt,h as Tt,i as kt}from"./chunk-5NZPHAOL.js";import"./chunk-Y54QBXKN.js";import"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as Ct,c as xt}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{a as gt,b as wt,h as bt}from"./chunk-M5REWZUB.js";import{a as rt}from"./chunk-MTPMCC6U.js";import{a as pt,b as dt}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as E,c as mt,d as ct,e as ut,f as ft,g as _t,h as ht}from"./chunk-3BPX4XM7.js";import{D as st,H as Y,I as lt,b as Ke,c as Xe,d as B,g as Ye,h as et,k as tt,l as nt,o as O,t as it,w as ot,z as at}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import{Ka as fe,T as ce,V as Ze,Xa as Je,Ya as X,ab as We,c as K,e as $e,f as He,ga as ue,p as je,q as Ge,v as qe,y as Qe}from"./chunk-OQDKL2MG.js";import{b as Be,d as Oe,e as Ne}from"./chunk-7NZRUZLK.js";import"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-I7ILLKBI.js";import{i as Z,l as J,n as Ae,q as Re,t as W}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$ as we,$b as F,Ab as h,Ac as pe,Bc as de,Cc as me,Da as oe,Ic as Q,Jb as M,Jc as Ue,Kc as U,Mb as ae,Nb as se,Ob as L,Qb as P,Rb as A,Sb as p,Sc as Ve,T as z,Tb as l,Ub as s,Uc as Le,V as re,Vb as y,Wc as x,Zb as Te,_ as ge,_b as ke,_c as v,ac as k,ba as be,bd as R,c as N,da as b,db as a,fc as C,gc as d,hc as Ie,ic as Se,jc as De,ka as f,kc as Ee,la as _,lc as I,ld as D,ma as Ce,mc as S,md as Pe,qc as Me,sa as $,tc as G,ub as H,uc as le,vb as ve,vc as c,wa as V,wc as T,xc as q,yb as ye,za as xe,zb as j,zc as Fe}from"./chunk-T6YHDD6J.js";import{a as u,b as g}from"./chunk-PRARYYF3.js";var Lt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1,listJournalTagID:[]},options:{users:[],groups:[],accessTypes:[],journalTags:[]}}},_e=mt(ht("UserStore"),_t(Lt),ct(t=>({first:v(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:v(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:v(()=>t.data().some(o=>o.checked)),checkedData:v(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:v(()=>t.data().find(o=>o.checked)?.userID||null)})),ft(t=>{let o=b(ne);return{setFilter(i){E(t,n=>g(u({},n),{filter:i}))},onRowSelect(i){E(t,n=>{let r=n.data.map(m=>m.userID===i.userID?g(u({},m),{checked:!0}):m);return g(u({},n),{data:r})})},onRowUnselect(i){E(t,n=>{let r=n.data.map(m=>m.userID===i.userID?g(u({},m),{checked:!1}):m);return g(u({},n),{data:r})})},onHeaderCheckboxToggle(i){let n=localStorage.getItem("AUTH_USERNAME");E(t,r=>{let m=r.data.map(w=>w.userName!==n?g(u({},w),{checked:i}):g(u({},w),{checked:!1}));return g(u({},r),{data:m})})},getUserLoader:ee(N(z(()=>o.getUserLoaderList().pipe(te({next:i=>{E(t,n=>g(u({},n),{meta:i}))},error:i=>{console.error("Failed to fetch user loader list:",i)}}))))),getUserFormMeta:ee(N(z(i=>o.getUserFormMeta(i).pipe(te({next:n=>{E(t,r=>g(u({},r),{metaForm:n}))},error:n=>{console.error("Failed to fetch user form meta:",n)}}))))),getUsers:ee(N(z(i=>o.getUsers(i).pipe(te({next:n=>{E(t,r=>g(u({},r),{data:n.data.map(m=>g(u({},m),{checked:!1})),count:n.count}))},error:n=>{console.error("Failed to fetch users:",n)}})))))}}),ut({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Mt=`
2
2
  .p-drawer {
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- import{a as ct}from"./chunk-6NXDL5QO.js";import{a as ke,b as Be}from"./chunk-XTTKUB6Z.js";import{a as we}from"./chunk-ISXXTIWY.js";import{a as ue}from"./chunk-ETAZENRK.js";import{a as $t}from"./chunk-OS646RNF.js";import{b as pt}from"./chunk-G7M65KLU.js";import{b as Yt,c as mt,d as st}from"./chunk-ERHRLVEN.js";import{a as _e,b as ge}from"./chunk-7UYG2IJ5.js";import"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{m as J}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as Ve,b as Le}from"./chunk-YKC7ERDO.js";import{b as ce,i as de}from"./chunk-5NZPHAOL.js";import{a as rt,b as at}from"./chunk-Y54QBXKN.js";import{a as me,b as se}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as lt}from"./chunk-VWBZGFWI.js";import{a as Ge}from"./chunk-TTIQSVQF.js";import{b as Me}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as Ut,c as Ne}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import{d as Xe}from"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as pe}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{d as nt,e as ot,h as le}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as Je,b as ae}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as z,c as Qe,d as Ze,e as et,f as tt,g as it}from"./chunk-3BPX4XM7.js";import{H as oe,I as re,J as Wt,K as Kt,y as Ht,z as Ye}from"./chunk-U2ZZPRP6.js";import{b as Re}from"./chunk-7C7GSAC3.js";import{b as jt,c as zt,e as Q,f as Z,g as qt,i as ut,k as ee,p as te,q as ie,v as Fe,y as ne}from"./chunk-OQDKL2MG.js";import{b as Ue,e as Y,l as X}from"./chunk-7NZRUZLK.js";import{a as Ot}from"./chunk-WDFE7CAE.js";import{a as $e}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import{a as Te}from"./chunk-FT4EOTCS.js";import{B as Gt,C as Pt,i as We,l as K,q as Ke,r as U,t as $}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$a as je,Ab as h,Ac as O,Bc as A,C as Oe,Cc as j,Dc as kt,Ec as dt,Fc as xe,Gc as Bt,Ic as qe,Jc as M,Kc as F,Lc as At,Mb as L,Mc as He,Nb as N,Ob as ve,Qb as ye,R as Mt,Rb as Ee,S as Vt,Sb as s,Sc as S,T as Se,Tb as o,Tc as T,Ub as r,Uc as P,V,Vb as D,Wb as Ie,Wc as u,Xb as De,Zb as H,_ as Lt,_a as q,_b as W,_c as R,ac as w,c as Ce,da as C,db as a,fc as I,gc as c,ka as f,la as x,s as Pe,tc as ze,ub as B,uc as Nt,vc as l,wa as E,wc as b,xc as v,yc as Ae,za as fe}from"./chunk-T6YHDD6J.js";import{a as g,b as y,d as be,g as Ft}from"./chunk-PRARYYF3.js";var G=(()=>{class t{constructor(){this.httpService=C(Ot),this.authService=C(we)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetGeneralLedgerCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetGeneralLedger":"GetMultiLedger"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetMultiLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new Pt({fromObject:Object.fromEntries(Object.entries(e).map(([_,k])=>[_,String(k)]))}),p=new Gt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),d=g({params:i,headers:p},n);return this.httpService.get(void 0,"/api/BalanceSheet",d)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var mi=()=>({width:"30vw"}),si=()=>({"1199px":"75vw","575px":"90vw"}),ci=t=>({"ng-dirty ng-invalid":t}),di=t=>["/pages/journal/journal-entry/",t],ui=t=>({"text-success":t}),_i=t=>({"text-danger":t});function gi(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;a(3),v("(",e.code,")"),a(6),b(e.name)}}function fi(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;a(3),v("(",e.code,")"),a(6),b(e.name)}}function xi(t,m){t&1&&(o(0,"div",37),l(1," Account is required. "),r())}function hi(t,m){if(t&1&&(o(0,"div",38)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;a(2),b(e.value)}}function bi(t,m){if(t&1&&(o(0,"div",25)(1,"div",26),D(2,"p-radiobutton",39),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;a(2),s("inputId",e.key)("value",e.key),a(),s("for",e.key),a(),b(e.value)}}function Ci(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.customerSuggestions())}}function Si(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchSupplier(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.supplierSuggestions())}}function vi(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.customerSuggestions())}}function yi(t,m){if(t&1&&(o(0,"div")(1,"div",26),D(2,"p-radiobutton",43),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;Nt(e.key===0?"col-4":"col-6"),a(2),s("value",e.key)("inputId",e.value),a(),s("for",e.value),a(),b(e.value)}}function Ei(t,m){if(t&1&&(o(0,"form",14)(1,"div",15)(2,"label",16),l(3,"Accounts"),r(),o(4,"p-select",17),h(5,gi,10,2,"ng-template",null,5,u)(7,fi,10,2,"ng-template",null,6,u),r(),h(9,xi,2,0,"div",18),r(),o(10,"div",15)(11,"label",16),l(12,"From"),r(),o(13,"div",19),D(14,"p-datepicker",20)(15,"p-datepicker",21),r()(),o(16,"div",15)(17,"label",16),l(18,"Tag"),r(),o(19,"p-multiselect",22),h(20,hi,3,1,"ng-template",null,6,u),r()(),o(22,"div",15)(23,"label",23),l(24,"Contact Type"),r(),o(25,"div",24),ye(26,bi,5,4,"div",25,ve),r()(),L(28,Ci,4,1,"div",15)(29,Si,4,1,"div",15)(30,vi,4,1,"div",15),o(31,"div",15)(32,"label",23),l(33,"Sort order"),r(),o(34,"div",24)(35,"div",25)(36,"div",26),D(37,"p-radiobutton",27),o(38,"label",28),l(39,"Asc"),r()()(),o(40,"div",29)(41,"div",26),D(42,"p-radiobutton",30),o(43,"label",31),l(44,"Desc"),r()()()()(),o(45,"div",15)(46,"label",23),l(47,"Order By"),r(),o(48,"div",24),ye(49,yi,5,6,"div",32,ve),r()()()),t&2){let e,n,i,p=c(2);s("formGroup",p.form),a(4),s("ngClass",F(14,ci,((e=p.form.get("accountID"))==null?null:e.invalid)&&(((e=p.form.get("accountID"))==null?null:e.touched)||((e=p.form.get("accountID"))==null?null:e.dirty))))("options",p.loaderMetadata().options.accounts)("virtualScrollItemSize",50)("virtualScroll",!0),a(5),s("ngIf",((n=p.form.get("accountID"))==null?null:n.invalid)&&(((n=p.form.get("accountID"))==null?null:n.touched)||((n=p.form.get("accountID"))==null?null:n.dirty))),a(5),s("showIcon",!0),a(),s("showIcon",!0),a(4),s("options",p.loaderMetadata().options.outlets)("virtualScrollItemSize",50)("virtualScroll",!0),a(7),Ee(p.loaderMetadata().options.contactTypeOptions),a(2),N((i=p.form.controls.contactType.value)===1?28:i===2?29:30),a(9),s("value",!0),a(5),s("value",!1),a(7),Ee(p.loaderMetadata().options.orderBy)}}function Ii(t,m){if(t&1&&h(0,Ei,51,16,"form",13),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Di(t,m){if(t&1){let e=w();o(0,"p-button",45),I("onClick",function(){f(e);let i=c(2);return x(i.onToggleExportDialog())}),r()}}function Ti(t,m){if(t&1&&(o(0,"div",33),h(1,Di,1,0,"p-button",44),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function wi(t,m){t&1&&(o(0,"tr")(1,"th",52),l(2,"Number"),r(),o(3,"th",53),l(4,"Date"),r(),o(5,"th"),l(6,"Contact / Note"),r(),o(7,"th",54),l(8,"Debit"),r(),o(9,"th",54),l(10,"Credit"),r(),o(11,"th",55),l(12,"Balance"),r()())}function Ri(t,m){if(t&1&&(o(0,"div")(1,"span",63),l(2),r()()),t&2){let e=c().$implicit;a(2),v(" ",e.outletName," ")}}function Fi(t,m){if(t&1&&(o(0,"div",15),D(1,"div",64),o(2,"span",65),l(3),r()()),t&2){let e=c().$implicit;a(),s("innerHTML",e.journalNote,q),a(2),v("",e.note," ")}}function Mi(t,m){if(t&1&&(o(0,"div",15),D(1,"span",64)(2,"div",64),o(3,"span",66),l(4),r()()),t&2){let e=c().$implicit;a(),s("innerHTML",e.referenceText,q),a(),s("innerHTML",e.journalNote,q),a(2),v("",e.note," ")}}function Vi(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.debitAmount,"1.0-2")," ")}}function Li(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.creditAmount,"1.0-2")," ")}}function Ni(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.balance,"1.0-2")," ")}}function ki(t,m){if(t&1&&(o(0,"tr")(1,"td",56)(2,"a",57),l(3),r(),o(4,"span"),l(5),r(),h(6,Ri,3,1,"div",58),r(),o(7,"td",56)(8,"span",59),S(9,"date"),l(10),S(11,"date"),r()(),o(12,"td",56)(13,"div",15)(14,"a",60),l(15),r(),L(16,Fi,4,2,"div",15)(17,Mi,5,3,"div",15),r()(),o(18,"td",61),h(19,Vi,3,4,"ng-container",58),r(),o(20,"td",61),h(21,Li,3,4,"ng-container",58),r(),o(22,"td",62),h(23,Ni,3,4,"ng-container",58),r()()),t&2){let e=m.$implicit,n=c(3);a(2),s("routerLink",F(20,di,e.id)),a(),v(" ",e.number," "),a(2),v(" ",n.getReferenceText(e.referenceText)," "),a(),s("ngIf",e.outletName==null?null:e.outletName.trim()),a(2),s("pTooltip",P(9,14,e.date,"dd MMM y")),a(2),v(" ",P(11,17,e.date,"dd MMM y")," "),a(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,je),a(),b(e.contactName),a(),N(n.buildReferenceUrl(e)?16:17),a(2),s("ngClass",F(22,ui,e.debitAmount!==0)),a(),s("ngIf",e.debitAmount!==0),a(),s("ngClass",F(24,_i,e.creditAmount!==0)),a(),s("ngIf",e.creditAmount!==0),a(2),s("ngIf",e.balance!==0)}}function Bi(t,m){if(t&1&&(o(0,"tr"),D(1,"td",67),o(2,"td",68),l(3,"Total"),r(),o(4,"td",69),l(5),S(6,"number"),r(),o(7,"td",70),l(8),S(9,"number"),r(),D(10,"td"),r()),t&2){let e=c(3);a(5),v(" ",T(6,2,e.debitSubTotal())," "),a(3),v(" ",T(9,4,e.creditSubTotal())," ")}}function Ai(t,m){t&1&&(o(0,"tr")(1,"td",71)(2,"span"),l(3,"No records found."),r()()())}function Gi(t,m){if(t&1){let e=w();o(0,"button",72),I("click",function(){f(e);let i=c(3);return x(i.getGLCount())})("keyup.enter",function(){f(e);let i=c(3);return x(i.getGLCount())}),r()}}function Pi(t,m){if(t&1&&l(0),t&2){let e=c(3);v(" ",e.count()," ")}}function Oi(t,m){if(t&1){let e=w();o(0,"p-button",73),I("onClick",function(){f(e);let i=c(3);return x(i.onNextPage())}),r()}}function ji(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),h(2,wi,13,0,"ng-template",null,7,u)(4,ki,24,26,"ng-template",null,8,u)(6,Bi,11,6,"ng-template",null,4,u)(8,Ai,4,0,"ng-template",null,9,u),r(),o(10,"div",49)(11,"div"),l(12),L(13,Gi,1,0,"button",50)(14,Pi,1,1),l(15," entries "),r(),o(16,"div",33),L(17,Oi,1,0,"p-button",51),r()()()),t&2){let e=c(2);a(),s("value",e.items().data.data),a(11),Ae(" Showing ",e.pagination().first," to ",e.pagination().end," of "),a(),N(e.totalRecords()===-1?13:14),a(4),N(e.pagination().hasNext?17:-1)}}function zi(t,m){if(t&1&&h(0,ji,18,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function qi(t,m){if(t&1&&(o(0,"div",74)(1,"div",75),D(2,"div",76),r(),o(3,"div",77)(4,"div",26),D(5,"i",78),o(6,"span",79),l(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();a(),s("formGroup",e.form),a(6),Ae("Exporting data from ",T(8,3,e.filter().exportPageNumber)," - ",T(9,5,e.filter().exportPageSize))}}function Hi(t,m){if(t&1){let e=w();o(0,"p-button",80),I("onClick",function(){f(e);let i=c();return x(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Wi(t,m){if(t&1){let e=w();o(0,"p-button",81),I("click",function(){f(e);let i=c();return x(i.onToggleExportDialog())}),r(),o(1,"p-button",82),I("click",function(){f(e);let i=c();return x(i.onExport())}),r()}}var Jt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(Ue),this.roleService=C(J),this.authService=C(we),this.fb=C(Fe),this.coaService=C(lt),this.toastr=C($e),this.dayjsService=C(ue),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,p=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!p}}),this.queryFilter=Re(this.route.queryParamMap.pipe(Pe(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,p={},d=e.get("id");return Te.IsNotEmpty(d)&&(p=y(g({},p),{accountID:d})),Te.IsNotEmpty(n)&&Te.IsNotEmpty(i)&&(p=y(g({},p),{from:n,to:i})),p})),{initialValue:null}),this.loaderMetadata=Re(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),fe(()=>{let e=this.filter();e&&(Te.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),fe(()=>{let e=this.filter(),n=this.form.value.accountID;!e||Te.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(p=>e.pageNumber===1?i:y(g({},i),{data:y(g({},i.data),{data:[...p?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return ct(e)}ngOnInit(){this.route.queryParamMap.pipe(Oe(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[zt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0),orderBy:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let p=this.findNodeByKey(i.children,n);if(p)return p}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,p])=>{switch(i){case"from":n[i]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():null;break;case"to":n[i]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(p)?n[i]=p.map(d=>this.findNodeByKey(this.categoriesOptions(),d)).filter(d=>!!d):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(p)?p:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=p!=null?Number(p):0;break;case"sortAscending":case"export":n[i]=!!p;break;case"contactType":n[i]=p!=null?Number(p):null;break;default:n[i]=p}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let p=this.form.getRawValue(),{from:e,to:n}=p,i=be(p,["from","to"]);return y(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,orderBy:i.orderBy})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),p="download.csv";if(i){let _=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);_?.[1]&&(p=decodeURIComponent(_[1].replace(/"/g,"")))}let d=e.body;st(d,p,d.type)}buildExportBody(){let p=this.form.value,{from:e,to:n}=p,i=be(p,["from","to"]);return y(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>y(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(p=>y(g({},p),{pageNumber:i}))}getReferenceText(e){return/\d/.test(e)?e:""}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["header",""],["body",""],["emptymessage",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],["header","Export General Ledger",3,"visibleChange","visible","breakpoints","modal"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","display","chip","filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id","placeholder","Select Accounts","showClear","",3,"ngClass","options","virtualScrollItemSize","virtualScroll"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","iconDisplay","input","inputId","icondisplay","showClear","","styleClass","w-100",3,"showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","iconDisplay","input","inputId","icondisplay","showClear","","styleClass","w-100",3,"showIcon"],["appendTo","body","display","chip","formControlName","listOutletID","optionLabel","value","optionValue","key","placeholder","Select an Tag","showClear","",3,"options","virtualScrollItemSize","virtualScroll"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["formControlName","sortAscending","inputId","asc","name","sortAscending",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["formControlName","sortAscending","inputId","desc","name","sortAscending",3,"value"],["for","desc",1,"m-0"],[3,"class"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["formControlName","contactType","name","contactType",3,"inputId","value"],[1,"m-0",3,"for"],["appendTo","body","formControlName","contactID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","suggestions"],["appendTo","body","formControlName","ContactID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","suggestions"],["formControlName","orderBy","name","orderBy",3,"value","inputId"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["aria-label","Get journal entry count","tabindex","0","type","button",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["icon","fa-solid fa-angle-right","label","next","severity","secondary","size","small","variant","outlined"],[2,"width","200px"],[2,"width","140px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","160px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[4,"ngIf"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[1,"text-end","text-break"],[1,"badge","bg-light","text-dark"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","2"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["aria-label","Get journal entry count","tabindex","0","type","button",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["icon","fa-solid fa-angle-right","label","next","severity","secondary","size","small","variant","outlined",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["icon","fa-solid fa-xmark","severity","secondary","variant","outlined",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",10),I("filterConfirmed",function(){return f(p),x(i.onFilterOKEvent())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.initDialogVisible,_)||(i.initDialogVisible=_),x(_)}),h(1,Ii,1,1,"ng-template",null,0,u)(3,Ti,2,1,"ng-template",null,1,u)(5,zi,1,1,"ng-template",null,2,u),r(),o(7,"p-dialog",11),j("visibleChange",function(_){return f(p),A(i.isDialogExportVisible,_)||(i.isDialogExportVisible=_),x(_)}),h(8,qi,10,7,"div",12)(9,Hi,1,2,"ng-template",null,3,u)(11,Wi,2,0,"ng-template",null,4,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.initDialogVisible),s("isFilterable",!0)("pageTitle",i.pageTitle)("scrollable",!0),a(7),ze(M(11,mi)),O("visible",i.isDialogExportVisible),s("breakpoints",M(12,si))("modal",!0),a(),s("ngIf",i.form&&i.filter()))},dependencies:[le,$,We,K,pe,de,ce,ot,nt,re,oe,Ne,Ut,se,me,Be,ke,ne,ee,Q,Z,ie,te,ge,_e,Me,Xe,mt,pt,ae,X,Y,at,rt,Kt,Wt,Ye,U,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var Ki={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},St=Qe(it(Ki),Ze(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),tt(t=>{let m=C(G),e=C(ue),n={updateFilter(i){z(t,p=>y(g({},p),{filter:g(g({},p.filter),i)}))},getLoader:Ve(Ce(Se(()=>m.getIncomeStatementLoader().pipe(Le({next:i=>{z(t,p=>y(g({},p),{loader:i,filter:y(g({},p.filter),{from:e.format(i.filter.from),to:e.format(i.filter.to)})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ve(Ce(Se(i=>m.getIncomeStatement(i).pipe(Vt(()=>z(t,p=>y(g({},p),{isLoading:!0}))),Le({next:p=>{z(t,d=>y(g({},d),{data:p,isLoading:!1}))},error:p=>{console.error(p)}})))))};return n}),et({onInit:t=>{t.getLoader()}}));var vt=()=>({}),yt=t=>["/pages/chart-of-account/account/",t],Et=(t,m,e)=>({id:t,from:m,to:e}),It=()=>["/pages/report/general-ledger"];function $i(t,m){if(t&1){let e=w();o(0,"p-button",10),I("onClick",function(){f(e);let i=c(2);return x(i.onExport())}),r()}}function Yi(t,m){if(t&1&&(o(0,"div",8),h(1,$i,1,0,"p-button",9),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Revenue :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,1,e.store.totalRevenue()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No revenue records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h6",12),l(1,"Revenue"),r(),o(2,"p-table",13),h(3,Xi,7,0,"ng-template",null,3,u)(5,Ji,10,15,"ng-template",null,4,u)(7,Qi,8,3,"ng-template",null,5,u)(9,Zi,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",24),l(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total COGS :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Gross Profit :"),r(),o(13,"span",22),l(14),S(15,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,2,e.store.totalCOGS())),a(8),b(T(15,4,e.store.grossProfit()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No COGS records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),l(1,"COGS"),r(),o(2,"p-table",13),h(3,tn,7,0,"ng-template",null,3,u)(5,nn,10,15,"ng-template",null,4,u)(7,on,16,6,"ng-template",null,5,u)(9,rn,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function ln(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function pn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function mn(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Expense :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Profit / Loss :"),r(),o(13,"span",22),l(14),S(15,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,2,e.store.totalExpense())),a(8),b(T(15,4,e.store.profitOrLoss()))}}function sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No expense records available"),r()()())}function cn(t,m){if(t&1&&(o(0,"h4",12),l(1,"Expense"),r(),o(2,"p-table",13),h(3,ln,7,0,"ng-template",null,3,u)(5,pn,10,15,"ng-template",null,4,u)(7,mn,16,6,"ng-template",null,5,u)(9,sn,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function dn(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),L(4,en,11,1),L(5,an,11,1),L(6,cn,11,1),r()()),t&2){let e,n,i,p,d=c();dt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),a(),dt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),a(3),N(d.Object.keys(d.store.data().data??M(5,vt)).length>0?4:-1),a(),N(d.Object.keys(((i=d.store.data().data)==null?null:i.cogs)??M(6,vt)).length>0?5:-1),a(),N(d.Object.keys(((p=d.store.data().data)==null?null:p.expense)??M(7,vt)).length>0?6:-1)}}function un(t,m){if(t&1){let e=w();o(0,"form",25)(1,"div",26)(2,"label",27),l(3,"Tag"),r(),D(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),l(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){f(e);let p=c();return x(p.onCashierSearch(i))})("onSelect",function(i){f(e);let p=c();return x(p.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),l(11,"From - To"),r(),o(12,"div",31),D(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),a(4),s("options",e.store.loader().options.outlets)("showClear",!0)("virtualScrollItemSize",50)("virtualScroll",!0),a(4),s("showClear",!0)("showClear",!0)("suggestions",e.cashierSuggestions()),a(5),s("iconDisplay","input")("showIcon",!0),a(),s("iconDisplay","input")("showIcon",!0)}}var Qt=(()=>{class t{constructor(){this.dayjsService=C(ue),this.store=C(St),this.fb=C(Fe),this.reportService=C(G),this.roleService=C(J),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm()}onSearch(e){this.store.updateFilter(y(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ge("Cashier Suggestions"),V(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[p,d])=>(p==="from"||p==="to"?d instanceof Date&&(i[p]=this.dayjsService.format(d)):i[p]=d||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ge("Export Profit & Loss"),V(n=>{let i=n.type,p=[n],d=document.createElement("a");d.href=window.URL.createObjectURL(new Blob(p,{type:i}));let _=`profit-and-loss.${i.split("/")[1]}`;d.setAttribute("download",_),document.body.appendChild(d),d.click(),document.body.removeChild(d)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-income-statement"]],features:[qe([St])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"queryParams","routerLink"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["appendTo","body","display","chip","filterBy","value","formControlName","EntityID","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"options","showClear","virtualScrollItemSize","virtualScroll"],["appendTo","body","field","Value","formControlName","CashierID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","placeholder","Search a cashier","styleClass","w-100",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","styleClass","w-100 mb-0",3,"iconDisplay","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",7),I("filterConfirmed",function(){return f(p),x(i.onFilterOK())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),h(1,Yi,2,1,"ng-template",null,0,u)(3,dn,7,8,"ng-template",null,1,u)(5,un,15,12,"ng-template",null,2,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("isFilterable",!0)("pageTitle",i.store.data().pageTitle)("scrollable",!0))},dependencies:[le,$,K,Ne,se,me,ne,ee,Q,Z,ie,te,ge,_e,pe,de,ce,ae,Je,X,Y,Be,ke,re,oe,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Dt=Ft($t());var _n={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,Dt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Qe(it(_n),Ze(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),tt(t=>{let m=C(G),e={updateFilter:n=>{z(t,i=>y(g({},i),{filter:n}))},fetchBalanceSheet:Ve(Ce(Oe(()=>{let n=t.filter();return Object.entries(n).every(([i,p])=>p!=null&&p!=="")}),Se(n=>m.getBalanceSheet(n).pipe(Le({next:i=>{z(t,p=>y(g({},p),{data:i}))},error:i=>{console.error(i)}}))),Mt(1))),fetchLoader:Ve(Ce(Se(()=>m.getBalanceSheetLoader().pipe(Le({next:n=>{z(t,i=>y(g({},i),{metadata:n,filter:{date:(0,Dt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),et(t=>({onInit:()=>{t.fetchLoader()}})));var Zt=Ft($t());var wt=t=>["/pages/chart-of-account/account/",t],gn=(t,m)=>({id:t,to:m}),Rt=()=>["/pages/report/general-ledger"],ei=t=>({id:t});function fn(t,m){if(t&1){let e=w();o(0,"p-button",11),I("onClick",function(){f(e);let i=c(2);return x(i.onExport())}),r()}}function xn(t,m){if(t&1&&(o(0,"div",9),h(1,fn,1,0,"p-button",10),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function hn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Asset"),r(),o(5,"th",17),l(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",At(10,gn,e.accountID,n.store.filter().date))("routerLink",M(13,Rt)),a(),b(T(9,6,e.amount))}}function Cn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Asset"),r(),o(3,"td",22),l(4),S(5,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,1,e.store.totalAsset())," ")}}function Sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No asset records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",14),l(1,"Asset"),r(),o(2,"p-table",15),h(3,hn,7,0,"ng-template",null,3,u)(5,bn,10,14,"ng-template",null,4,u)(7,Cn,6,3,"ng-template",null,5,u)(9,Sn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().asset)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Liability"),r(),o(5,"th",17),l(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",25),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",F(10,ei,e.accountID))("routerLink",M(12,Rt)),a(),b(T(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2," Total Liability "),r(),o(3,"td",22),l(4),S(5,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,1,e.store.totalLiability())," ")}}function Dn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No liability records found."),r()()())}function Tn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Liability"),r(),o(2,"p-table",15),h(3,yn,7,0,"ng-template",null,3,u)(5,En,10,13,"ng-template",null,4,u)(7,In,6,3,"ng-template",null,5,u)(9,Dn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().liability)}}function wn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Equity"),r(),o(5,"th",17),l(6,"Total"),r()())}function Rn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",F(10,ei,e.accountID))("routerLink",M(12,Rt)),a(),b(T(9,6,e.counterAmount))}}function Fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Equity"),r(),o(3,"td",22),l(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),l(8," Total Liability + Equity "),r(),o(9,"td",22),l(10),S(11,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,2,e.store.totalEquity())," "),a(6),v(" ",T(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Mn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No equity records found."),r()()())}function Vn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Equity"),r(),o(2,"p-table",15),h(3,wn,7,0,"ng-template",null,3,u)(5,Rn,10,13,"ng-template",null,4,u),l(7," < "),h(8,Fn,12,6,"ng-template",null,5,u)(10,Mn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().equity)}}function Ln(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),L(2,vn,11,1),L(3,Tn,11,1),L(4,Vn,12,1),r()()),t&2){let e=c();s("showHeader",!1),a(2),N(e.Object.keys(e.store.data().asset).length>0?2:-1),a(),N(e.Object.keys(e.store.data().liability).length>0?3:-1),a(),N(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Nn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;a(2),b(e.value)}}function kn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),l(3,"Tag"),r(),o(4,"p-multiselect",29),h(5,Nn,3,1,"ng-template",null,7,u),r()(),o(7,"div",27)(8,"label",28),l(9,"From"),r(),D(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),a(4),s("options",e.store.metadata().options.outlets)("showClear",!0)("virtualScrollItemSize",50)("virtualScroll",!0),a(6),s("iconDisplay","input")("showIcon",!0)}}var ti=(()=>{class t{constructor(){this.store=C(Tt),this.ReportServiceStore=C(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=C(J),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new qt({date:new ut(new Date),outletID:new ut([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Zt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ge("Export Balance Sheet"),V(n=>{let i=n.type,p=[n],d=document.createElement("a");d.href=window.URL.createObjectURL(new Blob(p,{type:i}));let _=`balance-sheet.${i.split("/")[1]}`;d.setAttribute("download",_),document.body.appendChild(d),d.click(),document.body.removeChild(d)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-balance-sheet"]],features:[qe([Tt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","12rem"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"queryParams","routerLink"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","display","chip","formControlName","outletID","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"options","showClear","virtualScrollItemSize","virtualScroll"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","date","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",8),I("filterConfirmed",function(){return f(p),x(i.onFilterOKEvent())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),h(1,xn,2,1,"ng-template",null,0,u)(3,Ln,5,4,"ng-template",null,1,u)(5,kn,11,7,"ng-template",null,2,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("isFilterable",!0)("pageTitle",i.store.data().pageTitle)("scrollable",!0))},dependencies:[le,$,K,de,ce,pe,re,oe,ne,ee,Q,Z,ie,te,ge,_e,se,me,Me,ae,Je,X,Y,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ii=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(Ie(0,"p"),l(1,"report-comparative-balance works!"),De(),l(2,`
1
+ import{a as ct}from"./chunk-6NXDL5QO.js";import{a as ke,b as Be}from"./chunk-XTTKUB6Z.js";import{a as we}from"./chunk-4KF3KHXX.js";import{a as ue}from"./chunk-RO7LUIWT.js";import{a as $t}from"./chunk-OS646RNF.js";import{b as pt}from"./chunk-G7M65KLU.js";import{b as Yt,c as mt,d as st}from"./chunk-ERHRLVEN.js";import{a as _e,b as ge}from"./chunk-7UYG2IJ5.js";import"./chunk-7R4NAOW3.js";import"./chunk-5TAKHYWV.js";import{m as J}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as Ve,b as Le}from"./chunk-YKC7ERDO.js";import{b as ce,i as de}from"./chunk-5NZPHAOL.js";import{a as rt,b as at}from"./chunk-Y54QBXKN.js";import{a as me,b as se}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as lt}from"./chunk-VWBZGFWI.js";import{a as Ge}from"./chunk-TTIQSVQF.js";import{b as Me}from"./chunk-OVMM5CPY.js";import"./chunk-UEJR6B7A.js";import"./chunk-YYMD4TUO.js";import{b as Ut,c as Ne}from"./chunk-R46SVYN4.js";import"./chunk-2LI4CEOF.js";import{d as Xe}from"./chunk-RAFKRDM2.js";import"./chunk-RUYPEXNQ.js";import{b as pe}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{d as nt,e as ot,h as le}from"./chunk-M5REWZUB.js";import"./chunk-MTPMCC6U.js";import{a as Je,b as ae}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import{b as z,c as Qe,d as Ze,e as et,f as tt,g as it}from"./chunk-3BPX4XM7.js";import{H as oe,I as re,J as Wt,K as Kt,y as Ht,z as Ye}from"./chunk-U2ZZPRP6.js";import{b as Re}from"./chunk-7C7GSAC3.js";import{b as jt,c as zt,e as Q,f as Z,g as qt,i as ut,k as ee,p as te,q as ie,v as Fe,y as ne}from"./chunk-OQDKL2MG.js";import{b as Ue,e as Y,l as X}from"./chunk-7NZRUZLK.js";import{a as Ot}from"./chunk-WDFE7CAE.js";import{a as $e}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import{a as Te}from"./chunk-I7ILLKBI.js";import{B as Gt,C as Pt,i as We,l as K,q as Ke,r as U,t as $}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{$a as je,Ab as h,Ac as O,Bc as A,C as Oe,Cc as j,Dc as kt,Ec as dt,Fc as xe,Gc as Bt,Ic as qe,Jc as M,Kc as F,Lc as At,Mb as L,Mc as He,Nb as N,Ob as ve,Qb as ye,R as Mt,Rb as Ee,S as Vt,Sb as s,Sc as S,T as Se,Tb as o,Tc as T,Ub as r,Uc as P,V,Vb as D,Wb as Ie,Wc as u,Xb as De,Zb as H,_ as Lt,_a as q,_b as W,_c as R,ac as w,c as Ce,da as C,db as a,fc as I,gc as c,ka as f,la as x,s as Pe,tc as ze,ub as B,uc as Nt,vc as l,wa as E,wc as b,xc as v,yc as Ae,za as fe}from"./chunk-T6YHDD6J.js";import{a as g,b as y,d as be,g as Ft}from"./chunk-PRARYYF3.js";var G=(()=>{class t{constructor(){this.httpService=C(Ot),this.authService=C(we)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetGeneralLedgerCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetGeneralLedger":"GetMultiLedger"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetMultiLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new Pt({fromObject:Object.fromEntries(Object.entries(e).map(([_,k])=>[_,String(k)]))}),p=new Gt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),d=g({params:i,headers:p},n);return this.httpService.get(void 0,"/api/BalanceSheet",d)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var mi=()=>({width:"30vw"}),si=()=>({"1199px":"75vw","575px":"90vw"}),ci=t=>({"ng-dirty ng-invalid":t}),di=t=>["/pages/journal/journal-entry/",t],ui=t=>({"text-success":t}),_i=t=>({"text-danger":t});function gi(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;a(3),v("(",e.code,")"),a(6),b(e.name)}}function fi(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;a(3),v("(",e.code,")"),a(6),b(e.name)}}function xi(t,m){t&1&&(o(0,"div",37),l(1," Account is required. "),r())}function hi(t,m){if(t&1&&(o(0,"div",38)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;a(2),b(e.value)}}function bi(t,m){if(t&1&&(o(0,"div",25)(1,"div",26),D(2,"p-radiobutton",39),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;a(2),s("inputId",e.key)("value",e.key),a(),s("for",e.key),a(),b(e.value)}}function Ci(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.customerSuggestions())}}function Si(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchSupplier(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.supplierSuggestions())}}function vi(t,m){if(t&1){let e=w();o(0,"div",15)(1,"label",16),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){f(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);a(3),s("suggestions",e.customerSuggestions())}}function yi(t,m){if(t&1&&(o(0,"div")(1,"div",26),D(2,"p-radiobutton",43),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;Nt(e.key===0?"col-4":"col-6"),a(2),s("value",e.key)("inputId",e.value),a(),s("for",e.value),a(),b(e.value)}}function Ei(t,m){if(t&1&&(o(0,"form",14)(1,"div",15)(2,"label",16),l(3,"Accounts"),r(),o(4,"p-select",17),h(5,gi,10,2,"ng-template",null,5,u)(7,fi,10,2,"ng-template",null,6,u),r(),h(9,xi,2,0,"div",18),r(),o(10,"div",15)(11,"label",16),l(12,"From"),r(),o(13,"div",19),D(14,"p-datepicker",20)(15,"p-datepicker",21),r()(),o(16,"div",15)(17,"label",16),l(18,"Tag"),r(),o(19,"p-multiselect",22),h(20,hi,3,1,"ng-template",null,6,u),r()(),o(22,"div",15)(23,"label",23),l(24,"Contact Type"),r(),o(25,"div",24),ye(26,bi,5,4,"div",25,ve),r()(),L(28,Ci,4,1,"div",15)(29,Si,4,1,"div",15)(30,vi,4,1,"div",15),o(31,"div",15)(32,"label",23),l(33,"Sort order"),r(),o(34,"div",24)(35,"div",25)(36,"div",26),D(37,"p-radiobutton",27),o(38,"label",28),l(39,"Asc"),r()()(),o(40,"div",29)(41,"div",26),D(42,"p-radiobutton",30),o(43,"label",31),l(44,"Desc"),r()()()()(),o(45,"div",15)(46,"label",23),l(47,"Order By"),r(),o(48,"div",24),ye(49,yi,5,6,"div",32,ve),r()()()),t&2){let e,n,i,p=c(2);s("formGroup",p.form),a(4),s("ngClass",F(14,ci,((e=p.form.get("accountID"))==null?null:e.invalid)&&(((e=p.form.get("accountID"))==null?null:e.touched)||((e=p.form.get("accountID"))==null?null:e.dirty))))("options",p.loaderMetadata().options.accounts)("virtualScrollItemSize",50)("virtualScroll",!0),a(5),s("ngIf",((n=p.form.get("accountID"))==null?null:n.invalid)&&(((n=p.form.get("accountID"))==null?null:n.touched)||((n=p.form.get("accountID"))==null?null:n.dirty))),a(5),s("showIcon",!0),a(),s("showIcon",!0),a(4),s("options",p.loaderMetadata().options.outlets)("virtualScrollItemSize",50)("virtualScroll",!0),a(7),Ee(p.loaderMetadata().options.contactTypeOptions),a(2),N((i=p.form.controls.contactType.value)===1?28:i===2?29:30),a(9),s("value",!0),a(5),s("value",!1),a(7),Ee(p.loaderMetadata().options.orderBy)}}function Ii(t,m){if(t&1&&h(0,Ei,51,16,"form",13),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Di(t,m){if(t&1){let e=w();o(0,"p-button",45),I("onClick",function(){f(e);let i=c(2);return x(i.onToggleExportDialog())}),r()}}function Ti(t,m){if(t&1&&(o(0,"div",33),h(1,Di,1,0,"p-button",44),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function wi(t,m){t&1&&(o(0,"tr")(1,"th",52),l(2,"Number"),r(),o(3,"th",53),l(4,"Date"),r(),o(5,"th"),l(6,"Contact / Note"),r(),o(7,"th",54),l(8,"Debit"),r(),o(9,"th",54),l(10,"Credit"),r(),o(11,"th",55),l(12,"Balance"),r()())}function Ri(t,m){if(t&1&&(o(0,"div")(1,"span",63),l(2),r()()),t&2){let e=c().$implicit;a(2),v(" ",e.outletName," ")}}function Fi(t,m){if(t&1&&(o(0,"div",15),D(1,"div",64),o(2,"span",65),l(3),r()()),t&2){let e=c().$implicit;a(),s("innerHTML",e.journalNote,q),a(2),v("",e.note," ")}}function Mi(t,m){if(t&1&&(o(0,"div",15),D(1,"span",64)(2,"div",64),o(3,"span",66),l(4),r()()),t&2){let e=c().$implicit;a(),s("innerHTML",e.referenceText,q),a(),s("innerHTML",e.journalNote,q),a(2),v("",e.note," ")}}function Vi(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.debitAmount,"1.0-2")," ")}}function Li(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.creditAmount,"1.0-2")," ")}}function Ni(t,m){if(t&1&&(H(0),l(1),S(2,"number"),W()),t&2){let e=c().$implicit;a(),v(" ",P(2,1,e.balance,"1.0-2")," ")}}function ki(t,m){if(t&1&&(o(0,"tr")(1,"td",56)(2,"a",57),l(3),r(),o(4,"span"),l(5),r(),h(6,Ri,3,1,"div",58),r(),o(7,"td",56)(8,"span",59),S(9,"date"),l(10),S(11,"date"),r()(),o(12,"td",56)(13,"div",15)(14,"a",60),l(15),r(),L(16,Fi,4,2,"div",15)(17,Mi,5,3,"div",15),r()(),o(18,"td",61),h(19,Vi,3,4,"ng-container",58),r(),o(20,"td",61),h(21,Li,3,4,"ng-container",58),r(),o(22,"td",62),h(23,Ni,3,4,"ng-container",58),r()()),t&2){let e=m.$implicit,n=c(3);a(2),s("routerLink",F(20,di,e.id)),a(),v(" ",e.number," "),a(2),v(" ",n.getReferenceText(e.referenceText)," "),a(),s("ngIf",e.outletName==null?null:e.outletName.trim()),a(2),s("pTooltip",P(9,14,e.date,"dd MMM y")),a(2),v(" ",P(11,17,e.date,"dd MMM y")," "),a(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,je),a(),b(e.contactName),a(),N(n.buildReferenceUrl(e)?16:17),a(2),s("ngClass",F(22,ui,e.debitAmount!==0)),a(),s("ngIf",e.debitAmount!==0),a(),s("ngClass",F(24,_i,e.creditAmount!==0)),a(),s("ngIf",e.creditAmount!==0),a(2),s("ngIf",e.balance!==0)}}function Bi(t,m){if(t&1&&(o(0,"tr"),D(1,"td",67),o(2,"td",68),l(3,"Total"),r(),o(4,"td",69),l(5),S(6,"number"),r(),o(7,"td",70),l(8),S(9,"number"),r(),D(10,"td"),r()),t&2){let e=c(3);a(5),v(" ",T(6,2,e.debitSubTotal())," "),a(3),v(" ",T(9,4,e.creditSubTotal())," ")}}function Ai(t,m){t&1&&(o(0,"tr")(1,"td",71)(2,"span"),l(3,"No records found."),r()()())}function Gi(t,m){if(t&1){let e=w();o(0,"button",72),I("click",function(){f(e);let i=c(3);return x(i.getGLCount())})("keyup.enter",function(){f(e);let i=c(3);return x(i.getGLCount())}),r()}}function Pi(t,m){if(t&1&&l(0),t&2){let e=c(3);v(" ",e.count()," ")}}function Oi(t,m){if(t&1){let e=w();o(0,"p-button",73),I("onClick",function(){f(e);let i=c(3);return x(i.onNextPage())}),r()}}function ji(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),h(2,wi,13,0,"ng-template",null,7,u)(4,ki,24,26,"ng-template",null,8,u)(6,Bi,11,6,"ng-template",null,4,u)(8,Ai,4,0,"ng-template",null,9,u),r(),o(10,"div",49)(11,"div"),l(12),L(13,Gi,1,0,"button",50)(14,Pi,1,1),l(15," entries "),r(),o(16,"div",33),L(17,Oi,1,0,"p-button",51),r()()()),t&2){let e=c(2);a(),s("value",e.items().data.data),a(11),Ae(" Showing ",e.pagination().first," to ",e.pagination().end," of "),a(),N(e.totalRecords()===-1?13:14),a(4),N(e.pagination().hasNext?17:-1)}}function zi(t,m){if(t&1&&h(0,ji,18,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function qi(t,m){if(t&1&&(o(0,"div",74)(1,"div",75),D(2,"div",76),r(),o(3,"div",77)(4,"div",26),D(5,"i",78),o(6,"span",79),l(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();a(),s("formGroup",e.form),a(6),Ae("Exporting data from ",T(8,3,e.filter().exportPageNumber)," - ",T(9,5,e.filter().exportPageSize))}}function Hi(t,m){if(t&1){let e=w();o(0,"p-button",80),I("onClick",function(){f(e);let i=c();return x(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Wi(t,m){if(t&1){let e=w();o(0,"p-button",81),I("click",function(){f(e);let i=c();return x(i.onToggleExportDialog())}),r(),o(1,"p-button",82),I("click",function(){f(e);let i=c();return x(i.onExport())}),r()}}var Jt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(Ue),this.roleService=C(J),this.authService=C(we),this.fb=C(Fe),this.coaService=C(lt),this.toastr=C($e),this.dayjsService=C(ue),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,p=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!p}}),this.queryFilter=Re(this.route.queryParamMap.pipe(Pe(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,p={},d=e.get("id");return Te.IsNotEmpty(d)&&(p=y(g({},p),{accountID:d})),Te.IsNotEmpty(n)&&Te.IsNotEmpty(i)&&(p=y(g({},p),{from:n,to:i})),p})),{initialValue:null}),this.loaderMetadata=Re(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),fe(()=>{let e=this.filter();e&&(Te.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),fe(()=>{let e=this.filter(),n=this.form.value.accountID;!e||Te.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(p=>e.pageNumber===1?i:y(g({},i),{data:y(g({},i.data),{data:[...p?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return ct(e)}ngOnInit(){this.route.queryParamMap.pipe(Oe(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[zt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0),orderBy:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let p=this.findNodeByKey(i.children,n);if(p)return p}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,p])=>{switch(i){case"from":n[i]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():null;break;case"to":n[i]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(p)?n[i]=p.map(d=>this.findNodeByKey(this.categoriesOptions(),d)).filter(d=>!!d):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(p)?p:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=p!=null?Number(p):0;break;case"sortAscending":case"export":n[i]=!!p;break;case"contactType":n[i]=p!=null?Number(p):null;break;default:n[i]=p}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let p=this.form.getRawValue(),{from:e,to:n}=p,i=be(p,["from","to"]);return y(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,orderBy:i.orderBy})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),p="download.csv";if(i){let _=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);_?.[1]&&(p=decodeURIComponent(_[1].replace(/"/g,"")))}let d=e.body;st(d,p,d.type)}buildExportBody(){let p=this.form.value,{from:e,to:n}=p,i=be(p,["from","to"]);return y(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>y(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(p=>y(g({},p),{pageNumber:i}))}getReferenceText(e){return/\d/.test(e)?e:""}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["header",""],["body",""],["emptymessage",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],["header","Export General Ledger",3,"visibleChange","visible","breakpoints","modal"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","display","chip","filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id","placeholder","Select Accounts","showClear","",3,"ngClass","options","virtualScrollItemSize","virtualScroll"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","iconDisplay","input","inputId","icondisplay","showClear","","styleClass","w-100",3,"showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","iconDisplay","input","inputId","icondisplay","showClear","","styleClass","w-100",3,"showIcon"],["appendTo","body","display","chip","formControlName","listOutletID","optionLabel","value","optionValue","key","placeholder","Select an Tag","showClear","",3,"options","virtualScrollItemSize","virtualScroll"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["formControlName","sortAscending","inputId","asc","name","sortAscending",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["formControlName","sortAscending","inputId","desc","name","sortAscending",3,"value"],["for","desc",1,"m-0"],[3,"class"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["formControlName","contactType","name","contactType",3,"inputId","value"],[1,"m-0",3,"for"],["appendTo","body","formControlName","contactID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","suggestions"],["appendTo","body","formControlName","ContactID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","styleClass","w-100",3,"completeMethod","suggestions"],["formControlName","orderBy","name","orderBy",3,"value","inputId"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["aria-label","Get journal entry count","tabindex","0","type","button",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["icon","fa-solid fa-angle-right","label","next","severity","secondary","size","small","variant","outlined"],[2,"width","200px"],[2,"width","140px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","160px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[4,"ngIf"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[1,"text-end","text-break"],[1,"badge","bg-light","text-dark"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","2"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["aria-label","Get journal entry count","tabindex","0","type","button",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["icon","fa-solid fa-angle-right","label","next","severity","secondary","size","small","variant","outlined",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["icon","fa-solid fa-xmark","severity","secondary","variant","outlined",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",10),I("filterConfirmed",function(){return f(p),x(i.onFilterOKEvent())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.initDialogVisible,_)||(i.initDialogVisible=_),x(_)}),h(1,Ii,1,1,"ng-template",null,0,u)(3,Ti,2,1,"ng-template",null,1,u)(5,zi,1,1,"ng-template",null,2,u),r(),o(7,"p-dialog",11),j("visibleChange",function(_){return f(p),A(i.isDialogExportVisible,_)||(i.isDialogExportVisible=_),x(_)}),h(8,qi,10,7,"div",12)(9,Hi,1,2,"ng-template",null,3,u)(11,Wi,2,0,"ng-template",null,4,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.initDialogVisible),s("isFilterable",!0)("pageTitle",i.pageTitle)("scrollable",!0),a(7),ze(M(11,mi)),O("visible",i.isDialogExportVisible),s("breakpoints",M(12,si))("modal",!0),a(),s("ngIf",i.form&&i.filter()))},dependencies:[le,$,We,K,pe,de,ce,ot,nt,re,oe,Ne,Ut,se,me,Be,ke,ne,ee,Q,Z,ie,te,ge,_e,Me,Xe,mt,pt,ae,X,Y,at,rt,Kt,Wt,Ye,U,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var Ki={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},St=Qe(it(Ki),Ze(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),tt(t=>{let m=C(G),e=C(ue),n={updateFilter(i){z(t,p=>y(g({},p),{filter:g(g({},p.filter),i)}))},getLoader:Ve(Ce(Se(()=>m.getIncomeStatementLoader().pipe(Le({next:i=>{z(t,p=>y(g({},p),{loader:i,filter:y(g({},p.filter),{from:e.format(i.filter.from),to:e.format(i.filter.to)})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ve(Ce(Se(i=>m.getIncomeStatement(i).pipe(Vt(()=>z(t,p=>y(g({},p),{isLoading:!0}))),Le({next:p=>{z(t,d=>y(g({},d),{data:p,isLoading:!1}))},error:p=>{console.error(p)}})))))};return n}),et({onInit:t=>{t.getLoader()}}));var vt=()=>({}),yt=t=>["/pages/chart-of-account/account/",t],Et=(t,m,e)=>({id:t,from:m,to:e}),It=()=>["/pages/report/general-ledger"];function $i(t,m){if(t&1){let e=w();o(0,"p-button",10),I("onClick",function(){f(e);let i=c(2);return x(i.onExport())}),r()}}function Yi(t,m){if(t&1&&(o(0,"div",8),h(1,$i,1,0,"p-button",9),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Revenue :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,1,e.store.totalRevenue()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No revenue records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h6",12),l(1,"Revenue"),r(),o(2,"p-table",13),h(3,Xi,7,0,"ng-template",null,3,u)(5,Ji,10,15,"ng-template",null,4,u)(7,Qi,8,3,"ng-template",null,5,u)(9,Zi,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",24),l(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total COGS :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Gross Profit :"),r(),o(13,"span",22),l(14),S(15,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,2,e.store.totalCOGS())),a(8),b(T(15,4,e.store.grossProfit()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No COGS records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),l(1,"COGS"),r(),o(2,"p-table",13),h(3,tn,7,0,"ng-template",null,3,u)(5,nn,10,15,"ng-template",null,4,u)(7,on,16,6,"ng-template",null,5,u)(9,rn,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function ln(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function pn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=xe(0),i=xe(1);a(2),b(e.code),a(2),s("routerLink",F(8,yt,e.accountID)),a(),b(e.name),a(2),s("queryParams",He(10,Et,e.accountID,n,i))("routerLink",M(14,It)),a(),b(T(9,6,e.amount))}}function mn(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Expense :"),r(),o(5,"span",22),l(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Profit / Loss :"),r(),o(13,"span",22),l(14),S(15,"number"),r()()()()),t&2){let e=c(3);a(6),b(T(7,2,e.store.totalExpense())),a(8),b(T(15,4,e.store.profitOrLoss()))}}function sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No expense records available"),r()()())}function cn(t,m){if(t&1&&(o(0,"h4",12),l(1,"Expense"),r(),o(2,"p-table",13),h(3,ln,7,0,"ng-template",null,3,u)(5,pn,10,15,"ng-template",null,4,u)(7,mn,16,6,"ng-template",null,5,u)(9,sn,4,0,"ng-template",null,6,u),r()),t&2){let e,n=c(2);a(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function dn(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),L(4,en,11,1),L(5,an,11,1),L(6,cn,11,1),r()()),t&2){let e,n,i,p,d=c();dt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),a(),dt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),a(3),N(d.Object.keys(d.store.data().data??M(5,vt)).length>0?4:-1),a(),N(d.Object.keys(((i=d.store.data().data)==null?null:i.cogs)??M(6,vt)).length>0?5:-1),a(),N(d.Object.keys(((p=d.store.data().data)==null?null:p.expense)??M(7,vt)).length>0?6:-1)}}function un(t,m){if(t&1){let e=w();o(0,"form",25)(1,"div",26)(2,"label",27),l(3,"Tag"),r(),D(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),l(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){f(e);let p=c();return x(p.onCashierSearch(i))})("onSelect",function(i){f(e);let p=c();return x(p.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),l(11,"From - To"),r(),o(12,"div",31),D(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),a(4),s("options",e.store.loader().options.outlets)("showClear",!0)("virtualScrollItemSize",50)("virtualScroll",!0),a(4),s("showClear",!0)("showClear",!0)("suggestions",e.cashierSuggestions()),a(5),s("iconDisplay","input")("showIcon",!0),a(),s("iconDisplay","input")("showIcon",!0)}}var Qt=(()=>{class t{constructor(){this.dayjsService=C(ue),this.store=C(St),this.fb=C(Fe),this.reportService=C(G),this.roleService=C(J),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm()}onSearch(e){this.store.updateFilter(y(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ge("Cashier Suggestions"),V(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[p,d])=>(p==="from"||p==="to"?d instanceof Date&&(i[p]=this.dayjsService.format(d)):i[p]=d||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ge("Export Profit & Loss"),V(n=>{let i=n.type,p=[n],d=document.createElement("a");d.href=window.URL.createObjectURL(new Blob(p,{type:i}));let _=`profit-and-loss.${i.split("/")[1]}`;d.setAttribute("download",_),document.body.appendChild(d),d.click(),document.body.removeChild(d)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-income-statement"]],features:[qe([St])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"queryParams","routerLink"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["appendTo","body","display","chip","filterBy","value","formControlName","EntityID","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"options","showClear","virtualScrollItemSize","virtualScroll"],["appendTo","body","field","Value","formControlName","CashierID","inputStyleClass","w-100","optionLabel","Value","optionValue","Key","placeholder","Search a cashier","styleClass","w-100",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","from","inputId","icondisplay","styleClass","w-100 mb-0",3,"iconDisplay","showIcon"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","to","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",7),I("filterConfirmed",function(){return f(p),x(i.onFilterOK())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),h(1,Yi,2,1,"ng-template",null,0,u)(3,dn,7,8,"ng-template",null,1,u)(5,un,15,12,"ng-template",null,2,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("isFilterable",!0)("pageTitle",i.store.data().pageTitle)("scrollable",!0))},dependencies:[le,$,K,Ne,se,me,ne,ee,Q,Z,ie,te,ge,_e,pe,de,ce,ae,Je,X,Y,Be,ke,re,oe,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Dt=Ft($t());var _n={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,Dt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Qe(it(_n),Ze(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),tt(t=>{let m=C(G),e={updateFilter:n=>{z(t,i=>y(g({},i),{filter:n}))},fetchBalanceSheet:Ve(Ce(Oe(()=>{let n=t.filter();return Object.entries(n).every(([i,p])=>p!=null&&p!=="")}),Se(n=>m.getBalanceSheet(n).pipe(Le({next:i=>{z(t,p=>y(g({},p),{data:i}))},error:i=>{console.error(i)}}))),Mt(1))),fetchLoader:Ve(Ce(Se(()=>m.getBalanceSheetLoader().pipe(Le({next:n=>{z(t,i=>y(g({},i),{metadata:n,filter:{date:(0,Dt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),et(t=>({onInit:()=>{t.fetchLoader()}})));var Zt=Ft($t());var wt=t=>["/pages/chart-of-account/account/",t],gn=(t,m)=>({id:t,to:m}),Rt=()=>["/pages/report/general-ledger"],ei=t=>({id:t});function fn(t,m){if(t&1){let e=w();o(0,"p-button",11),I("onClick",function(){f(e);let i=c(2);return x(i.onExport())}),r()}}function xn(t,m){if(t&1&&(o(0,"div",9),h(1,fn,1,0,"p-button",10),r()),t&2){let e=c();a(),s("ngIf",e.roleService.permissions().global.export)}}function hn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Asset"),r(),o(5,"th",17),l(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",At(10,gn,e.accountID,n.store.filter().date))("routerLink",M(13,Rt)),a(),b(T(9,6,e.amount))}}function Cn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Asset"),r(),o(3,"td",22),l(4),S(5,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,1,e.store.totalAsset())," ")}}function Sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No asset records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",14),l(1,"Asset"),r(),o(2,"p-table",15),h(3,hn,7,0,"ng-template",null,3,u)(5,bn,10,14,"ng-template",null,4,u)(7,Cn,6,3,"ng-template",null,5,u)(9,Sn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().asset)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Liability"),r(),o(5,"th",17),l(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",25),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",F(10,ei,e.accountID))("routerLink",M(12,Rt)),a(),b(T(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2," Total Liability "),r(),o(3,"td",22),l(4),S(5,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,1,e.store.totalLiability())," ")}}function Dn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No liability records found."),r()()())}function Tn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Liability"),r(),o(2,"p-table",15),h(3,yn,7,0,"ng-template",null,3,u)(5,En,10,13,"ng-template",null,4,u)(7,In,6,3,"ng-template",null,5,u)(9,Dn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().liability)}}function wn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Equity"),r(),o(5,"th",17),l(6,"Total"),r()())}function Rn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;a(2),b(e.code),a(2),s("routerLink",F(8,wt,e.accountID)),a(),b(e.name),a(2),s("queryParams",F(10,ei,e.accountID))("routerLink",M(12,Rt)),a(),b(T(9,6,e.counterAmount))}}function Fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Equity"),r(),o(3,"td",22),l(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),l(8," Total Liability + Equity "),r(),o(9,"td",22),l(10),S(11,"number"),r()()),t&2){let e=c(3);a(4),v(" ",T(5,2,e.store.totalEquity())," "),a(6),v(" ",T(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Mn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No equity records found."),r()()())}function Vn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Equity"),r(),o(2,"p-table",15),h(3,wn,7,0,"ng-template",null,3,u)(5,Rn,10,13,"ng-template",null,4,u),l(7," < "),h(8,Fn,12,6,"ng-template",null,5,u)(10,Mn,4,0,"ng-template",null,6,u),r()),t&2){let e=c(2);a(2),s("value",e.store.data().equity)}}function Ln(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),L(2,vn,11,1),L(3,Tn,11,1),L(4,Vn,12,1),r()()),t&2){let e=c();s("showHeader",!1),a(2),N(e.Object.keys(e.store.data().asset).length>0?2:-1),a(),N(e.Object.keys(e.store.data().liability).length>0?3:-1),a(),N(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Nn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;a(2),b(e.value)}}function kn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),l(3,"Tag"),r(),o(4,"p-multiselect",29),h(5,Nn,3,1,"ng-template",null,7,u),r()(),o(7,"div",27)(8,"label",28),l(9,"From"),r(),D(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),a(4),s("options",e.store.metadata().options.outlets)("showClear",!0)("virtualScrollItemSize",50)("virtualScroll",!0),a(6),s("iconDisplay","input")("showIcon",!0)}}var ti=(()=>{class t{constructor(){this.store=C(Tt),this.ReportServiceStore=C(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=C(J),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new qt({date:new ut(new Date),outletID:new ut([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Zt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ge("Export Balance Sheet"),V(n=>{let i=n.type,p=[n],d=document.createElement("a");d.href=window.URL.createObjectURL(new Blob(p,{type:i}));let _=`balance-sheet.${i.split("/")[1]}`;d.setAttribute("download",_),document.body.appendChild(d),d.click(),document.body.removeChild(d)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-balance-sheet"]],features:[qe([Tt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"filterConfirmed","isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","isDialogFilterVisible","isInitDialogFilterVisible","isFilterable","pageTitle","scrollable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick",4,"ngIf"],["icon","fa-solid fa-upload","label","Export","severity","secondary","variant","outlined",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","12rem"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"queryParams","routerLink"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["appendTo","body","display","chip","formControlName","outletID","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"options","showClear","virtualScrollItemSize","virtualScroll"],["appendTo","body","dateFormat","dd M yy","fluid","","formControlName","date","inputId","icondisplay","styleClass","w-100",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let p=w();o(0,"app-main-panel",8),I("filterConfirmed",function(){return f(p),x(i.onFilterOKEvent())}),j("isDialogFilterVisibleChange",function(_){return f(p),A(i.dialogFilterVisible,_)||(i.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return f(p),A(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),h(1,xn,2,1,"ng-template",null,0,u)(3,Ln,5,4,"ng-template",null,1,u)(5,kn,11,7,"ng-template",null,2,u),r()}n&2&&(O("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("isFilterable",!0)("pageTitle",i.store.data().pageTitle)("scrollable",!0))},dependencies:[le,$,K,de,ce,pe,re,oe,ne,ee,Q,Z,ie,te,ge,_e,se,me,Me,ae,Je,X,Y,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ii=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(Ie(0,"p"),l(1,"report-comparative-balance works!"),De(),l(2,`
2
2
  ,
3
3
  `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ni=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(Ie(0,"p"),l(1,"report-cash-flow works!"),De(),l(2,`
4
4
  ,
@@ -1 +1 @@
1
- import"./chunk-PRARYYF3.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-KTLFZGMU.js").then(o=>o.UserPageComponent)},{path:"groups",loadComponent:()=>import("./chunk-DZJWXSSZ.js").then(o=>o.GroupPageComponent)},{path:"groups/forms",loadComponent:()=>import("./chunk-WAZHYVUK.js").then(o=>o.GroupFormComponent)}]}];export{t as USERS_ROUTES};
1
+ import"./chunk-PRARYYF3.js";var t=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"",children:[{path:"users",loadComponent:()=>import("./chunk-4VZFUZN3.js").then(o=>o.UserPageComponent)},{path:"groups",loadComponent:()=>import("./chunk-WQKIZUTB.js").then(o=>o.GroupPageComponent)},{path:"groups/forms",loadComponent:()=>import("./chunk-PDPZPFQS.js").then(o=>o.GroupFormComponent)}]}];export{t as USERS_ROUTES};
@@ -1 +1 @@
1
- import{a as y,b as K}from"./chunk-G776QR46.js";import"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{o as I,t as O}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as b,Mb as _,Nb as h,R as k,Sb as l,Sc as s,T as w,Tb as o,Tc as m,Ub as n,V as B,Vb as u,Wc as S,ac as x,da as c,db as r,f as M,fc as v,gc as a,ka as C,la as d,ma as P,na as $,s as g,tc as T,ub as A}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,f){if(t&1){let e=x();o(0,"p-button",6),v("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function W(t,f){if(t&1){let e=x();o(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,f){if(t&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ve=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(V),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(j)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[E([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[J,O,G,N,D,R,L,H,z,q,K,I],encapsulation:2})}}return t})();export{ve as CoaConfigurationComponent};
1
+ import{a as y,b as K}from"./chunk-NW5V6GOA.js";import"./chunk-RO7LUIWT.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as D}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as J}from"./chunk-M5REWZUB.js";import"./chunk-MTPMCC6U.js";import{a as H,b as L}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as N,I as G,J as q,K as z}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-I7ILLKBI.js";import{o as I,t as O}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as F,Ic as E,Jc as b,Mb as _,Nb as h,R as k,Sb as l,Sc as s,T as w,Tb as o,Tc as m,Ub as n,V as B,Vb as u,Wc as S,ac as x,da as c,db as r,f as M,fc as v,gc as a,ka as C,la as d,ma as P,na as $,s as g,tc as T,ub as A}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var Q=()=>({height:"calc(100vh - 100px)"});function U(t,f){if(t&1){let e=x();o(0,"p-button",6),v("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function W(t,f){if(t&1){let e=x();o(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function X(t,f){if(t&1&&(o(0,"div",3),_(1,U,1,0,"p-button",4),_(2,W,3,6,"p-button",5),n()),t&2){let e=a();r(),h(e.roleService.permissions().migrate.delete?1:-1),r(),h(e.roleService.permissions().migrate.create?2:-1)}}function Y(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();T(b(12,Q)),r(),T(b(13,Q)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ve=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(V),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(j)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[E([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),F(1,X,3,2,"ng-template",null,0,S)(3,Y,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[J,O,G,N,D,R,L,H,z,q,K,I],encapsulation:2})}}return t})();export{ve as CoaConfigurationComponent};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-ISXXTIWY.js";import{a}from"./chunk-WDFE7CAE.js";import{_ as o,da as n}from"./chunk-T6YHDD6J.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};
1
+ import{a as i}from"./chunk-4KF3KHXX.js";import{a}from"./chunk-WDFE7CAE.js";import{_ as o,da as n}from"./chunk-T6YHDD6J.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};
@@ -1 +1 @@
1
- import{a as y,b as J}from"./chunk-G776QR46.js";import"./chunk-ETAZENRK.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as O}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as z}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as G,b as H}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as D,I as N,J as L,K as q}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-FT4EOTCS.js";import{o as F,t as I}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as P,Ic as $,Jc as b,Mb as x,Nb as C,R as M,Sb as c,Sc as s,T as k,Tb as n,Tc as l,Ub as o,Vb as u,Wc as S,ac as h,da as m,db as r,f as E,fc as v,gc as a,ka as g,la as _,ma as w,na as A,s as f,tc as T,ub as B}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,d){if(t&1){let e=h();n(0,"p-button",6),v("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,d){if(t&1){let e=h();n(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){g(e);let p=a(2);return _(p.onMigrate())}),o()}if(t&2){let e=a(2);c("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,d){if(t&1&&(n(0,"div",3),x(1,Q,1,0,"p-button",4),x(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),C(e.roleService.permissions().migrate.delete?1:-1),r(),C(e.roleService.permissions().migrate.create?2:-1)}}function X(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),w(),n(5,"svg",10),u(6,"path",11),o(),A(),u(7,"app-migration-cards",12),s(8,"async"),o()()()),t&2){let e=a();T(b(12,K)),r(),T(b(13,K)),r(2),c("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),c("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var xe=(()=>{class t{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new E(void 0),this.pageTitle="Expense Account",this.roleService=m(j)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getExpenseAccountCount()),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-expense-account"]],features:[$([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),P(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),o()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[z,I,O,R,H,G,q,L,J,N,D,F],encapsulation:2})}}return t})();export{xe as ExpenseAccountComponent};
1
+ import{a as y,b as J}from"./chunk-NW5V6GOA.js";import"./chunk-RO7LUIWT.js";import"./chunk-OS646RNF.js";import{m as j}from"./chunk-SPDFU2FM.js";import"./chunk-IEOE2XJ7.js";import{a as R,b as O}from"./chunk-OVMM5CPY.js";import"./chunk-KG3OLRKU.js";import{h as z}from"./chunk-M5REWZUB.js";import"./chunk-MTPMCC6U.js";import{a as G,b as H}from"./chunk-RO474VQ2.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{H as D,I as N,J as L,K as q}from"./chunk-U2ZZPRP6.js";import"./chunk-7C7GSAC3.js";import"./chunk-OQDKL2MG.js";import"./chunk-WDFE7CAE.js";import{a as V}from"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import"./chunk-I7ILLKBI.js";import{o as F,t as I}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as P,Ic as $,Jc as b,Mb as x,Nb as C,R as M,Sb as c,Sc as s,T as k,Tb as n,Tc as l,Ub as o,Vb as u,Wc as S,ac as h,da as m,db as r,f as E,fc as v,gc as a,ka as g,la as _,ma as w,na as A,s as f,tc as T,ub as B}from"./chunk-T6YHDD6J.js";import"./chunk-PRARYYF3.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,d){if(t&1){let e=h();n(0,"p-button",6),v("onClick",function(){g(e);let p=a(2);return _(p.onFormat())}),o()}}function U(t,d){if(t&1){let e=h();n(0,"p-button",7),s(1,"async"),s(2,"async"),v("onClick",function(){g(e);let p=a(2);return _(p.onMigrate())}),o()}if(t&2){let e=a(2);c("disabled",l(1,2,e.countInBooks$)!==0)("pTooltip",l(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,d){if(t&1&&(n(0,"div",3),x(1,Q,1,0,"p-button",4),x(2,U,3,6,"p-button",5),o()),t&2){let e=a();r(),C(e.roleService.permissions().migrate.delete?1:-1),r(),C(e.roleService.permissions().migrate.create?2:-1)}}function X(t,d){if(t&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),w(),n(5,"svg",10),u(6,"path",11),o(),A(),u(7,"app-migration-cards",12),s(8,"async"),o()()()),t&2){let e=a();T(b(12,K)),r(),T(b(13,K)),r(2),c("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),c("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var xe=(()=>{class t{constructor(){this.migrateService=m(y),this.toastr=m(V),this.refresh$=new E(void 0),this.pageTitle="Expense Account",this.roleService=m(j)}ngOnInit(){let e=this.refresh$.pipe(k(()=>this.migrateService.getExpenseAccountCount()),M(1));this.countInPOS$=e.pipe(f(i=>Number(i.pos))),this.countInBooks$=e.pipe(f(i=>Number(i.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-expense-account"]],features:[$([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(n(0,"app-main-panel",2),P(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),o()),i&2&&c("pageTitle",p.pageTitle)},dependencies:[z,I,O,R,H,G,q,L,J,N,D,F],encapsulation:2})}}return t})();export{xe as ExpenseAccountComponent};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-UUVSQAFK.js";import{c as xe}from"./chunk-ACRPKVZ4.js";import{b as ye}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Q}from"./chunk-TTIQSVQF.js";import{b as Te}from"./chunk-OVMM5CPY.js";import{a as T,b as D}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{f as S,g as E,h as ke}from"./chunk-XSIUVYDW.js";import"./chunk-MTPMCC6U.js";import{a as Me,b as Pe}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{J as Oe,K as ve}from"./chunk-U2ZZPRP6.js";import{a as w,b as H}from"./chunk-7C7GSAC3.js";import{Xa as be,y as fe}from"./chunk-OQDKL2MG.js";import{l as ue}from"./chunk-7NZRUZLK.js";import{a as Ce}from"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import{b as q}from"./chunk-FT4EOTCS.js";import{C as ge,r as he,t as _e}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as N,Ac as v,Bc as k,Cc as y,Fa as ee,I as z,Mb as C,Nb as f,Ob as ie,Qb as oe,Rb as ae,Sb as m,Sc as K,Tb as a,Tc as X,Ub as r,V as I,Vb as _,Wc as Y,_ as $,_c as le,ac as u,ad as b,da as g,db as c,fc as B,fd as de,gc as s,hd as me,ib as te,ka as l,kc as re,la as d,lc as se,mb as ne,mc as ce,oa as W,qc as R,s as F,t as A,u as j,ub as P,vc as O,wa as h,wc as pe,xc as J,za as M}from"./chunk-T6YHDD6J.js";import{a as L,b as V}from"./chunk-PRARYYF3.js";var U=(()=>{class n{constructor(){this.httpService=g(Ce)}createDashboardParams(e){return new ge().set("DashboardPeriod",e)}fetchDashboardLoader(){return this.httpService.get(void 0,"api/DashboardLoader")}fetchCashAndSplineData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/getcashandbank",{params:t})}fetchCashAndBankPieData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/getcashandbankpiechart",{params:t})}fetchExpenseSplineData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/GetExpense",{params:t})}fetchExpensePieData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/GetExpensePieChart",{params:t})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Be(n,p){if(n&1){let e=u();a(0,"p-card",2)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsSpline),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Le(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}function Ve(n,p){if(n&1){let e=u();a(0,"p-card",4)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsPie),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Fe(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}var Ee=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=g(U),this.cdr=g(me),this.injector=g(W),this.params=h({dashboardPeriod:2}),this.cashBankTitle=b(),this.amountCashBank=b(),this.isLoading=de(!0),this.tooltip=b(),this.cashAndBankSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:e})=>A([this.dashboardService.fetchCashAndSplineData(e),this.dashboardService.fetchCashAndBankPieData(e)])),Q("Cash & Bank Dashboard Data"),I(([e])=>{this.isLoading.set(!1),this.amountCashBank.emit(e.data),this.tooltip.emit(e.toolTip)}),F(([e,t])=>({splineData:e,pieData:t}))),{initialValue:null}),M(()=>{let e=this.cashAndBankSource();if(!e)return;let{splineData:t,pieData:i}=e;this.cashBankTitle.emit(t.title),te(()=>{this.chartOptionsSpline={chart:{height:300},title:{text:t.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...t.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},t.chart.series),{type:"spline",name:"Amount",data:[...t.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:t.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0,this.cdr.detectChanges()},{injector:this.injector})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-cash-bank"]],inputs:{isLoading:[1,"isLoading"]},outputs:{cashBankTitle:"cashBankTitle",amountCashBank:"amountCashBank",isLoading:"isLoadingChange",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1),C(2,Be,2,4,"p-card",2)(3,Le,2,0,"p-card"),r(),a(4,"div",3),C(5,Ve,2,4,"p-card",4)(6,Fe,2,0,"p-card"),r()()),t&2&&(c(2),f(i.isLoading()?3:2),c(3),f(i.isLoading()?6:5))},dependencies:[G,E,S,D,T],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function Ae(n,p){if(n&1){let e=u();a(0,"p-card",2)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsSpline),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function je(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}function ze(n,p){if(n&1){let e=u();a(0,"p-card",4)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsPie),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Ie(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}var De=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=g(U),this.isLoading=h(!0),this.amountExpense=b(),this.params=h({dashboardPeriod:2}),this.expenseTitle=b(),this.tooltip=b(),this.expenseSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:e})=>A([this.dashboardService.fetchExpenseSplineData(e),this.dashboardService.fetchExpensePieData(e)])),Q("Expense Dashboard Data"),I(([e])=>{this.isLoading.set(!1),this.amountExpense.emit(e.data),this.expenseTitle.emit(e.title),this.tooltip.emit(e.toolTip)}),F(([e,t])=>({splineData:e,pieData:t}))),{initialValue:null}),M(()=>{let e=this.expenseSource();if(!e)return;let{splineData:t,pieData:i}=e;console.log("Spline Data:",t),console.log("Pie Data:",i),this.chartOptionsSpline={chart:{height:300},title:{text:t.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...t.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},t.chart.series),{type:"spline",name:"Amount",data:[...t.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:t.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-expense"]],outputs:{amountExpense:"amountExpense",expenseTitle:"expenseTitle",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1),C(2,Ae,2,4,"p-card",2)(3,je,2,0,"p-card"),r(),a(4,"div",3),C(5,ze,2,4,"p-card",4)(6,Ie,2,0,"p-card"),r()()),t&2&&(c(2),f(i.isLoading()?3:2),c(3),f(i.isLoading()?6:5))},dependencies:[G,E,S,D,T],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function We(n,p){if(n&1&&(a(0,"span"),O(1),r()),n&2){let e=p.$implicit;c(),pe(e)}}function Ne(n,p){if(n&1&&(a(0,"div",21),oe(1,We,2,1,"span",null,ie),r()),n&2){let e=s(3);c(),ae(e.tooltipExpense())}}function Re(n,p){if(n&1){let e=u();_(0,"input",10,1),a(2,"button",11),B("click",function(i){l(e);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",13)(5,"div",14),_(6,"i",15),r()(),a(7,"p-card",16,2),N(9,Ne,3,0,"ng-template",null,3,Y),a(11,"div",17)(12,"div",18)(13,"span",19),O(14,"Expense"),r(),a(15,"p",20),O(16),K(17,"number"),r()()()()()()}if(n&2){let e=R(10),t=s(2);c(7),m("pTooltip",e)("fitContent",!1),c(9),J(" ",X(17,3,t.amounts.expense())," ")}}function qe(n,p){n&1&&_(0,"p-skeleton",9)}function He(n,p){if(n&1&&(a(0,"div",17)(1,"div",18)(2,"span",19),O(3,"Cash and Bank"),r(),a(4,"p",20),O(5),K(6,"number"),r()()()),n&2){let e=s(3);c(5),J(" ",e.amounts.cashBank()===0?"-":X(6,1,e.amounts.cashBank())," ")}}function Qe(n,p){if(n&1){let e=u();_(0,"input",22,4),a(2,"button",11),B("click",function(i){l(e);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",23),_(5,"i",24),r(),a(6,"p-card",25,2),N(8,He,7,3,"ng-template",26),r()()()}if(n&2){let e=s(2);c(6),m("pTooltip",e.tooltip.cashBank())}}function Ge(n,p){n&1&&_(0,"p-skeleton",9)}function Ue(n,p){if(n&1){let e=u();a(0,"app-expense",27),B("amountExpense",function(i){l(e);let o=s(2);return d(o.onAmountExpense(i))})("expenseTitle",function(i){l(e);let o=s(2);return d(o.onExpenseTitle(i))})("tooltip",function(i){l(e);let o=s(2);return d(o.onExpenseTooltip(i))}),r()}}function Je(n,p){if(n&1){let e=u();a(0,"app-cash-bank",28),B("cashBankTitle",function(i){l(e);let o=s(2);return d(o.onCashBankTitle(i))})("amountCashBank",function(i){l(e);let o=s(2);return d(o.onAmountCashBank(i))})("tooltip",function(i){l(e);let o=s(2);return d(o.onCashBankTooltip(i))}),r()}}function Ke(n,p){if(n&1&&(a(0,"p-panel")(1,"main",6)(2,"div",7)(3,"div",8),C(4,Re,18,5)(5,qe,1,0,"p-skeleton",9),r(),a(6,"div",8),C(7,Qe,9,1)(8,Ge,1,0,"p-skeleton",9),r()(),C(9,Ue,1,0,"app-expense")(10,Je,1,0,"app-cash-bank"),r()()),n&2){let e=s();c(4),f(e.isLoading()?5:4),c(3),f(e.isLoading()?8:7),c(2),f(e.activeIndex()===0?9:e.activeIndex()===1?10:-1)}}var Qt=(()=>{class n{constructor(){this.activeIndex=h(0),this.pageTitle=h("Dashboard"),this.isLoading=h(!0),this.tooltip={cashBank:h(""),expense:h("")},this.tooltipExpense=le(()=>this.tooltip.expense().match(/^(.*?)\s*(\[[^\]]+\])$/)?[RegExp.$1.trim(),RegExp.$2.trim()]:[this.tooltip.expense()]),this.amounts={cashBank:h(0),expense:h(0)},this.renderer=g(ne),this.injector=g(W)}ngAfterViewInit(){M(()=>{this.isLoading()||queueMicrotask(()=>this.runCardEffect())},{injector:this.injector}),M(()=>{this.activeIndex(),queueMicrotask(()=>this.runCardEffect())},{injector:this.injector})}onTabChange(e){this.activeIndex.set(e)}handleLinkClick(e,t){e.stopPropagation(),t.checked=!t.checked,t.checked&&(console.log(t.value),this.onTabChange(Number(t.value)))}onCashBankTitle(e){this.pageTitle.set(e),this.isLoading.set(!1)}onExpenseTitle(e){this.pageTitle.set(e),this.isLoading.set(!1)}onAmountCashBank(e){console.log("Total Amount from CashBank:",e),this.amounts.cashBank.set(e)}onAmountExpense(e){console.log("Total Amount from Expense:",e),this.amounts.expense.set(e)}onExpenseTooltip(e){this.tooltip.expense.set(e)}onCashBankTooltip(e){this.tooltip.cashBank.set(e)}runCardEffect(){let e=this.activeIndex(),t=this.cards?.toArray();if(!t||t.length===0)return;t.forEach(o=>{let x=o.nativeElement.querySelector(".p-card-body");x&&(this.renderer.setStyle(x,"height","90px"),this.renderer.removeStyle(x,"background-color"),this.renderer.removeStyle(x,"box-shadow"))});let i=t[e];if(i){let o=i.nativeElement.querySelector(".p-card-body");o&&(this.renderer.setStyle(o,"background-color","#F0F0F0"),this.renderer.setStyle(o,"overflow","hidden"))}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["ng-component"]],viewQuery:function(t,i){if(t&1&&re(T,5,ee),t&2){let o;se(o=ce())&&(i.cards=o)}},decls:3,vars:5,consts:[["content",""],["expenseCheckbox",""],["card",""],["tooltipContent",""],["cashBankCheckbox",""],[3,"hasMainWrapperPadding","limitStrLength","scrollable","isLoading","pageTitle"],[1,"d-flex","flex-column","row-gap-10"],[1,"row","row-gap-24"],[1,"col-12","col-md-6","col-lg-4"],["width","100%","height","8rem"],["name","dashboardOption","type","radio","hidden","","value","0"],[1,"btn","p-0","border-none","btn-link","w-100",3,"click"],[1,"card-container"],[1,"box-icon",2,"background-color","#d73636"],[1,"d-flex","text-white","align-items-baseline"],[1,"fa-solid","fa-circle-dollar-to-slot"],["tooltipPosition","top",3,"pTooltip","fitContent"],[1,"d-flex","justify-content-end"],[1,"d-flex","flex-column","align-items-end"],[1,"fs-5"],[1,"box-number","fs-4"],[1,"d-flex","flex-column"],["name","dashboardOption","type","radio","hidden","","value","1"],[1,"box-icon"],[1,"fa-duotone","fa-solid","fa-wallet","text-white"],["tooltipPosition","top",3,"pTooltip"],["pTemplate","content"],[3,"amountExpense","expenseTitle","tooltip"],[3,"cashBankTitle","amountCashBank","tooltip"]],template:function(t,i){t&1&&(a(0,"app-main-panel",5),N(1,Ke,11,3,"ng-template",null,0,Y),r()),t&2&&m("hasMainWrapperPadding",!0)("limitStrLength",50)("scrollable",!0)("isLoading",i.isLoading())("pageTitle",i.pageTitle())},dependencies:[xe,ke,D,T,be,_e,Te,ue,Pe,Me,fe,ye,Ee,De,E,S,ve,Oe,he],styles:['@charset "UTF-8";.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}@media(max-width:85rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media(min-width:85.001rem)and (max-width:97.999rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media(min-width:98rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:80px;width:80px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:40px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1.15rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}']})}}return n})();export{Qt as Dashboard1Component};
1
+ import{a as G}from"./chunk-UUVSQAFK.js";import{c as xe}from"./chunk-ACRPKVZ4.js";import{b as ye}from"./chunk-X2F5ZNTW.js";import"./chunk-ZULPRZ24.js";import"./chunk-BA72IEO2.js";import{a as Q}from"./chunk-TTIQSVQF.js";import{b as Te}from"./chunk-OVMM5CPY.js";import{a as T,b as D}from"./chunk-KG3OLRKU.js";import"./chunk-4D6KKSM5.js";import"./chunk-BEEH5PAA.js";import{f as S,g as E,h as ke}from"./chunk-M5REWZUB.js";import"./chunk-MTPMCC6U.js";import{a as Me,b as Pe}from"./chunk-RO474VQ2.js";import"./chunk-JVSOCU4S.js";import"./chunk-E4FUCIJZ.js";import"./chunk-3BPX4XM7.js";import{J as Oe,K as ve}from"./chunk-U2ZZPRP6.js";import{a as w,b as H}from"./chunk-7C7GSAC3.js";import{Xa as be,y as fe}from"./chunk-OQDKL2MG.js";import{l as ue}from"./chunk-7NZRUZLK.js";import{a as Ce}from"./chunk-WDFE7CAE.js";import"./chunk-DOSAQI5P.js";import"./chunk-MKCZKYSF.js";import{b as q}from"./chunk-I7ILLKBI.js";import{C as ge,r as he,t as _e}from"./chunk-ISLNIBSF.js";import"./chunk-CJPLD6EO.js";import{Ab as N,Ac as v,Bc as k,Cc as y,Fa as ee,I as z,Mb as C,Nb as f,Ob as ie,Qb as oe,Rb as ae,Sb as m,Sc as K,Tb as a,Tc as X,Ub as r,V as I,Vb as _,Wc as Y,_ as $,_c as le,ac as u,ad as b,da as g,db as c,fc as B,fd as de,gc as s,hd as me,ib as te,ka as l,kc as re,la as d,lc as se,mb as ne,mc as ce,oa as W,qc as R,s as F,t as A,u as j,ub as P,vc as O,wa as h,wc as pe,xc as J,za as M}from"./chunk-T6YHDD6J.js";import{a as L,b as V}from"./chunk-PRARYYF3.js";var U=(()=>{class n{constructor(){this.httpService=g(Ce)}createDashboardParams(e){return new ge().set("DashboardPeriod",e)}fetchDashboardLoader(){return this.httpService.get(void 0,"api/DashboardLoader")}fetchCashAndSplineData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/getcashandbank",{params:t})}fetchCashAndBankPieData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/getcashandbankpiechart",{params:t})}fetchExpenseSplineData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/GetExpense",{params:t})}fetchExpensePieData(e){let t=this.createDashboardParams(e);return this.httpService.get(void 0,"api/dashboard/GetExpensePieChart",{params:t})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Be(n,p){if(n&1){let e=u();a(0,"p-card",2)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsSpline),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Le(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}function Ve(n,p){if(n&1){let e=u();a(0,"p-card",4)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsPie),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Fe(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}var Ee=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=g(U),this.cdr=g(me),this.injector=g(W),this.params=h({dashboardPeriod:2}),this.cashBankTitle=b(),this.amountCashBank=b(),this.isLoading=de(!0),this.tooltip=b(),this.cashAndBankSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:e})=>A([this.dashboardService.fetchCashAndSplineData(e),this.dashboardService.fetchCashAndBankPieData(e)])),Q("Cash & Bank Dashboard Data"),I(([e])=>{this.isLoading.set(!1),this.amountCashBank.emit(e.data),this.tooltip.emit(e.toolTip)}),F(([e,t])=>({splineData:e,pieData:t}))),{initialValue:null}),M(()=>{let e=this.cashAndBankSource();if(!e)return;let{splineData:t,pieData:i}=e;this.cashBankTitle.emit(t.title),te(()=>{this.chartOptionsSpline={chart:{height:300},title:{text:t.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...t.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},t.chart.series),{type:"spline",name:"Amount",data:[...t.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:t.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0,this.cdr.detectChanges()},{injector:this.injector})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-cash-bank"]],inputs:{isLoading:[1,"isLoading"]},outputs:{cashBankTitle:"cashBankTitle",amountCashBank:"amountCashBank",isLoading:"isLoadingChange",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1),C(2,Be,2,4,"p-card",2)(3,Le,2,0,"p-card"),r(),a(4,"div",3),C(5,Ve,2,4,"p-card",4)(6,Fe,2,0,"p-card"),r()()),t&2&&(c(2),f(i.isLoading()?3:2),c(3),f(i.isLoading()?6:5))},dependencies:[G,E,S,D,T],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function Ae(n,p){if(n&1){let e=u();a(0,"p-card",2)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsSpline),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function je(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}function ze(n,p){if(n&1){let e=u();a(0,"p-card",4)(1,"highcharts-chart",5),y("updateChange",function(i){l(e);let o=s();return k(o.updateFlag,i)||(o.updateFlag=i),d(i)}),r()()}if(n&2){let e=s();c(),m("constructorType",e.chartConstructor)("options",e.chartOptionsPie),v("update",e.updateFlag),m("oneToOne",e.oneToOneFlag)}}function Ie(n,p){n&1&&(a(0,"p-card"),_(1,"p-skeleton",6),r())}var De=(()=>{class n{constructor(){this.chartConstructor="chart",this.updateFlag=!1,this.oneToOneFlag=!0,this.chartOptionsSpline={},this.chartOptionsPie={},this.dashboardService=g(U),this.isLoading=h(!0),this.amountExpense=b(),this.params=h({dashboardPeriod:2}),this.expenseTitle=b(),this.tooltip=b(),this.expenseSource=H((q.production?w(this.params):w(this.params).pipe(z(500))).pipe(j(({dashboardPeriod:e})=>A([this.dashboardService.fetchExpenseSplineData(e),this.dashboardService.fetchExpensePieData(e)])),Q("Expense Dashboard Data"),I(([e])=>{this.isLoading.set(!1),this.amountExpense.emit(e.data),this.expenseTitle.emit(e.title),this.tooltip.emit(e.toolTip)}),F(([e,t])=>({splineData:e,pieData:t}))),{initialValue:null}),M(()=>{let e=this.expenseSource();if(!e)return;let{splineData:t,pieData:i}=e;console.log("Spline Data:",t),console.log("Pie Data:",i),this.chartOptionsSpline={chart:{height:300},title:{text:t.chartTitle,align:"left",style:{fontWeight:"normal"}},xAxis:{categories:[...t.chart.labels]},yAxis:{title:{text:""}},series:[V(L({},t.chart.series),{type:"spline",name:"Amount",data:[...t.chart.series.data]})],plotOptions:{line:{dataLabels:{enabled:!0},enableMouseTracking:!1}}},this.chartOptionsPie={chart:{type:"pie"},title:{text:t.pieTitle,align:"left",style:{fontWeight:"normal"}},series:[{type:"pie",name:"Amount",data:[...i.series.filter(o=>o.y>0)]}],plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:[{enabled:!1}],showInLegend:!0}}},this.updateFlag=!0})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-expense"]],outputs:{amountExpense:"amountExpense",expenseTitle:"expenseTitle",tooltip:"tooltip"},decls:7,vars:2,consts:[[1,"row"],[1,"col-12","col-md-6","col-lg-7"],[1,"chart"],[1,"col-12","col-md-6","col-lg-5"],[1,"pie_chart"],[1,"chart",3,"updateChange","constructorType","options","update","oneToOne"],["width","100%","height","15rem"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1),C(2,Ae,2,4,"p-card",2)(3,je,2,0,"p-card"),r(),a(4,"div",3),C(5,ze,2,4,"p-card",4)(6,Ie,2,0,"p-card"),r()()),t&2&&(c(2),f(i.isLoading()?3:2),c(3),f(i.isLoading()?6:5))},dependencies:[G,E,S,D,T],styles:[".chart[_ngcontent-%COMP%]{width:100%;height:400px;display:block} p-card.chart .p-card-body{padding-top:0!important;padding-bottom:0!important} p-card.pie_chart .p-card-body{padding-top:0!important;padding-bottom:0!important}"]})}}return n})();function We(n,p){if(n&1&&(a(0,"span"),O(1),r()),n&2){let e=p.$implicit;c(),pe(e)}}function Ne(n,p){if(n&1&&(a(0,"div",21),oe(1,We,2,1,"span",null,ie),r()),n&2){let e=s(3);c(),ae(e.tooltipExpense())}}function Re(n,p){if(n&1){let e=u();_(0,"input",10,1),a(2,"button",11),B("click",function(i){l(e);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",13)(5,"div",14),_(6,"i",15),r()(),a(7,"p-card",16,2),N(9,Ne,3,0,"ng-template",null,3,Y),a(11,"div",17)(12,"div",18)(13,"span",19),O(14,"Expense"),r(),a(15,"p",20),O(16),K(17,"number"),r()()()()()()}if(n&2){let e=R(10),t=s(2);c(7),m("pTooltip",e)("fitContent",!1),c(9),J(" ",X(17,3,t.amounts.expense())," ")}}function qe(n,p){n&1&&_(0,"p-skeleton",9)}function He(n,p){if(n&1&&(a(0,"div",17)(1,"div",18)(2,"span",19),O(3,"Cash and Bank"),r(),a(4,"p",20),O(5),K(6,"number"),r()()()),n&2){let e=s(3);c(5),J(" ",e.amounts.cashBank()===0?"-":X(6,1,e.amounts.cashBank())," ")}}function Qe(n,p){if(n&1){let e=u();_(0,"input",22,4),a(2,"button",11),B("click",function(i){l(e);let o=R(1),x=s(2);return d(x.handleLinkClick(i,o))}),a(3,"div",12)(4,"div",23),_(5,"i",24),r(),a(6,"p-card",25,2),N(8,He,7,3,"ng-template",26),r()()()}if(n&2){let e=s(2);c(6),m("pTooltip",e.tooltip.cashBank())}}function Ge(n,p){n&1&&_(0,"p-skeleton",9)}function Ue(n,p){if(n&1){let e=u();a(0,"app-expense",27),B("amountExpense",function(i){l(e);let o=s(2);return d(o.onAmountExpense(i))})("expenseTitle",function(i){l(e);let o=s(2);return d(o.onExpenseTitle(i))})("tooltip",function(i){l(e);let o=s(2);return d(o.onExpenseTooltip(i))}),r()}}function Je(n,p){if(n&1){let e=u();a(0,"app-cash-bank",28),B("cashBankTitle",function(i){l(e);let o=s(2);return d(o.onCashBankTitle(i))})("amountCashBank",function(i){l(e);let o=s(2);return d(o.onAmountCashBank(i))})("tooltip",function(i){l(e);let o=s(2);return d(o.onCashBankTooltip(i))}),r()}}function Ke(n,p){if(n&1&&(a(0,"p-panel")(1,"main",6)(2,"div",7)(3,"div",8),C(4,Re,18,5)(5,qe,1,0,"p-skeleton",9),r(),a(6,"div",8),C(7,Qe,9,1)(8,Ge,1,0,"p-skeleton",9),r()(),C(9,Ue,1,0,"app-expense")(10,Je,1,0,"app-cash-bank"),r()()),n&2){let e=s();c(4),f(e.isLoading()?5:4),c(3),f(e.isLoading()?8:7),c(2),f(e.activeIndex()===0?9:e.activeIndex()===1?10:-1)}}var Qt=(()=>{class n{constructor(){this.activeIndex=h(0),this.pageTitle=h("Dashboard"),this.isLoading=h(!0),this.tooltip={cashBank:h(""),expense:h("")},this.tooltipExpense=le(()=>this.tooltip.expense().match(/^(.*?)\s*(\[[^\]]+\])$/)?[RegExp.$1.trim(),RegExp.$2.trim()]:[this.tooltip.expense()]),this.amounts={cashBank:h(0),expense:h(0)},this.renderer=g(ne),this.injector=g(W)}ngAfterViewInit(){M(()=>{this.isLoading()||queueMicrotask(()=>this.runCardEffect())},{injector:this.injector}),M(()=>{this.activeIndex(),queueMicrotask(()=>this.runCardEffect())},{injector:this.injector})}onTabChange(e){this.activeIndex.set(e)}handleLinkClick(e,t){e.stopPropagation(),t.checked=!t.checked,t.checked&&(console.log(t.value),this.onTabChange(Number(t.value)))}onCashBankTitle(e){this.pageTitle.set(e),this.isLoading.set(!1)}onExpenseTitle(e){this.pageTitle.set(e),this.isLoading.set(!1)}onAmountCashBank(e){console.log("Total Amount from CashBank:",e),this.amounts.cashBank.set(e)}onAmountExpense(e){console.log("Total Amount from Expense:",e),this.amounts.expense.set(e)}onExpenseTooltip(e){this.tooltip.expense.set(e)}onCashBankTooltip(e){this.tooltip.cashBank.set(e)}runCardEffect(){let e=this.activeIndex(),t=this.cards?.toArray();if(!t||t.length===0)return;t.forEach(o=>{let x=o.nativeElement.querySelector(".p-card-body");x&&(this.renderer.setStyle(x,"height","90px"),this.renderer.removeStyle(x,"background-color"),this.renderer.removeStyle(x,"box-shadow"))});let i=t[e];if(i){let o=i.nativeElement.querySelector(".p-card-body");o&&(this.renderer.setStyle(o,"background-color","#F0F0F0"),this.renderer.setStyle(o,"overflow","hidden"))}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["ng-component"]],viewQuery:function(t,i){if(t&1&&re(T,5,ee),t&2){let o;se(o=ce())&&(i.cards=o)}},decls:3,vars:5,consts:[["content",""],["expenseCheckbox",""],["card",""],["tooltipContent",""],["cashBankCheckbox",""],[3,"hasMainWrapperPadding","limitStrLength","scrollable","isLoading","pageTitle"],[1,"d-flex","flex-column","row-gap-10"],[1,"row","row-gap-24"],[1,"col-12","col-md-6","col-lg-4"],["width","100%","height","8rem"],["name","dashboardOption","type","radio","hidden","","value","0"],[1,"btn","p-0","border-none","btn-link","w-100",3,"click"],[1,"card-container"],[1,"box-icon",2,"background-color","#d73636"],[1,"d-flex","text-white","align-items-baseline"],[1,"fa-solid","fa-circle-dollar-to-slot"],["tooltipPosition","top",3,"pTooltip","fitContent"],[1,"d-flex","justify-content-end"],[1,"d-flex","flex-column","align-items-end"],[1,"fs-5"],[1,"box-number","fs-4"],[1,"d-flex","flex-column"],["name","dashboardOption","type","radio","hidden","","value","1"],[1,"box-icon"],[1,"fa-duotone","fa-solid","fa-wallet","text-white"],["tooltipPosition","top",3,"pTooltip"],["pTemplate","content"],[3,"amountExpense","expenseTitle","tooltip"],[3,"cashBankTitle","amountCashBank","tooltip"]],template:function(t,i){t&1&&(a(0,"app-main-panel",5),N(1,Ke,11,3,"ng-template",null,0,Y),r()),t&2&&m("hasMainWrapperPadding",!0)("limitStrLength",50)("scrollable",!0)("isLoading",i.isLoading())("pageTitle",i.pageTitle())},dependencies:[xe,ke,D,T,be,_e,Te,ue,Pe,Me,fe,ye,Ee,De,E,S,ve,Oe,he],styles:['@charset "UTF-8";.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}@media(max-width:85rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media(min-width:85.001rem)and (max-width:97.999rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:50px;width:50px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}@media(min-width:98rem){.card-container[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .card-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.card-container[_ngcontent-%COMP%]{position:relative;height:4rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%]{height:80px;width:80px;background-color:#2175d0;display:flex;justify-content:center;align-items:center;z-index:2;position:relative;border-radius:4px;left:1.5rem;top:-.6rem}.card-container[_ngcontent-%COMP%] .box-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:40px}.card-container[_ngcontent-%COMP%] .box-number[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500}.card-container[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-size:1.15rem}.card-container[_ngcontent-%COMP%] p-card[_ngcontent-%COMP%]{position:absolute;top:calc(2.6rem - 55%);left:0;width:100%;z-index:1;margin:0!important;padding:0!important}}']})}}return n})();export{Qt as Dashboard1Component};