dealposbooks 5.51.0 → 5.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-RFHL2MJ4.js → chunk-2P6N6225.js} +1 -1
- package/{chunk-JPKZVL57.js → chunk-3NF5ANCH.js} +1 -1
- package/{chunk-NTVIX4GB.js → chunk-4EGQ563G.js} +1 -1
- package/{chunk-YMV3SC73.js → chunk-5DAIWPJH.js} +1 -1
- package/{chunk-R45WWOYD.js → chunk-5UVNTB7W.js} +1 -1
- package/{chunk-GQ7SPEZH.js → chunk-6YXA7GFO.js} +1 -1
- package/{chunk-OILVKUFA.js → chunk-7QQAIIXC.js} +1 -1
- package/{chunk-2RXAK5B6.js → chunk-BPJERO47.js} +2 -2
- package/{chunk-QXE4YYQV.js → chunk-CNWZ52LV.js} +1 -1
- package/{chunk-GN7VAGHH.js → chunk-CYTZBS64.js} +1 -1
- package/{chunk-LF4HTMCE.js → chunk-DJAA5EF6.js} +1 -1
- package/{chunk-4GZGUASQ.js → chunk-DOPSA7V7.js} +1 -1
- package/chunk-EZGBB4MD.js +1 -0
- package/{chunk-VQ62YSFR.js → chunk-H6JPNVHO.js} +1 -1
- package/{chunk-ILQI2X5T.js → chunk-HK6564XM.js} +1 -1
- package/{chunk-KBJ25I3J.js → chunk-HKEKJASB.js} +1 -1
- package/{chunk-32QC4JFI.js → chunk-HUNIPNEV.js} +1 -1
- package/{chunk-2U3PIWWJ.js → chunk-I2SBX2TZ.js} +1 -1
- package/{chunk-7GORVGAV.js → chunk-IBPU4HMB.js} +1 -1
- package/{chunk-WPHZJHC6.js → chunk-ICDJTXVE.js} +1 -1
- package/{chunk-ELZ5FFFM.js → chunk-ITGMU5MB.js} +1 -1
- package/{chunk-VABCBO2E.js → chunk-IVCIH4GN.js} +1 -1
- package/{chunk-L27GCER2.js → chunk-JK2F33M6.js} +2 -2
- package/{chunk-F4PHXCVU.js → chunk-KR465WRL.js} +1 -1
- package/{chunk-D5WBKKO2.js → chunk-L5IWZ4Y2.js} +1 -1
- package/{chunk-ZLBNHUZF.js → chunk-LRD5A6EL.js} +1 -1
- package/{chunk-KJM3M7Y3.js → chunk-LTIBX74D.js} +1 -1
- package/{chunk-GEYRJ2MR.js → chunk-M2RAH7HZ.js} +1 -1
- package/{chunk-OKT36WED.js → chunk-NBWU3VSN.js} +1 -1
- package/{chunk-EDYUAYO2.js → chunk-NGMAZPWL.js} +1 -1
- package/{chunk-QSIXT7W7.js → chunk-Q4WVEWIJ.js} +1 -1
- package/{chunk-E57RWXDG.js → chunk-QQYGISGZ.js} +1 -1
- package/{chunk-DAN3PD7R.js → chunk-RBJEQZ2O.js} +1 -1
- package/{chunk-HYOAHRKW.js → chunk-RK23P4VG.js} +1 -1
- package/{chunk-TOAH3PY3.js → chunk-RSAW2IGP.js} +1 -1
- package/{chunk-BVHTVDYP.js → chunk-S36SGADP.js} +1 -1
- package/{chunk-7ET5ZE2L.js → chunk-SXKPF3GY.js} +1 -1
- package/{chunk-3RODMLL2.js → chunk-TRH6BRRC.js} +1 -1
- package/{chunk-7F5JJ627.js → chunk-TZH35FNY.js} +2 -2
- package/{chunk-NSMNMKCV.js → chunk-UCJ6JQWA.js} +1 -1
- package/{chunk-BT4SLG45.js → chunk-UPBPXKNV.js} +1 -1
- package/{chunk-KXWAD3X4.js → chunk-VQM5QCPU.js} +1 -1
- package/{chunk-5XVZW6BJ.js → chunk-W6SE4LJW.js} +1 -1
- package/{chunk-ZOMQLK4A.js → chunk-WZ5LBHF5.js} +1 -1
- package/{chunk-KU4BYYJE.js → chunk-WZ6BCBDQ.js} +1 -1
- package/{chunk-MCR6MBS2.js → chunk-YAFMVKX5.js} +1 -1
- package/{chunk-MWRTPPEI.js → chunk-YB424QNC.js} +1 -1
- package/{chunk-J346SEEU.js → chunk-YCOTHSE5.js} +1 -1
- package/{chunk-MHM3ED4J.js → chunk-Z2KELIGC.js} +1 -1
- package/{chunk-B7TGZ7J3.js → chunk-ZRPU3QYR.js} +1 -1
- package/{chunk-JPNJTPYJ.js → chunk-ZVDGEDMP.js} +1 -1
- package/{chunk-DM42MH3E.js → chunk-ZZLTM7V6.js} +1 -1
- package/index.html +2 -2
- package/{main-ET3JU27S.js → main-6DNI2R4P.js} +1 -1
- package/package.json +1 -1
- package/chunk-CPAPQNFC.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as pt}from"./chunk-HU4J3ABZ.js";import{a as Re,b as Fe}from"./chunk-LO4HJ77Y.js";import{a as ve}from"./chunk-GQ7SPEZH.js";import{a as Ht,b as de}from"./chunk-JPNJTPYJ.js";import{b as rt}from"./chunk-5VKDAA74.js";import{b as Wt,c as at,d as lt}from"./chunk-6GILMLXA.js";import{a as ue,b as _e}from"./chunk-2ABEICLB.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import{m as X}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as we,b as Te}from"./chunk-3VQUNDVT.js";import{b as se,i as ce}from"./chunk-52EMI2TW.js";import{a as it,b as nt}from"./chunk-AAKZYXG3.js";import{a as pe,b as me}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as ot}from"./chunk-YKZN6T5N.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{b as Ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as qt,b as De}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import{d as Ue}from"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as le}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as et,f as tt,i as ae}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as $e,b as re}from"./chunk-ISIYG4D5.js";import{b as j,c as Ye,d as Xe,e as Je,f as Qe,g as Ze}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as Ot,o as Ke,w as ne,x as oe,y as jt,z as zt}from"./chunk-O44DI62I.js";import{b as ye}from"./chunk-DTYVTTET.js";import{b as Bt,c as Pt,e as J,f as Q,g as Gt,i as st,k as Z,m as ee,p as te,v as Ee,y as ie}from"./chunk-MGIEURA2.js";import{b as He,e as $,l as Y}from"./chunk-DZCJWJUG.js";import{a as Se}from"./chunk-VQ62YSFR.js";import{a as At}from"./chunk-G3BJCT7T.js";import{a as We}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{c as kt,d as Nt}from"./chunk-KL3TPLRB.js";import{j as ze,m as W,r as qe,s as K,u as U}from"./chunk-DM2JLWKE.js";import{Ac as Mt,Bc as mt,Cc as ge,D as Be,Dc as Oe,Eb as g,Ec as L,Fc as F,Gc as Vt,Ha as y,Hc as je,Mb as s,Oc as S,Pb as Ge,Pc as T,Qc as G,Rb as V,Sb as Le,Sc as _,Ub as Me,Vb as Ve,W as Dt,Wb as o,X as Rt,Xb as r,Y as Ce,Yb as w,Zb as q,_ as M,_b as H,ac as D,bd as R,c as be,ca as Ft,cd as fe,db as z,eb as Pe,fc as I,gc as c,ia as C,ib as l,jc as Lt,qa as h,ra as x,s as Ae,sc as a,tc as b,uc as E,vc as ke,xc as B,yb as N,yc as A,zc as O}from"./chunk-6QJHEOXN.js";import{a as f,b as v,c as xe,e as Tt}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=C(At),this.authService=C(ve)}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=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=f({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 Nt({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),p=new kt({"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"}),u=f({params:i,headers:p},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",f({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ri=()=>({width:"30vw"}),ai=()=>({"1199px":"75vw","575px":"90vw"}),li=t=>({"ng-dirty ng-invalid":t}),pi=t=>["/pages/journal/journal-entry/",t],mi=t=>({"text-success":t}),si=t=>({"text-danger":t});function ci(t,m){if(t&1&&(o(0,"div",32)(1,"div",33)(2,"span",34),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",33)(8,"span",35),a(9),r()()()),t&2){let e=m.$implicit;l(3),E("(",e.code,")"),l(6),b(e.name)}}function di(t,m){if(t&1&&(o(0,"div",32)(1,"div",33)(2,"span",34),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",33)(8,"span",35),a(9),r()()()),t&2){let e=m.$implicit;l(3),E("(",e.code,")"),l(6),b(e.name)}}function ui(t,m){t&1&&(o(0,"div",36),a(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",37)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),b(e.value)}}function gi(t,m){if(t&1&&(o(0,"div",25)(1,"div",26),w(2,"p-radiobutton",38),o(3,"label",39),a(4),r()()()),t&2){let e=m.$implicit;l(2),s("value",e.key)("inputId",e.key),l(),s("for",e.key),l(),b(e.value)}}function fi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Customer"),r(),o(3,"p-autocomplete",40),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Supplier"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchSupplier(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.supplierSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Customer"),r(),o(3,"p-autocomplete",40),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",14)(1,"div",15)(2,"label",16),a(3,"Accounts"),r(),o(4,"p-select",17),g(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),g(9,ui,2,0,"div",18),r(),o(10,"div",15)(11,"label",16),a(12,"From"),r(),o(13,"div",19),w(14,"p-datepicker",20)(15,"p-datepicker",21),r()(),o(16,"div",15)(17,"label",16),a(18,"Tag"),r(),o(19,"p-multiselect",22),g(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",15)(23,"label",23),a(24,"Contact Type"),r(),o(25,"div",24),Me(26,gi,5,4,"div",25,Le),r()(),g(28,fi,4,1,"div",15)(29,hi,4,1,"div",15)(30,xi,4,1,"div",15),o(31,"div",15)(32,"label",23),a(33,"Sort order"),r(),o(34,"div",24)(35,"div",25)(36,"div",26),w(37,"p-radiobutton",27),o(38,"label",28),a(39,"Asc"),r()()(),o(40,"div",29)(41,"div",26),w(42,"p-radiobutton",30),o(43,"label",31),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,p=c(2);s("formGroup",p.form),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.accounts)("ngClass",F(14,li,((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)))),l(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))),l(5),s("showIcon",!0),l(),s("showIcon",!0),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.outlets),l(7),Ve(p.loaderMetadata().options.contactTypeOptions),l(2),V((i=p.form.controls.contactType.value)===1?28:i===2?29:30),l(9),s("value",!0),l(5),s("value",!1)}}function Ci(t,m){if(t&1&&g(0,bi,45,16,"form",13),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Si(t,m){if(t&1){let e=D();o(0,"p-button",44),I("onClick",function(){h(e);let i=c(2);return x(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",32)(1,"a",42),a(2,"Return to Accounts"),r(),g(3,Si,1,0,"p-button",43),r()),t&2){let e=c();l(3),s("ngIf",e.roleService.permissions().global.export)}}function yi(t,m){t&1&&(o(0,"tr")(1,"th",51),a(2,"Number"),r(),o(3,"th"),a(4,"Date"),r(),o(5,"th"),a(6,"Contact / Note"),r(),o(7,"th",52),a(8,"Debit"),r(),o(9,"th",52),a(10,"Credit"),r(),o(11,"th",52),a(12,"Balance"),r()())}function Ei(t,m){if(t&1&&(o(0,"div")(1,"span",60),a(2),r()()),t&2){let e=c().$implicit;l(2),E(" ",e.outletName," ")}}function Ii(t,m){if(t&1&&(o(0,"div",15),w(1,"div",61),o(2,"span",62),a(3),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.journalNote,z),l(2),E("",e.note," ")}}function wi(t,m){if(t&1&&(o(0,"div",15),w(1,"span",61)(2,"div",61),o(3,"span",63),a(4),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.referenceText,z),l(),s("innerHTML",e.journalNote,z),l(2),E("",e.note," ")}}function Ti(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.debitAmount,"1.0-2")," ")}}function Di(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.creditAmount,"1.0-2")," ")}}function Ri(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.balance,"1.0-2")," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",53)(2,"a",54),a(3),r(),g(4,Ei,3,1,"div",55),r(),o(5,"td",53)(6,"span",56),S(7,"date"),a(8),S(9,"date"),r()(),o(10,"td",53)(11,"div",15)(12,"a",57),a(13),r(),g(14,Ii,4,2,"div",15)(15,wi,5,3,"div",15),r()(),o(16,"td",58),g(17,Ti,3,4,"ng-container",55),r(),o(18,"td",58),g(19,Di,3,4,"ng-container",55),r(),o(20,"td",59),g(21,Ri,3,4,"ng-container",55),r()()),t&2){let e=m.$implicit,n=c(3);l(2),s("routerLink",F(19,pi,e.id)),l(),b(e.number),l(),s("ngIf",e.outletName==null?null:e.outletName.trim()),l(2),s("pTooltip",G(7,13,e.date,"dd MMM y")),l(2),E(" ",G(9,16,e.date,"dd MMM y")," "),l(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Pe),l(),b(e.contactName),l(),V(n.buildReferenceUrl(e)?14:15),l(2),s("ngClass",F(21,mi,e.debitAmount!==0)),l(),s("ngIf",e.debitAmount!==0),l(),s("ngClass",F(23,si,e.creditAmount!==0)),l(),s("ngIf",e.creditAmount!==0),l(2),s("ngIf",e.balance!==0)}}function Li(t,m){if(t&1&&(o(0,"tr"),w(1,"td",64),o(2,"td",65),a(3,"Total"),r(),o(4,"td",66),a(5),S(6,"number"),r(),o(7,"td",67),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c(3);l(5),E(" ",T(6,2,e.debitSubTotal())," "),l(3),E(" ",T(9,4,e.creditSubTotal())," ")}}function Mi(t,m){t&1&&(o(0,"tr")(1,"td",68)(2,"span"),a(3,"No records found."),r()()())}function Vi(t,m){if(t&1){let e=D();o(0,"button",69),I("click",function(){h(e);let i=c(3);return x(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return x(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&a(0),t&2){let e=c(3);E(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",70),I("onClick",function(){h(e);let i=c(3);return x(i.onNextPage())}),r()}}function Ai(t,m){if(t&1&&(o(0,"div",46)(1,"p-table",47),g(2,yi,13,0,"ng-template",null,7,_)(4,Fi,22,25,"ng-template",null,8,_)(6,Li,11,6,"ng-template",null,4,_)(8,Mi,4,0,"ng-template",null,9,_),r(),o(10,"div",48)(11,"div"),a(12),g(13,Vi,1,0,"button",49)(14,ki,1,1),a(15," entries "),r(),o(16,"div",32),g(17,Ni,1,0,"p-button",50),r()()()),t&2){let e=c(2);l(),s("value",e.items().data.data),l(11),ke(" Showing ",e.pagination().first," to ",e.pagination().end," of "),l(),V(e.totalRecords()===-1?13:14),l(4),V(e.pagination().hasNext?17:-1)}}function Bi(t,m){if(t&1&&g(0,Ai,18,5,"div",45),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Pi(t,m){if(t&1&&(o(0,"div",71)(1,"div",72),w(2,"div",73),r(),o(3,"div",74)(4,"div",26),w(5,"i",75),o(6,"span",76),a(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();l(),s("formGroup",e.form),l(6),ke("Exporting data from ",T(8,3,e.filter().exportPageNumber)," - ",T(9,5,e.filter().exportPageSize),"")}}function Gi(t,m){if(t&1){let e=D();o(0,"p-button",77),I("onClick",function(){h(e);let i=c();return x(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",78),I("click",function(){h(e);let i=c();return x(i.onToggleExportDialog())}),r(),o(1,"p-button",79),I("click",function(){h(e);let i=c();return x(i.onExport())}),r()}}var Ut=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(M(({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(P),this.route=C(He),this.roleService=C(X),this.authService=C(ve),this.fb=C(Ee),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(de),this.metadata=y(null),this.items=y(null),this.totalRecords=y(-1),this.dialogFilterVisible=y(!0),this.initDialogVisible=y(!1),this.isDialogExportVisible=y(!1),this.customerSuggestions=y([]),this.supplierSuggestions=y([]),this.categoriesOptions=y([]),this.localFilter=y({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=y(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=ye(this.route.queryParamMap.pipe(Ae(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={},u=e.get("id");return Se.IsNotEmpty(u)&&(p=v(f({},p),{accountID:u})),Se.IsNotEmpty(n)&&Se.IsNotEmpty(i)&&(p=v(f({},p),{from:n,to:i})),p})),{initialValue:null}),this.loaderMetadata=ye(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=y([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?f(f({},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&&(Se.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||Se.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(p=>e.pageNumber===1?i:v(f({},i),{data:v(f({},i.data),{data:[...p?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return pt(e)}ngOnInit(){this.route.queryParamMap.pipe(Be(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Pt.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)})}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(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):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(M(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(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=xe(p,["from","to"]);return v(f({},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})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(M(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 d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(p=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;lt(u,p,u.type)}buildExportBody(){let p=this.form.value,{from:e,to:n}=p,i=xe(p,["from","to"]);return v(f({},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 v(f({},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 v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},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=>v(f({},p),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export General Ledger",3,"visibleChange","modal","visible","breakpoints"],["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"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[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"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[2,"width","180px"],[1,"text-end"],[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"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",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"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",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=D();o(0,"app-main-panel",10),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.initDialogVisible,d)||(i.initDialogVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOKEvent())}),g(1,Ci,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Bi,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",11),O("visibleChange",function(d){return h(p),A(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),x(d)}),g(8,Pi,10,7,"div",12)(9,Gi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),B("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),B("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),l(7),Ge(L(11,ri)),s("modal",!0),B("visible",i.isDialogExportVisible),s("breakpoints",L(12,ai)),l(),s("ngIf",i.form&&i.filter()))},dependencies:[ae,U,ze,W,K,qe,le,ce,se,tt,et,oe,ne,De,qt,me,pe,Fe,Re,ie,Z,J,Q,ee,te,_e,ue,Ie,Ue,at,rt,re,Y,$,nt,it,zt,jt,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}[_nghost-%COMP%] th:nth-child(1){width:10%}[_nghost-%COMP%] th:nth-child(2){width:15%}[_nghost-%COMP%] th:nth-child(3){width:40%}[_nghost-%COMP%] th:nth-child(4){width:15%}[_nghost-%COMP%] th:nth-child(5){width:15%}[_nghost-%COMP%] th:nth-child(6){width:15%}"],changeDetection:0})}}return t})();var ji={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},xt=Ye(Ze(ji),Xe(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}),Qe(t=>{let m=C(P),e=C(de),n={updateFilter(i){j(t,p=>v(f({},p),{filter:f(f({},p.filter),i)}))},getLoader:we(be(Ce(()=>m.getIncomeStatementLoader().pipe(Te({next:i=>{j(t,p=>v(f({},p),{loader:i,filter:v(f({},p.filter),{from:e.format(i.filter.from),to:e.format(i.filter.to)})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:we(be(Ce(i=>m.getIncomeStatement(i).pipe(Rt(()=>j(t,p=>v(f({},p),{isLoading:!0}))),Te({next:p=>{j(t,u=>v(f({},u),{data:p,isLoading:!1}))},error:p=>{console.error(p)}})))))};return n}),Je({onInit:t=>{t.getLoader()}}));var bt=()=>({}),Ct=t=>["/pages/chart-of-account/account/",t],St=()=>["/pages/report/general-ledger"],vt=(t,m,e)=>({id:t,from:m,to:e});function qi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return x(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),g(1,qi,1,0,"p-button",9),r()),t&2){let e=c();l(),s("ngIf",e.roleService.permissions().global.export)}}function Wi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),b(T(9,6,e.amount))}}function Ui(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,1,e.store.totalRevenue()))}}function $i(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function Yi(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),g(3,Wi,7,0,"ng-template",null,3,_)(5,Ki,10,15,"ng-template",null,4,_)(7,Ui,8,3,"ng-template",null,5,_)(9,$i,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),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),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,2,e.store.totalCOGS())),l(8),b(T(15,4,e.store.grossProfit()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),g(3,Xi,7,0,"ng-template",null,3,_)(5,Ji,10,15,"ng-template",null,4,_)(7,Qi,16,6,"ng-template",null,5,_)(9,Zi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),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),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,2,e.store.totalExpense())),l(8),b(T(15,4,e.store.profitOrLoss()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),g(3,tn,7,0,"ng-template",null,3,_)(5,nn,10,15,"ng-template",null,4,_)(7,on,16,6,"ng-template",null,5,_)(9,rn,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function ln(t,m){if(t&1&&(Mt(0)(1),o(2,"p-panel")(3,"div",11),g(4,Yi,11,1)(5,en,11,1)(6,an,11,1),r()()),t&2){let e,n,i,p,u,d=c();mt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),l(),mt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),l(3),V(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:L(5,bt)).length>0?4:-1),l(),V(d.Object.keys((p=(p=d.store.data().data)==null?null:p.cogs)!==null&&p!==void 0?p:L(6,bt)).length>0?5:-1),l(),V(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:L(7,bt)).length>0?6:-1)}}function pn(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Tag"),r(),w(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let p=c();return x(p.onCashierSearch(i))})("onSelect",function(i){h(e);let p=c();return x(p.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),w(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),l(5),s("iconDisplay","input")("showIcon",!0),l(),s("iconDisplay","input")("showIcon",!0)}}var $t=(()=>{class t{constructor(){this.dayjsService=C(de),this.store=C(xt),this.fb=C(Ee),this.reportService=C(P),this.roleService=C(X),this.isInitDialogFilterVisible=y(!1),this.dialogFilterVisible=y(!1),this.cashierSuggestions=y([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm()}onSearch(e){this.store.updateFilter(v(f({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ne("Cashier Suggestions"),M(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,u])=>(p==="from"||p==="to"?u instanceof Date&&(i[p]=this.dayjsService.format(u)):i[p]=u||null,i),{});this.store.updateFilter(f(f({},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=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ne("Export Profit & Loss"),M(n=>{let i=n.type,p=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([xt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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,"routerLink","queryParams"],["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",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let p=D();o(0,"app-main-panel",7),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOK())}),g(1,Hi,2,1,"ng-template",null,0,_)(3,ln,7,8,"ng-template",null,1,_)(5,pn,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),B("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ae,U,W,K,De,me,pe,ie,Z,J,Q,ee,te,_e,ue,le,ce,se,re,$e,Y,$,Fe,Re,oe,ne],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yt=Tt(Ht());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,yt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Et=Ye(Ze(mn),Xe(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))})),Qe(t=>{let m=C(P),e={updateFilter:n=>{j(t,i=>v(f({},i),{filter:n}))},fetchBalanceSheet:we(be(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,p])=>p!=null&&p!=="")}),Ce(n=>m.getBalanceSheet(n).pipe(Te({next:i=>{j(t,p=>v(f({},p),{data:i}))},error:i=>{console.error(i)}}))),Dt(1))),fetchLoader:we(be(Ce(()=>m.getBalanceSheetLoader().pipe(Te({next:n=>{j(t,i=>v(f({},i),{metadata:n,filter:{date:(0,yt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Je(t=>({onInit:()=>{t.fetchLoader()}})));var Yt=Tt(Ht());var It=t=>["/pages/chart-of-account/account/",t],wt=()=>["/pages/report/general-ledger"],sn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function cn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return x(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),g(1,cn,1,0,"p-button",10),r()),t&2){let e=c();l(),s("ngIf",e.roleService.permissions().global.export)}}function un(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",Vt(11,sn,e.accountID,n.store.filter().date)),l(),b(T(9,6,e.amount))}}function gn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,1,e.store.totalAsset())," ")}}function fn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function hn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),g(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,gn,6,3,"ng-template",null,5,_)(9,fn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().asset)}}function xn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),l(),b(T(9,6,e.counterAmount))}}function Cn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,1,e.store.totalLiability())," ")}}function Sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),g(3,xn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Cn,6,3,"ng-template",null,5,_)(9,Sn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().liability)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),l(),b(T(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),S(11,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,2,e.store.totalEquity())," "),l(6),E(" ",T(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function wn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function Tn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),g(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),a(7," <"),g(8,In,12,6,"ng-template",null,5,_)(10,wn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),g(2,hn,11,1)(3,vn,11,1)(4,Tn,12,1),r()()),t&2){let e=c();s("showHeader",!1),l(2),V(e.Object.keys(e.store.data().asset).length>0?2:-1),l(),V(e.Object.keys(e.store.data().liability).length>0?3:-1),l(),V(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Rn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),b(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Tag"),r(),o(4,"p-multiselect",29),g(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),w(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=C(Et),this.ReportServiceStore=C(P),this.dialogFilterVisible=y(!1),this.isInitDialogFilterVisible=y(!1),this.roleService=C(X),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Gt({date:new st(new Date),outletID:new st([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Yt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ne("Export Balance Sheet"),M(n=>{let i=n.type,p=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Et])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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,"routerLink","queryParams"],["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"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let p=D();o(0,"app-main-panel",8),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOKEvent())}),g(1,dn,2,1,"ng-template",null,0,_)(3,Dn,5,4,"ng-template",null,1,_)(5,Fn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),B("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ae,U,W,K,ce,se,le,oe,ne,ie,Z,J,Q,ee,te,_e,ue,me,pe,Ie,re,$e,Y,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
|
|
1
|
+
import{a as pt}from"./chunk-HU4J3ABZ.js";import{a as Re,b as Fe}from"./chunk-LO4HJ77Y.js";import{a as ve}from"./chunk-6YXA7GFO.js";import{a as Ht,b as de}from"./chunk-ZVDGEDMP.js";import{b as rt}from"./chunk-5VKDAA74.js";import{b as Wt,c as at,d as lt}from"./chunk-6GILMLXA.js";import{a as ue,b as _e}from"./chunk-2ABEICLB.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import{m as X}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as we,b as Te}from"./chunk-3VQUNDVT.js";import{b as se,i as ce}from"./chunk-52EMI2TW.js";import{a as it,b as nt}from"./chunk-AAKZYXG3.js";import{a as pe,b as me}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as ot}from"./chunk-YKZN6T5N.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{b as Ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as qt,b as De}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import{d as Ue}from"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as le}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as et,f as tt,i as ae}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as $e,b as re}from"./chunk-ISIYG4D5.js";import{b as j,c as Ye,d as Xe,e as Je,f as Qe,g as Ze}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as Ot,o as Ke,w as ne,x as oe,y as jt,z as zt}from"./chunk-O44DI62I.js";import{b as ye}from"./chunk-DTYVTTET.js";import{b as Bt,c as Pt,e as J,f as Q,g as Gt,i as st,k as Z,m as ee,p as te,v as Ee,y as ie}from"./chunk-MGIEURA2.js";import{b as He,e as $,l as Y}from"./chunk-DZCJWJUG.js";import{a as Se}from"./chunk-H6JPNVHO.js";import{a as At}from"./chunk-G3BJCT7T.js";import{a as We}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{c as kt,d as Nt}from"./chunk-KL3TPLRB.js";import{j as ze,m as W,r as qe,s as K,u as U}from"./chunk-DM2JLWKE.js";import{Ac as Mt,Bc as mt,Cc as ge,D as Be,Dc as Oe,Eb as g,Ec as L,Fc as F,Gc as Vt,Ha as y,Hc as je,Mb as s,Oc as S,Pb as Ge,Pc as T,Qc as G,Rb as V,Sb as Le,Sc as _,Ub as Me,Vb as Ve,W as Dt,Wb as o,X as Rt,Xb as r,Y as Ce,Yb as w,Zb as q,_ as M,_b as H,ac as D,bd as R,c as be,ca as Ft,cd as fe,db as z,eb as Pe,fc as I,gc as c,ia as C,ib as l,jc as Lt,qa as h,ra as x,s as Ae,sc as a,tc as b,uc as E,vc as ke,xc as B,yb as N,yc as A,zc as O}from"./chunk-6QJHEOXN.js";import{a as f,b as v,c as xe,e as Tt}from"./chunk-YQFG5XE2.js";var P=(()=>{class t{constructor(){this.httpService=C(At),this.authService=C(ve)}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=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=f({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 Nt({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),p=new kt({"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"}),u=f({params:i,headers:p},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",f({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ri=()=>({width:"30vw"}),ai=()=>({"1199px":"75vw","575px":"90vw"}),li=t=>({"ng-dirty ng-invalid":t}),pi=t=>["/pages/journal/journal-entry/",t],mi=t=>({"text-success":t}),si=t=>({"text-danger":t});function ci(t,m){if(t&1&&(o(0,"div",32)(1,"div",33)(2,"span",34),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",33)(8,"span",35),a(9),r()()()),t&2){let e=m.$implicit;l(3),E("(",e.code,")"),l(6),b(e.name)}}function di(t,m){if(t&1&&(o(0,"div",32)(1,"div",33)(2,"span",34),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",33)(8,"span",35),a(9),r()()()),t&2){let e=m.$implicit;l(3),E("(",e.code,")"),l(6),b(e.name)}}function ui(t,m){t&1&&(o(0,"div",36),a(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",37)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),b(e.value)}}function gi(t,m){if(t&1&&(o(0,"div",25)(1,"div",26),w(2,"p-radiobutton",38),o(3,"label",39),a(4),r()()()),t&2){let e=m.$implicit;l(2),s("value",e.key)("inputId",e.key),l(),s("for",e.key),l(),b(e.value)}}function fi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Customer"),r(),o(3,"p-autocomplete",40),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Supplier"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchSupplier(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.supplierSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",15)(1,"label",16),a(2,"Customer"),r(),o(3,"p-autocomplete",40),I("completeMethod",function(i){h(e);let p=c(3);return x(p.searchCustomer(i))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",14)(1,"div",15)(2,"label",16),a(3,"Accounts"),r(),o(4,"p-select",17),g(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),g(9,ui,2,0,"div",18),r(),o(10,"div",15)(11,"label",16),a(12,"From"),r(),o(13,"div",19),w(14,"p-datepicker",20)(15,"p-datepicker",21),r()(),o(16,"div",15)(17,"label",16),a(18,"Tag"),r(),o(19,"p-multiselect",22),g(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",15)(23,"label",23),a(24,"Contact Type"),r(),o(25,"div",24),Me(26,gi,5,4,"div",25,Le),r()(),g(28,fi,4,1,"div",15)(29,hi,4,1,"div",15)(30,xi,4,1,"div",15),o(31,"div",15)(32,"label",23),a(33,"Sort order"),r(),o(34,"div",24)(35,"div",25)(36,"div",26),w(37,"p-radiobutton",27),o(38,"label",28),a(39,"Asc"),r()()(),o(40,"div",29)(41,"div",26),w(42,"p-radiobutton",30),o(43,"label",31),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,p=c(2);s("formGroup",p.form),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.accounts)("ngClass",F(14,li,((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)))),l(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))),l(5),s("showIcon",!0),l(),s("showIcon",!0),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.outlets),l(7),Ve(p.loaderMetadata().options.contactTypeOptions),l(2),V((i=p.form.controls.contactType.value)===1?28:i===2?29:30),l(9),s("value",!0),l(5),s("value",!1)}}function Ci(t,m){if(t&1&&g(0,bi,45,16,"form",13),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Si(t,m){if(t&1){let e=D();o(0,"p-button",44),I("onClick",function(){h(e);let i=c(2);return x(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",32)(1,"a",42),a(2,"Return to Accounts"),r(),g(3,Si,1,0,"p-button",43),r()),t&2){let e=c();l(3),s("ngIf",e.roleService.permissions().global.export)}}function yi(t,m){t&1&&(o(0,"tr")(1,"th",51),a(2,"Number"),r(),o(3,"th"),a(4,"Date"),r(),o(5,"th"),a(6,"Contact / Note"),r(),o(7,"th",52),a(8,"Debit"),r(),o(9,"th",52),a(10,"Credit"),r(),o(11,"th",52),a(12,"Balance"),r()())}function Ei(t,m){if(t&1&&(o(0,"div")(1,"span",60),a(2),r()()),t&2){let e=c().$implicit;l(2),E(" ",e.outletName," ")}}function Ii(t,m){if(t&1&&(o(0,"div",15),w(1,"div",61),o(2,"span",62),a(3),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.journalNote,z),l(2),E("",e.note," ")}}function wi(t,m){if(t&1&&(o(0,"div",15),w(1,"span",61)(2,"div",61),o(3,"span",63),a(4),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.referenceText,z),l(),s("innerHTML",e.journalNote,z),l(2),E("",e.note," ")}}function Ti(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.debitAmount,"1.0-2")," ")}}function Di(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.creditAmount,"1.0-2")," ")}}function Ri(t,m){if(t&1&&(q(0),a(1),S(2,"number"),H()),t&2){let e=c().$implicit;l(),E(" ",G(2,1,e.balance,"1.0-2")," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",53)(2,"a",54),a(3),r(),g(4,Ei,3,1,"div",55),r(),o(5,"td",53)(6,"span",56),S(7,"date"),a(8),S(9,"date"),r()(),o(10,"td",53)(11,"div",15)(12,"a",57),a(13),r(),g(14,Ii,4,2,"div",15)(15,wi,5,3,"div",15),r()(),o(16,"td",58),g(17,Ti,3,4,"ng-container",55),r(),o(18,"td",58),g(19,Di,3,4,"ng-container",55),r(),o(20,"td",59),g(21,Ri,3,4,"ng-container",55),r()()),t&2){let e=m.$implicit,n=c(3);l(2),s("routerLink",F(19,pi,e.id)),l(),b(e.number),l(),s("ngIf",e.outletName==null?null:e.outletName.trim()),l(2),s("pTooltip",G(7,13,e.date,"dd MMM y")),l(2),E(" ",G(9,16,e.date,"dd MMM y")," "),l(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Pe),l(),b(e.contactName),l(),V(n.buildReferenceUrl(e)?14:15),l(2),s("ngClass",F(21,mi,e.debitAmount!==0)),l(),s("ngIf",e.debitAmount!==0),l(),s("ngClass",F(23,si,e.creditAmount!==0)),l(),s("ngIf",e.creditAmount!==0),l(2),s("ngIf",e.balance!==0)}}function Li(t,m){if(t&1&&(o(0,"tr"),w(1,"td",64),o(2,"td",65),a(3,"Total"),r(),o(4,"td",66),a(5),S(6,"number"),r(),o(7,"td",67),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c(3);l(5),E(" ",T(6,2,e.debitSubTotal())," "),l(3),E(" ",T(9,4,e.creditSubTotal())," ")}}function Mi(t,m){t&1&&(o(0,"tr")(1,"td",68)(2,"span"),a(3,"No records found."),r()()())}function Vi(t,m){if(t&1){let e=D();o(0,"button",69),I("click",function(){h(e);let i=c(3);return x(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return x(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&a(0),t&2){let e=c(3);E(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",70),I("onClick",function(){h(e);let i=c(3);return x(i.onNextPage())}),r()}}function Ai(t,m){if(t&1&&(o(0,"div",46)(1,"p-table",47),g(2,yi,13,0,"ng-template",null,7,_)(4,Fi,22,25,"ng-template",null,8,_)(6,Li,11,6,"ng-template",null,4,_)(8,Mi,4,0,"ng-template",null,9,_),r(),o(10,"div",48)(11,"div"),a(12),g(13,Vi,1,0,"button",49)(14,ki,1,1),a(15," entries "),r(),o(16,"div",32),g(17,Ni,1,0,"p-button",50),r()()()),t&2){let e=c(2);l(),s("value",e.items().data.data),l(11),ke(" Showing ",e.pagination().first," to ",e.pagination().end," of "),l(),V(e.totalRecords()===-1?13:14),l(4),V(e.pagination().hasNext?17:-1)}}function Bi(t,m){if(t&1&&g(0,Ai,18,5,"div",45),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Pi(t,m){if(t&1&&(o(0,"div",71)(1,"div",72),w(2,"div",73),r(),o(3,"div",74)(4,"div",26),w(5,"i",75),o(6,"span",76),a(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();l(),s("formGroup",e.form),l(6),ke("Exporting data from ",T(8,3,e.filter().exportPageNumber)," - ",T(9,5,e.filter().exportPageSize),"")}}function Gi(t,m){if(t&1){let e=D();o(0,"p-button",77),I("onClick",function(){h(e);let i=c();return x(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",78),I("click",function(){h(e);let i=c();return x(i.onToggleExportDialog())}),r(),o(1,"p-button",79),I("click",function(){h(e);let i=c();return x(i.onExport())}),r()}}var Ut=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(M(({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(P),this.route=C(He),this.roleService=C(X),this.authService=C(ve),this.fb=C(Ee),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(de),this.metadata=y(null),this.items=y(null),this.totalRecords=y(-1),this.dialogFilterVisible=y(!0),this.initDialogVisible=y(!1),this.isDialogExportVisible=y(!1),this.customerSuggestions=y([]),this.supplierSuggestions=y([]),this.categoriesOptions=y([]),this.localFilter=y({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=y(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=ye(this.route.queryParamMap.pipe(Ae(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={},u=e.get("id");return Se.IsNotEmpty(u)&&(p=v(f({},p),{accountID:u})),Se.IsNotEmpty(n)&&Se.IsNotEmpty(i)&&(p=v(f({},p),{from:n,to:i})),p})),{initialValue:null}),this.loaderMetadata=ye(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=y([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?f(f({},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&&(Se.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||Se.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(p=>e.pageNumber===1?i:v(f({},i),{data:v(f({},i.data),{data:[...p?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return pt(e)}ngOnInit(){this.route.queryParamMap.pipe(Be(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Pt.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)})}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(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):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(M(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(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=xe(p,["from","to"]);return v(f({},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})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(M(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 d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(p=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;lt(u,p,u.type)}buildExportBody(){let p=this.form.value,{from:e,to:n}=p,i=xe(p,["from","to"]);return v(f({},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 v(f({},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 v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},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=>v(f({},p),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export General Ledger",3,"visibleChange","modal","visible","breakpoints"],["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"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[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"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[2,"width","180px"],[1,"text-end"],[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"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",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"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",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=D();o(0,"app-main-panel",10),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.initDialogVisible,d)||(i.initDialogVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOKEvent())}),g(1,Ci,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Bi,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",11),O("visibleChange",function(d){return h(p),A(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),x(d)}),g(8,Pi,10,7,"div",12)(9,Gi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),B("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),B("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),l(7),Ge(L(11,ri)),s("modal",!0),B("visible",i.isDialogExportVisible),s("breakpoints",L(12,ai)),l(),s("ngIf",i.form&&i.filter()))},dependencies:[ae,U,ze,W,K,qe,le,ce,se,tt,et,oe,ne,De,qt,me,pe,Fe,Re,ie,Z,J,Q,ee,te,_e,ue,Ie,Ue,at,rt,re,Y,$,nt,it,zt,jt,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}[_nghost-%COMP%] th:nth-child(1){width:10%}[_nghost-%COMP%] th:nth-child(2){width:15%}[_nghost-%COMP%] th:nth-child(3){width:40%}[_nghost-%COMP%] th:nth-child(4){width:15%}[_nghost-%COMP%] th:nth-child(5){width:15%}[_nghost-%COMP%] th:nth-child(6){width:15%}"],changeDetection:0})}}return t})();var ji={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},xt=Ye(Ze(ji),Xe(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}),Qe(t=>{let m=C(P),e=C(de),n={updateFilter(i){j(t,p=>v(f({},p),{filter:f(f({},p.filter),i)}))},getLoader:we(be(Ce(()=>m.getIncomeStatementLoader().pipe(Te({next:i=>{j(t,p=>v(f({},p),{loader:i,filter:v(f({},p.filter),{from:e.format(i.filter.from),to:e.format(i.filter.to)})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:we(be(Ce(i=>m.getIncomeStatement(i).pipe(Rt(()=>j(t,p=>v(f({},p),{isLoading:!0}))),Te({next:p=>{j(t,u=>v(f({},u),{data:p,isLoading:!1}))},error:p=>{console.error(p)}})))))};return n}),Je({onInit:t=>{t.getLoader()}}));var bt=()=>({}),Ct=t=>["/pages/chart-of-account/account/",t],St=()=>["/pages/report/general-ledger"],vt=(t,m,e)=>({id:t,from:m,to:e});function qi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return x(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),g(1,qi,1,0,"p-button",9),r()),t&2){let e=c();l(),s("ngIf",e.roleService.permissions().global.export)}}function Wi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),b(T(9,6,e.amount))}}function Ui(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,1,e.store.totalRevenue()))}}function $i(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function Yi(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),g(3,Wi,7,0,"ng-template",null,3,_)(5,Ki,10,15,"ng-template",null,4,_)(7,Ui,8,3,"ng-template",null,5,_)(9,$i,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),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),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,2,e.store.totalCOGS())),l(8),b(T(15,4,e.store.grossProfit()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),g(3,Xi,7,0,"ng-template",null,3,_)(5,Ji,10,15,"ng-template",null,4,_)(7,Qi,16,6,"ng-template",null,5,_)(9,Zi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=ge(0),i=ge(1);l(2),b(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),l(),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),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),b(T(7,2,e.store.totalExpense())),l(8),b(T(15,4,e.store.profitOrLoss()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function an(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),g(3,tn,7,0,"ng-template",null,3,_)(5,nn,10,15,"ng-template",null,4,_)(7,on,16,6,"ng-template",null,5,_)(9,rn,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);l(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function ln(t,m){if(t&1&&(Mt(0)(1),o(2,"p-panel")(3,"div",11),g(4,Yi,11,1)(5,en,11,1)(6,an,11,1),r()()),t&2){let e,n,i,p,u,d=c();mt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),l(),mt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),l(3),V(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:L(5,bt)).length>0?4:-1),l(),V(d.Object.keys((p=(p=d.store.data().data)==null?null:p.cogs)!==null&&p!==void 0?p:L(6,bt)).length>0?5:-1),l(),V(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:L(7,bt)).length>0?6:-1)}}function pn(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Tag"),r(),w(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let p=c();return x(p.onCashierSearch(i))})("onSelect",function(i){h(e);let p=c();return x(p.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),w(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),l(5),s("iconDisplay","input")("showIcon",!0),l(),s("iconDisplay","input")("showIcon",!0)}}var $t=(()=>{class t{constructor(){this.dayjsService=C(de),this.store=C(xt),this.fb=C(Ee),this.reportService=C(P),this.roleService=C(X),this.isInitDialogFilterVisible=y(!1),this.dialogFilterVisible=y(!1),this.cashierSuggestions=y([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm()}onSearch(e){this.store.updateFilter(v(f({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ne("Cashier Suggestions"),M(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,u])=>(p==="from"||p==="to"?u instanceof Date&&(i[p]=this.dayjsService.format(u)):i[p]=u||null,i),{});this.store.updateFilter(f(f({},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=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ne("Export Profit & Loss"),M(n=>{let i=n.type,p=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([xt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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,"routerLink","queryParams"],["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",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let p=D();o(0,"app-main-panel",7),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOK())}),g(1,Hi,2,1,"ng-template",null,0,_)(3,ln,7,8,"ng-template",null,1,_)(5,pn,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),B("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ae,U,W,K,De,me,pe,ie,Z,J,Q,ee,te,_e,ue,le,ce,se,re,$e,Y,$,Fe,Re,oe,ne],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yt=Tt(Ht());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,yt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Et=Ye(Ze(mn),Xe(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))})),Qe(t=>{let m=C(P),e={updateFilter:n=>{j(t,i=>v(f({},i),{filter:n}))},fetchBalanceSheet:we(be(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,p])=>p!=null&&p!=="")}),Ce(n=>m.getBalanceSheet(n).pipe(Te({next:i=>{j(t,p=>v(f({},p),{data:i}))},error:i=>{console.error(i)}}))),Dt(1))),fetchLoader:we(be(Ce(()=>m.getBalanceSheetLoader().pipe(Te({next:n=>{j(t,i=>v(f({},i),{metadata:n,filter:{date:(0,yt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Je(t=>({onInit:()=>{t.fetchLoader()}})));var Yt=Tt(Ht());var It=t=>["/pages/chart-of-account/account/",t],wt=()=>["/pages/report/general-ledger"],sn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function cn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return x(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),g(1,cn,1,0,"p-button",10),r()),t&2){let e=c();l(),s("ngIf",e.roleService.permissions().global.export)}}function un(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",Vt(11,sn,e.accountID,n.store.filter().date)),l(),b(T(9,6,e.amount))}}function gn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,1,e.store.totalAsset())," ")}}function fn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function hn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),g(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,gn,6,3,"ng-template",null,5,_)(9,fn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().asset)}}function xn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),l(),b(T(9,6,e.counterAmount))}}function Cn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,1,e.store.totalLiability())," ")}}function Sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),g(3,xn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Cn,6,3,"ng-template",null,5,_)(9,Sn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().liability)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),b(e.code),l(2),s("routerLink",F(8,It,e.accountID)),l(),b(e.name),l(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),l(),b(T(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),S(11,"number"),r()()),t&2){let e=c(3);l(4),E(" ",T(5,2,e.store.totalEquity())," "),l(6),E(" ",T(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function wn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function Tn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),g(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),a(7," <"),g(8,In,12,6,"ng-template",null,5,_)(10,wn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);l(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),g(2,hn,11,1)(3,vn,11,1)(4,Tn,12,1),r()()),t&2){let e=c();s("showHeader",!1),l(2),V(e.Object.keys(e.store.data().asset).length>0?2:-1),l(),V(e.Object.keys(e.store.data().liability).length>0?3:-1),l(),V(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Rn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),b(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Tag"),r(),o(4,"p-multiselect",29),g(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),w(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=C(Et),this.ReportServiceStore=C(P),this.dialogFilterVisible=y(!1),this.isInitDialogFilterVisible=y(!1),this.roleService=C(X),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Gt({date:new st(new Date),outletID:new st([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Yt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ne("Export Balance Sheet"),M(n=>{let i=n.type,p=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Et])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",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,"routerLink","queryParams"],["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"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select an Tag",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let p=D();o(0,"app-main-panel",8),O("isDialogFilterVisibleChange",function(d){return h(p),A(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),x(d)})("isInitDialogFilterVisibleChange",function(d){return h(p),A(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),x(d)}),I("filterConfirmed",function(){return h(p),x(i.onFilterOKEvent())}),g(1,dn,2,1,"ng-template",null,0,_)(3,Dn,5,4,"ng-template",null,1,_)(5,Fn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),B("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ae,U,W,K,ce,se,le,oe,ne,ie,Z,J,Q,ee,te,_e,ue,me,pe,Ie,re,$e,Y,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
|
|
2
2
|
,
|
|
3
3
|
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-cash-flow works!"),r(),a(2,`
|
|
4
4
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-WZ5LBHF5.js";import"./chunk-6YXA7GFO.js";import"./chunk-WL6ZZCYW.js";import"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import"./chunk-DM2JLWKE.js";import"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-CYTZBS64.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as p}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{i as d}from"./chunk-
|
|
1
|
+
import{m as p}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{i as d}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-H6JPNVHO.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-DM2JLWKE.js";import{Eb as l,Sc as c,Wb as t,Xb as n,Yb as m,ia as r,sc as i,yb as a}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";function f(e,u){e&1&&(t(0,"div",2),m(1,"img",3),t(2,"h1",4),i(3,"You are not authorized"),n(),t(4,"p",5),i(5," This page require "),t(6,"span",6),i(7,"Journal"),n(),i(8," role. Please contact your Administrator to gain access! "),n()())}var y=(()=>{class e{constructor(){this.roleService=r(p)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-forbidden"]],decls:3,vars:0,consts:[["content",""],["pageTitle","Unauthorized"],[1,"h-100","d-flex","flex-column","justify-content-center","align-items-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg","alt","Forbidden"],[1,"fs-6","fw-semibold"],[1,"fs-3"],[1,"fw-semibold"]],template:function(o,g){o&1&&(t(0,"app-main-panel",1),l(1,f,9,0,"ng-template",null,0,c),n())},dependencies:[d],encapsulation:2})}}return e})();export{y as ForbiddenComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D,b as le}from"./chunk-
|
|
1
|
+
import{a as D,b as le}from"./chunk-4EGQ563G.js";import"./chunk-ZVDGEDMP.js";import{m as H}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as ne,b as oe}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as U,b as X}from"./chunk-5U7KZJ3H.js";import{a as re,b as ae}from"./chunk-CN6AT4LE.js";import{b as ie}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as te}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as $,b as ee}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as Y,x as Z}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as q,j as K,x as Q}from"./chunk-MGIEURA2.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import{a as G}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as R,u as A}from"./chunk-DM2JLWKE.js";import{Dc as z,Eb as F,Ec as P,Ha as b,Mb as u,Oc as V,Pb as T,Pc as k,Rb as v,Sc as x,W,Wb as r,Xb as a,Y as I,Yb as w,_ as N,ac as _,fc as f,gc as s,h as B,ia as M,ib as m,qa as l,ra as p,s as S,sa as O,sc as C,ta as L,xc as c,yb as j,yc as g,zc as d}from"./chunk-6QJHEOXN.js";import{a as E}from"./chunk-YQFG5XE2.js";var pe=()=>({height:"calc(100vh - 100px)"});function me(i,h){if(i&1){let e=_();r(0,"p-button",7),f("onClick",function(){l(e);let t=s(2);return p(t.onFormat())}),a()}}function se(i,h){if(i&1){let e=_();r(0,"p-button",8),f("onClick",function(){l(e);let t=s(2);return p(t.openMigrateDialog())}),a()}}function ue(i,h){if(i&1&&(r(0,"div",4),F(1,me,1,0,"p-button",5)(2,se,1,0,"p-button",6),a()),i&2){let e=s();m(),v(e.roleService.permissions().migrate.delete?1:-1),m(),v(e.roleService.permissions().migrate.create?2:-1)}}function ce(i,h){if(i&1){let e=_();r(0,"div",9)(1,"div",10)(2,"label",11),C(3,"From"),a(),r(4,"p-datepicker",12),d("ngModelChange",function(t){l(e);let o=s();return g(o.filter().From,t)||(o.filter().From=t),p(t)}),a()(),r(5,"div",10)(6,"label",11),C(7,"To"),a(),r(8,"p-datepicker",12),d("ngModelChange",function(t){l(e);let o=s();return g(o.filter().To,t)||(o.filter().To=t),p(t)}),a()(),r(9,"div",10)(10,"label",11),C(11,"Page Number"),a(),r(12,"p-inputnumber",13),d("ngModelChange",function(t){l(e);let o=s();return g(o.filter().PageNumber,t)||(o.filter().PageNumber=t),p(t)}),a()(),r(13,"div",10)(14,"label",11),C(15,"Page Size"),a(),r(16,"p-inputnumber",13),d("ngModelChange",function(t){l(e);let o=s();return g(o.filter().PageSize,t)||(o.filter().PageSize=t),p(t)}),a()()()}if(i&2){let e=s();m(4),u("showIcon",!0),c("ngModel",e.filter().From),m(4),u("showIcon",!0),c("ngModel",e.filter().To),m(4),c("ngModel",e.filter().PageNumber),m(4),c("ngModel",e.filter().PageSize)}}function ge(i,h){if(i&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",14),w(3,"app-migration-cards",15),V(4,"async"),O(),r(5,"svg",16),w(6,"path",17),a(),L(),w(7,"app-migration-cards",18),V(8,"async"),a()()()),i&2){let e=s();T(P(12,pe)),m(),T(P(13,pe)),m(2),u("migrationCount",k(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),m(4),u("migrationCount",k(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var je=(()=>{class i{constructor(){this.migrateService=M(D),this.refresh$=new B(void 0),this.toastr=M(G),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null,this.roleService=M(H)}ngOnInit(){let e=this.refresh$.pipe(I(()=>this.migrateService.getManualJournalCount()),W(1));this.countInPOS$=e.pipe(S(n=>Number(n.pos))),this.countInBooks$=e.pipe(S(n=>Number(n.books)))}openMigrateDialog(){this.previousFilter=E({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(N(()=>{this.isFilterDialogOpen.update(e=>!e),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(n=>{this.refresh$.next(),this.toastr.success(n.message,"Format Successful")})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=j({type:i,selectors:[["app-manual-journal"]],features:[z([D])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create"],["label","Format","severity","danger",3,"onClick"],["label","Create",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[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(n,t){if(n&1){let o=_();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(o),p(t.onMigrate())}),d("isDialogFilterVisibleChange",function(y){return l(o),g(t.isFilterDialogOpen,y)||(t.isFilterDialogOpen=y),p(y)}),f("filterCanceled",function(){return l(o),p(t.onFilterCanceled())}),F(1,ue,3,2,"ng-template",null,0,x)(3,ce,17,6,"ng-template",null,1,x)(5,ge,9,14,"ng-template",null,2,x),a()}n&2&&(u("pageTitle",t.pageTitle),c("isDialogFilterVisible",t.isFilterDialogOpen))},dependencies:[te,A,R,ie,Z,Y,X,U,ee,$,le,oe,ne,Q,q,K,ae,re],encapsulation:2})}}return i})();export{je as ManualJournalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we}from"./chunk-B7TGZ7J3.js";import"./chunk-GQ7SPEZH.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-X6KL7VKV.js";import{a as ye,b as Ve,c as Se}from"./chunk-3O7NQ6AZ.js";import"./chunk-WL6ZZCYW.js";import{b as _e,d as ue,e as fe,f as xe,i as ge}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as ce,b as de}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as pe,f as me,i as se}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as le}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as oe,x as re}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import{d as ne}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as X,m as Y,r as Z,s as ee,u as te}from"./chunk-DM2JLWKE.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
|
|
1
|
+
import{a as we}from"./chunk-ZRPU3QYR.js";import"./chunk-6YXA7GFO.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-X6KL7VKV.js";import{a as ye,b as Ve,c as Se}from"./chunk-3O7NQ6AZ.js";import"./chunk-WL6ZZCYW.js";import{b as _e,d as ue,e as fe,f as xe,i as ge}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as ce,b as de}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{e as pe,f as me,i as se}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as ae,b as le}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as oe,x as re}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import{d as ne}from"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as X,m as Y,r as Z,s as ee,u as te}from"./chunk-DM2JLWKE.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-X6KL7VKV.js";import{a as Zt,b as gi,c as ni}from"./chunk-3O7NQ6AZ.js";import{a as kt,b as zt}from"./chunk-43JH7CKX.js";import{a as Xt}from"./chunk-YKZN6T5N.js";import{a as qe}from"./chunk-BT7Y4ADP.js";import{a as Ot}from"./chunk-5U7KZJ3H.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import{a as Vt}from"./chunk-II7KELI4.js";import{c as je}from"./chunk-FTBQKOYS.js";import{a as Lt}from"./chunk-L4ENW4RK.js";import{a as qt,b as Wt}from"./chunk-FHJOSHI3.js";import{a as Qe}from"./chunk-KONCSTVQ.js";import{a as $e}from"./chunk-FMAG3RQL.js";import{e as Qt,f as Ut,i as jt}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as At,b as Bt}from"./chunk-ISIYG4D5.js";import{a as $t}from"./chunk-FNGX2XFA.js";import{a as Mt}from"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht,z as Kt}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{$ as de,A as Re,C as De,Da as It,Ha as be,M as wt,Ma as _e,N as Pe,Na as Fe,Q as ie,R as z,S as fe,T as Ve,Va as Et,X as vt,Y as St,Z as ce,oa as Ne,ra as xt,sa as V,ta as Oe,x as Ct,z as Me}from"./chunk-MGIEURA2.js";import{d as Tt}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ae,l as yt,m as G,n as Le,o as se,u as me,x as ge}from"./chunk-DM2JLWKE.js";import{$b as T,$c as Q,Aa as S,Ab as rt,Ba as le,Cb as xe,Dc as pt,Eb as p,Ec as ee,Fa as Se,Fc as P,Gc as te,Ha as X,Hc as ht,I as Ye,Ic as ut,Kc as mt,La as it,Lb as ne,Mb as a,Nb as at,Oc as gt,Pb as Z,Qb as j,Qc as ft,Rb as Ie,Sb as Ee,Sc as x,Ub as ke,Vb as ze,Wb as d,Wc as bt,Xb as h,Yb as I,Zb as q,_ as Ce,_b as W,_c as w,ac as D,ca as we,cd as _t,da as et,fc as k,g as J,gb as ot,gc as m,ia as A,ib as s,lc as _,m as Ze,mc as E,nb as lt,nc as g,ob as N,oc as f,pa as tt,qa as L,ra as M,rc as Y,sc as b,tc as B,ua as ve,uc as re,xc as st,yb as U,yc as ct,zb as nt,zc as dt}from"./chunk-6QJHEOXN.js";import{a as $,b as ue,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
|
|
1
|
+
import{a as Yt,b as ei,c as ti,d as ii,e as oi,f as li}from"./chunk-X6KL7VKV.js";import{a as Zt,b as gi,c as ni}from"./chunk-3O7NQ6AZ.js";import{a as kt,b as zt}from"./chunk-43JH7CKX.js";import{a as Xt}from"./chunk-YKZN6T5N.js";import{a as qe}from"./chunk-BT7Y4ADP.js";import{a as Ot}from"./chunk-5U7KZJ3H.js";import{b as Be,c as Ke,d as Rt,e as Dt,f as Pt,g as Gt,h as Jt}from"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import{a as Vt}from"./chunk-II7KELI4.js";import{c as je}from"./chunk-FTBQKOYS.js";import{a as Lt}from"./chunk-L4ENW4RK.js";import{a as qt,b as Wt}from"./chunk-FHJOSHI3.js";import{a as Qe}from"./chunk-KONCSTVQ.js";import{a as $e}from"./chunk-FMAG3RQL.js";import{e as Qt,f as Ut,i as jt}from"./chunk-3NF5ANCH.js";import"./chunk-VM56C6ZV.js";import{a as At,b as Bt}from"./chunk-ISIYG4D5.js";import{a as $t}from"./chunk-FNGX2XFA.js";import{a as Mt}from"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as He,b as Ae,i as Ue,p as Nt,w as Ft,x as Ht,z as Kt}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{$ as de,A as Re,C as De,Da as It,Ha as be,M as wt,Ma as _e,N as Pe,Na as Fe,Q as ie,R as z,S as fe,T as Ve,Va as Et,X as vt,Y as St,Z as ce,oa as Ne,ra as xt,sa as V,ta as Oe,x as Ct,z as Me}from"./chunk-MGIEURA2.js";import{d as Tt}from"./chunk-DZCJWJUG.js";import"./chunk-H6JPNVHO.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ae,l as yt,m as G,n as Le,o as se,u as me,x as ge}from"./chunk-DM2JLWKE.js";import{$b as T,$c as Q,Aa as S,Ab as rt,Ba as le,Cb as xe,Dc as pt,Eb as p,Ec as ee,Fa as Se,Fc as P,Gc as te,Ha as X,Hc as ht,I as Ye,Ic as ut,Kc as mt,La as it,Lb as ne,Mb as a,Nb as at,Oc as gt,Pb as Z,Qb as j,Qc as ft,Rb as Ie,Sb as Ee,Sc as x,Ub as ke,Vb as ze,Wb as d,Wc as bt,Xb as h,Yb as I,Zb as q,_ as Ce,_b as W,_c as w,ac as D,ca as we,cd as _t,da as et,fc as k,g as J,gb as ot,gc as m,ia as A,ib as s,lc as _,m as Ze,mc as E,nb as lt,nc as g,ob as N,oc as f,pa as tt,qa as L,ra as M,rc as Y,sc as b,tc as B,ua as ve,uc as re,xc as st,yb as U,yc as ct,zb as nt,zc as dt}from"./chunk-6QJHEOXN.js";import{a as $,b as ue,e as mi}from"./chunk-YQFG5XE2.js";var _i=["colgroup"],yi=["caption"],Ti=["header"],Ci=["body"],wi=["footer"],vi=["summary"],Si=["emptymessage"],xi=["paginatorleft"],Ii=["paginatorright"],Ei=["paginatordropdownitem"],ki=["frozenheader"],zi=["frozenbody"],Li=["frozenfooter"],Mi=["frozencolgroup"],Ri=["loadingicon"],Di=["reorderindicatorupicon"],Pi=["reorderindicatordownicon"],Vi=["sorticon"],Ni=["checkboxicon"],Oi=["headercheckboxicon"],Fi=["togglericon"],Hi=["paginatorfirstpagelinkicon"],Ai=["paginatorlastpagelinkicon"],Bi=["paginatorpreviouspagelinkicon"],Ki=["paginatornextpagelinkicon"],$i=["loader"],Qi=["container"],Ui=["resizeHelper"],ji=["reorderIndicatorUp"],qi=["reorderIndicatorDown"],Wi=["table"],Gi=["scrollableView"],Ji=["scrollableFrozenView"],Xi=(t,r,e,o,i,l)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":r,"p-treetable-auto-layout":e,"p-treetable-resizable":o,"p-treetable-resizable-fit":i,"p-treetable-flex-scrollable":l}),K=t=>({$implicit:t}),Zi=(t,r)=>({left:t,width:r}),Yi=t=>({width:t});function eo(t,r){if(t&1&&I(0,"i"),t&2){let e=m(2);j("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function to(t,r){t&1&&I(0,"SpinnerIcon",24),t&2&&a("spin",!0)("styleClass","p-treetable-loading-icon")}function io(t,r){}function oo(t,r){t&1&&p(0,io,0,0,"ng-template")}function lo(t,r){if(t&1&&(d(0,"span",25),p(1,oo,1,0,null,26),h()),t&2){let e=m(3);s(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function no(t,r){if(t&1&&(q(0),p(1,to,1,2,"SpinnerIcon",22)(2,lo,2,1,"span",23),W()),t&2){let e=m(2);s(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),s(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function ro(t,r){if(t&1&&(d(0,"div",18)(1,"div",19),p(2,eo,1,2,"i",20)(3,no,3,2,"ng-container",21),h()()),t&2){let e=m();s(2),a("ngIf",e.loadingIcon),s(),a("ngIf",!e.loadingIcon)}}function ao(t,r){t&1&&T(0)}function so(t,r){if(t&1&&(d(0,"div",27),p(1,ao,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function co(t,r){t&1&&T(0)}function po(t,r){if(t&1&&p(0,co,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function ho(t,r){t&1&&p(0,po,1,1,"ng-template",29)}function uo(t,r){t&1&&T(0)}function mo(t,r){if(t&1&&p(0,uo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function go(t,r){t&1&&p(0,mo,1,1,"ng-template",30)}function fo(t,r){t&1&&T(0)}function bo(t,r){if(t&1&&p(0,fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function _o(t,r){t&1&&p(0,bo,1,1,"ng-template",31)}function yo(t,r){t&1&&T(0)}function To(t,r){if(t&1&&p(0,yo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Co(t,r){t&1&&p(0,To,1,1,"ng-template",32)}function wo(t,r){if(t&1){let e=D();d(0,"p-paginator",28),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,ho,1,0,null,21)(2,go,1,0,null,21)(3,_o,1,0,null,21)(4,Co,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function vo(t,r){t&1&&T(0)}function So(t,r){t&1&&T(0)}function xo(t,r){t&1&&T(0)}function Io(t,r){if(t&1&&(d(0,"div",33)(1,"table",34,1),p(3,vo,1,0,"ng-container",35),d(4,"thead",36),p(5,So,1,0,"ng-container",35),h(),I(6,"tbody",37),d(7,"tfoot",38),p(8,xo,1,0,"ng-container",35),h()()()),t&2){let e,o=m();s(),a("ngClass",o.tableStyleClass)("ngStyle",o.tableStyle),s(2),a("ngTemplateOutlet",o.colGroupTemplate||o._colGroupTemplate)("ngTemplateOutletContext",P(10,K,o.columns)),s(2),a("ngTemplateOutlet",o.headerTemplate||o._headerTemplate)("ngTemplateOutletContext",P(12,K,o.columns)),s(),a("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",(e=o.bodyTemplate)!==null&&e!==void 0?e:o._bodyTemplate),s(2),a("ngTemplateOutlet",o.footerTemplate||o._footerTemplate)("ngTemplateOutletContext",P(14,K,o.columns))}}function Eo(t,r){if(t&1&&I(0,"div",42,3),t&2){let e=m(2);a("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",P(4,Yi,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ko(t,r){if(t&1&&(d(0,"div",39),p(1,Eo,2,6,"div",40),I(2,"div",41,2),h()),t&2){let e=m();s(),a("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),s(),a("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",te(5,Zi,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function zo(t,r){t&1&&T(0)}function Lo(t,r){if(t&1&&p(0,zo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Mo(t,r){t&1&&p(0,Lo,1,1,"ng-template",29)}function Ro(t,r){t&1&&T(0)}function Do(t,r){if(t&1&&p(0,Ro,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function Po(t,r){t&1&&p(0,Do,1,1,"ng-template",30)}function Vo(t,r){t&1&&T(0)}function No(t,r){if(t&1&&p(0,Vo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Oo(t,r){t&1&&p(0,No,1,1,"ng-template",31)}function Fo(t,r){t&1&&T(0)}function Ho(t,r){if(t&1&&p(0,Fo,1,0,"ng-container",26),t&2){let e=m(3);a("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function Ao(t,r){t&1&&p(0,Ho,1,1,"ng-template",32)}function Bo(t,r){if(t&1){let e=D();d(0,"p-paginator",43),k("onPageChange",function(i){L(e);let l=m();return M(l.onPageChange(i))}),p(1,Mo,1,0,null,21)(2,Po,1,0,null,21)(3,Oo,1,0,null,21)(4,Ao,1,0,null,21),h()}if(t&2){let e,o,i,l=m();a("rows",l.rows)("first",l.first)("totalRecords",l.totalRecords)("pageLinkSize",l.pageLinks)("alwaysShow",l.alwaysShowPaginator)("rowsPerPageOptions",l.rowsPerPageOptions)("templateLeft",(e=l.paginatorLeftTemplate)!==null&&e!==void 0?e:l._paginatorLeftTemplate)("templateRight",(o=l.paginatorRightTemplate)!==null&&o!==void 0?o:l._paginatorRightTemplate)("dropdownAppendTo",l.paginatorDropdownAppendTo)("currentPageReportTemplate",l.currentPageReportTemplate)("showFirstLastIcon",l.showFirstLastIcon)("dropdownItemTemplate",(i=l.paginatorDropdownItemTemplate)!==null&&i!==void 0?i:l._paginatorDropdownItemTemplate)("showCurrentPageReport",l.showCurrentPageReport)("showJumpToPageDropdown",l.showJumpToPageDropdown)("showPageLinks",l.showPageLinks)("styleClass",l.paginatorStyleClass)("locale",l.paginatorLocale),s(),a("ngIf",l.paginatorFirstPageLinkIconTemplate||l._paginatorFirstPageLinkIconTemplate),s(),a("ngIf",l.paginatorPreviousPageLinkIconTemplate||l._paginatorPreviousPageLinkIconTemplate),s(),a("ngIf",l.paginatorLastPageLinkIconTemplate||l._paginatorLastPageLinkIconTemplate),s(),a("ngIf",l.paginatorNextPageLinkIconTemplate||l._paginatorNextPageLinkIconTemplate)}}function Ko(t,r){t&1&&T(0)}function $o(t,r){if(t&1&&(d(0,"div",44),p(1,Ko,1,0,"ng-container",26),h()),t&2){let e=m();s(),a("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Qo(t,r){t&1&&I(0,"div",45,4)}function Uo(t,r){t&1&&I(0,"ArrowDownIcon")}function jo(t,r){}function qo(t,r){t&1&&p(0,jo,0,0,"ng-template")}function Wo(t,r){if(t&1&&(d(0,"span",46,5),p(2,Uo,1,0,"ArrowDownIcon",21)(3,qo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Go(t,r){t&1&&I(0,"ArrowUpIcon")}function Jo(t,r){}function Xo(t,r){t&1&&p(0,Jo,0,0,"ng-template")}function Zo(t,r){if(t&1&&(d(0,"span",47,6),p(2,Go,1,0,"ArrowUpIcon",21)(3,Xo,1,0,null,26),h()),t&2){let e=m();s(2),a("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),s(),a("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Yo=["pTreeTableBody",""],el=(t,r,e,o)=>({$implicit:t,node:r,rowData:e,columns:o}),tl=(t,r)=>({$implicit:t,frozen:r});function il(t,r){t&1&&T(0)}function ol(t,r){if(t&1&&(q(0),p(1,il,1,0,"ng-container",2),W()),t&2){let e=m().$implicit,o=m();s(),a("ngTemplateOutlet",o.template)("ngTemplateOutletContext",ut(2,el,e,e.node,e.node.data,o.columns))}}function ll(t,r){if(t&1&&p(0,ol,2,7,"ng-container",1),t&2){let e=r.$implicit;a("ngIf",e.visible)}}function nl(t,r){t&1&&T(0)}function rl(t,r){if(t&1&&(q(0),p(1,nl,1,0,"ng-container",2),W()),t&2){let e=m();s(),a("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",te(2,tl,e.columns,e.frozen))}}var al=["scrollHeader"],sl=["scrollHeaderBox"],cl=["scrollBody"],dl=["scrollTable"],pl=["loadingTable"],hl=["scrollFooter"],ul=["scrollFooterBox"],ml=["scrollableAligner"],gl=["scroller"],fl=["ttScrollableView",""],bl=t=>({height:t}),ai=(t,r)=>({$implicit:t,options:r}),_l=t=>({options:t}),yl=(t,r)=>({"max-height":t,"overflow-y":r}),Tl=()=>({});function Cl(t,r){t&1&&T(0)}function wl(t,r){t&1&&T(0)}function vl(t,r){t&1&&T(0)}function Sl(t,r){if(t&1&&p(0,vl,1,0,"ng-container",14),t&2){let e=r.$implicit,o=r.options;m(2);let i=Y(11);a("ngTemplateOutlet",i)("ngTemplateOutletContext",te(2,ai,e,o))}}function xl(t,r){t&1&&T(0)}function Il(t,r){if(t&1&&p(0,xl,1,0,"ng-container",14),t&2){let e=r.options,o=m(3);a("ngTemplateOutlet",o.tt.loaderTemplate||o.tt._loaderTemplate)("ngTemplateOutletContext",P(2,_l,e))}}function El(t,r){t&1&&(q(0),p(1,Il,1,4,"ng-template",null,5,x),W())}function kl(t,r){if(t&1){let e=D();d(0,"p-scroller",19,3),k("onLazyLoad",function(i){L(e);let l=m();return M(l.tt.onLazyItemLoad(i))}),p(2,Sl,1,5,"ng-template",null,4,x)(4,El,3,0,"ng-container",17),h()}if(t&2){let e=m();Z(P(8,bl,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),a("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),s(4),a("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function zl(t,r){t&1&&T(0)}function Ll(t,r){if(t&1&&(q(0),d(1,"div",20,6),p(3,zl,1,0,"ng-container",14),h(),W()),t&2){let e=m(),o=Y(11);s(),a("ngStyle",te(3,yl,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),s(2),a("ngTemplateOutlet",o)("ngTemplateOutletContext",te(7,ai,e.serializedValue,ee(6,Tl)))}}function Ml(t,r){t&1&&T(0)}function Rl(t,r){t&1&&I(0,"div",24,8)}function Dl(t,r){if(t&1&&(d(0,"table",21,7),p(2,Ml,1,0,"ng-container",14),I(3,"tbody",22),h(),p(4,Rl,2,0,"div",23)),t&2){let e=r.$implicit,o=r.options,i=m();Z(o.contentStyle),j(i.tt.tableStyleClass),a("ngClass",o.contentStyleClass)("ngStyle",i.tt.tableStyle),s(2),a("ngTemplateOutlet",i.frozen?i.tt.frozenColGroupTemplate||i.tt._frozenColGroupTemplate||i.tt.colGroupTemplate||i.tt._colGroupTemplate:i.tt.colGroupTemplate||i.tt._colGroupTemplate)("ngTemplateOutletContext",P(13,K,i.columns)),s(),a("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",i.frozen?i.tt.frozenBodyTemplate||i.tt._frozenBodyTemplate||i.tt.bodyTemplate||i.tt._bodyTemplate:i.tt.bodyTemplate||i.tt._bodyTemplate)("serializedNodes",e)("frozen",i.frozen),s(),a("ngIf",i.frozen)}}function Pl(t,r){t&1&&T(0)}function Vl(t,r){t&1&&T(0)}function Nl(t,r){if(t&1&&(d(0,"div",25,9)(2,"div",26,10)(4,"table",27),p(5,Pl,1,0,"ng-container",14),d(6,"tfoot",28),p(7,Vl,1,0,"ng-container",14),h()()()()),t&2){let e=m();s(4),a("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),s(),a("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",P(6,K,e.columns)),s(2),a("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",P(8,K,e.columns))}}function Ol(t,r){t&1&&I(0,"ChevronDownIcon"),t&2&&ne("aria-hidden",!0)}function Fl(t,r){t&1&&I(0,"ChevronRightIcon"),t&2&&ne("aria-hidden",!0)}function Hl(t,r){if(t&1&&(q(0),p(1,Ol,1,1,"ChevronDownIcon",1)(2,Fl,1,1,"ChevronRightIcon",1),W()),t&2){let e=m();s(),a("ngIf",e.rowNode.node.expanded),s(),a("ngIf",!e.rowNode.node.expanded)}}function Al(t,r){}function Bl(t,r){t&1&&p(0,Al,0,0,"ng-template")}var Kl=({dt:t})=>`
|
|
2
2
|
/* For PrimeNG */
|
|
3
3
|
.p-treetable {
|
|
4
4
|
position: relative;
|