dealposbooks 5.45.1 → 5.46.0
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/assets/scss/components/_tables.scss +27 -3
- package/assets/scss/style.scss +4 -0
- package/{chunk-RIEXBPQ3.js → chunk-265PINEB.js} +1 -1
- package/{chunk-4OROB43Y.js → chunk-2G2COOKC.js} +1 -1
- package/{chunk-AYBSWMQT.js → chunk-37MHHHLT.js} +1 -1
- package/{chunk-IWHPWZIL.js → chunk-3H2MG3RX.js} +1 -1
- package/{chunk-PPSWJ3KZ.js → chunk-3UEIZQIL.js} +1 -1
- package/{chunk-7X6D62QP.js → chunk-3WWUSVNY.js} +1 -1
- package/{chunk-3E76NHYR.js → chunk-45SKCDTK.js} +1 -1
- package/{chunk-4SJCTDC5.js → chunk-5VNZJNWI.js} +1 -1
- package/{chunk-4LUDLDRM.js → chunk-6E6DIFFQ.js} +1 -1
- package/{chunk-F4ZNQXWG.js → chunk-6ETOXPS6.js} +1 -1
- package/{chunk-VCNN5RVA.js → chunk-6KPBN6PL.js} +1 -1
- package/{chunk-F5QD3IJY.js → chunk-6XOFO2US.js} +1 -1
- package/chunk-76ISI6NH.js +8 -0
- package/{chunk-3YP5GGRN.js → chunk-7QXFTI7P.js} +1 -1
- package/{chunk-5UQN26GG.js → chunk-BEKYAQHU.js} +1 -1
- package/chunk-BXCTHZLV.js +129 -0
- package/{chunk-4EASZOWM.js → chunk-CJMQPCRF.js} +1 -1
- package/{chunk-34AG6ZRL.js → chunk-DJSX32J5.js} +1 -1
- package/{chunk-XYDMR5UH.js → chunk-ECB5EIQL.js} +1 -1
- package/{chunk-IYWJ4NQV.js → chunk-FQIBBQO2.js} +1 -1
- package/chunk-FVWAFBXC.js +7 -0
- package/{chunk-3O7PYVJB.js → chunk-G3GX7TJT.js} +1 -1
- package/{chunk-YN2HKWAW.js → chunk-GVZFU3IL.js} +2 -2
- package/{chunk-Q5K47PTK.js → chunk-H5BCW5OG.js} +1 -1
- package/{chunk-B6BFJFA6.js → chunk-H5J2ODXS.js} +1 -1
- package/chunk-H7WUM7IF.js +1 -0
- package/{chunk-FBAUSUGQ.js → chunk-HOHCN6MI.js} +1 -1
- package/{chunk-B5ICLX2M.js → chunk-J4KTOC3S.js} +1 -1
- package/{chunk-GBBQUUCQ.js → chunk-JDN7HSFT.js} +1 -1
- package/{chunk-ZFZPBYHM.js → chunk-KJLM2JDU.js} +4 -4
- package/{chunk-NVB5C5WN.js → chunk-KRHMP57P.js} +1 -1
- package/{chunk-GVDMC4IX.js → chunk-KXRN2WUT.js} +1 -1
- package/{chunk-QMVQ67BR.js → chunk-LVSES747.js} +1 -1
- package/{chunk-V4XZTIO4.js → chunk-MXWBKCQV.js} +1 -1
- package/{chunk-MAZVUNNB.js → chunk-NA23LDSJ.js} +1 -1
- package/{chunk-34WPW5D2.js → chunk-NCP5HSZO.js} +1 -1
- package/{chunk-M675R5IO.js → chunk-NUAND7BZ.js} +1 -1
- package/{chunk-L2MQOC56.js → chunk-NWVLHJBT.js} +1 -1
- package/{chunk-X7UDCQV2.js → chunk-R4SNCEXI.js} +1 -1
- package/{chunk-55PBPTNF.js → chunk-RAM3BLIZ.js} +1 -1
- package/chunk-S2HTMYMU.js +1 -0
- package/chunk-ST5JWMO4.js +1 -0
- package/{chunk-KV6EPP4J.js → chunk-TN245HA6.js} +1 -1
- package/{chunk-EK3VPTHC.js → chunk-UOJZMQ6X.js} +1 -1
- package/{chunk-ADIJSTCG.js → chunk-UOSXT5W7.js} +1 -1
- package/{chunk-CBAJ6F64.js → chunk-V4A5GTYQ.js} +1 -1
- package/{chunk-WQLQI7VC.js → chunk-VDUU7T7V.js} +1 -1
- package/chunk-WLS2E4JE.js +1 -0
- package/{chunk-ULJ2Y7SG.js → chunk-X5TFTF7J.js} +1 -1
- package/{chunk-NKCNDLCN.js → chunk-X5UUEKFM.js} +1 -1
- package/{chunk-KYNEAC2L.js → chunk-YUYV2CG7.js} +1 -1
- package/{chunk-BCRBHPPF.js → chunk-YXJCCERT.js} +1 -1
- package/index.html +2 -2
- package/{main-VBAUVWYV.js → main-6YJJH4E2.js} +1 -1
- package/package.json +1 -1
- package/{styles-TEWF6HBI.css → styles-D4BND7FA.css} +1 -1
- package/chunk-7EJY6C3Q.js +0 -7
- package/chunk-F7JURLD3.js +0 -1
- package/chunk-KQEKK7SJ.js +0 -1
- package/chunk-OVSN4E2D.js +0 -8
- package/chunk-PUGHX4BL.js +0 -1
- package/chunk-QR5KD37B.js +0 -129
- package/chunk-VW47RJKF.js +0 -1
package/chunk-7EJY6C3Q.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as st}from"./chunk-FQRRGJBE.js";import{a as we,b as De}from"./chunk-BLR3HBYP.js";import{a as Se}from"./chunk-ADIJSTCG.js";import{a as qt,b as le}from"./chunk-ULJ2Y7SG.js";import{b as lt}from"./chunk-HG5MKVNR.js";import{b as Ut,c as pt,d as mt}from"./chunk-B54PFCWI.js";import{a as se,b as ce}from"./chunk-N4JIPI53.js";import"./chunk-7DYACF4D.js";import"./chunk-NZN6QJR3.js";import{a as ie}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as Ee,b as Ie}from"./chunk-3A4BFUGD.js";import{a as ot,b as rt,d as pe,k as me}from"./chunk-EL5BUFMO.js";import{a as re,b as ae}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as at}from"./chunk-GBBQUUCQ.js";import{a as ke}from"./chunk-QF4D5YPK.js";import{b as ye}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Ht,b as Te}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import{d as $e}from"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as oe}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{e as it,f as nt,h as ne}from"./chunk-YN2HKWAW.js";import{b as jt,c as zt}from"./chunk-VGNJD35F.js";import{a as Xe,b as te}from"./chunk-2XUSZCQL.js";import{a as O,b as Je,c as Qe,d as Ze,e as et,f as tt}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as Ke,o as Ye,w as Z,x as ee}from"./chunk-H6HNANYB.js";import{b as ve}from"./chunk-2D2YD753.js";import{b as We,c as Pt,e as K,f as Y,g as Ot,i as dt,k as $,l as X,o as J,u as Ce,x as Q}from"./chunk-OIBDX2CA.js";import{b as He,e as U,l as W}from"./chunk-AOOG6YOT.js";import{a as Gt,b as be}from"./chunk-PPSWJ3KZ.js";import{a as Ue}from"./chunk-2MKKFLNJ.js";import{h as ze,k as z,p as qe,q,s as H,y as Bt,z as At}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,Ac as ct,Bc as de,Cc as Oe,D as Be,Db as x,Dc as F,Ec as V,Fc as Nt,Gc as je,Ha as E,Lb as s,Nc as C,Ob as Ae,Oc as y,Pc as Me,Qb as M,Rb as Re,Rc as _,Tb as Fe,Ub as Ve,Vb as o,W as Ft,Wb as r,X as Vt,Xb as T,Y as xe,Yb as Ge,Zb as Pe,_ as L,bd as R,c as ge,ca as Lt,cb as j,cd as ue,db as he,ec as I,fc as c,hb as p,ia as S,ic as Mt,qa as h,ra as b,rc as a,s as Ne,sc as f,tc as w,uc as Le,wc as A,xb as N,xc as B,yc as P,zc as kt}from"./chunk-NMCKMUY4.js";import{a as g,b as v,c as fe,e as Rt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=S(Gt),this.authService=S(Se)}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/GetSingleCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",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 At({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),l=new Bt({"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=g({params:i,headers:l},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",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var 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",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function di(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function ui(t,m){t&1&&(o(0,"div",37),a(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",38)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function fi(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),T(2,"p-radiobutton",39),o(3,"label",40),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),f(e.value)}}function gi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),a(3,"Accounts"),r(),o(4,"p-select",18),x(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),x(9,ui,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),a(12,"From"),r(),o(13,"div",20),T(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),a(18,"Outlets"),r(),o(19,"p-multiselect",23),x(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),a(24,"Contact Type"),r(),o(25,"div",25),Fe(26,fi,5,4,"div",26,Re),r()(),x(28,gi,4,1,"div",16)(29,xi,4,1,"div",16)(30,hi,4,1,"div",16),o(31,"div",16)(32,"label",24),a(33,"Sort order"),r(),o(34,"div",25)(35,"div",26)(36,"div",27),T(37,"p-radiobutton",28),o(38,"label",29),a(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),T(42,"p-radiobutton",31),o(43,"label",32),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,l=c(2);s("formGroup",l.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.accounts)("ngClass",V(14,li,((e=l.form.get("accountID"))==null?null:e.invalid)&&(((e=l.form.get("accountID"))==null?null:e.touched)||((e=l.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=l.form.get("accountID"))==null?null:n.invalid)&&(((n=l.form.get("accountID"))==null?null:n.touched)||((n=l.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.outlets),p(7),Ve(l.loaderMetadata().options.contactTypeOptions),p(2),M((i=l.form.controls.contactType.value)===1?28:i===2?29:30),p(9),s("value",!0),p(5),s("value",!1)}}function Si(t,m){if(t&1&&x(0,bi,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Ci(t,m){if(t&1){let e=D();o(0,"p-button",45),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),a(2,"Return to Accounts"),r(),x(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function yi(t,m){t&1&&T(0,"div",52)}function Ei(t,m){t&1&&(o(0,"tr")(1,"th",53),a(2,"Outlet"),r(),o(3,"th",53),a(4,"No."),r(),o(5,"th",53),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",54),a(10,"Debit"),r(),o(11,"th",54),a(12,"Credit"),r(),o(13,"th",55),a(14,"Balance"),r()())}function Ii(t,m){if(t&1&&(o(0,"div",16)(1,"a",59),a(2),r(),T(3,"div",63),o(4,"span",64),a(5),r()()),t&2){let e=c().$implicit,n=c(3);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function Ti(t,m){if(t&1&&(o(0,"div",16),T(1,"span",63)(2,"div",63),o(3,"span",65),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function wi(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.debitAmount)," ")}}function Di(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.creditAmount)," ")}}function Ri(t,m){if(t&1&&(Ge(0),a(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.balance)," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",56),a(2),r(),o(3,"td",56)(4,"a",57),a(5),r()(),o(6,"td",56)(7,"span",58),C(8,"date"),a(9),C(10,"date"),r()(),o(11,"td",56)(12,"div",16)(13,"a",59),a(14),r(),x(15,Ii,6,4,"div",16)(16,Ti,5,3,"div",16),r()(),o(17,"td",60),x(18,wi,3,3,"ng-container",61),r(),o(19,"td",60),x(20,Di,3,3,"ng-container",61),r(),o(21,"td",62),x(22,Ri,3,3,"ng-container",61),r()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.outletName),p(2),s("routerLink",V(19,pi,e.id)),p(),f(e.number),p(2),s("pTooltip",Me(8,13,e.date,"dd MMM y")),p(2),w(" ",Me(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",V(21,mi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",V(23,si,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Vi(t,m){if(t&1&&(o(0,"tr"),T(1,"td",66),o(2,"td",67),a(3,"Total"),r(),o(4,"td",68),a(5),C(6,"number"),r(),o(7,"td",69),a(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c(3);p(5),w(" ",y(6,2,e.debitSubTotal())," "),p(3),w(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",70)(2,"span"),a(3,"No records found."),r()()())}function Mi(t,m){if(t&1){let e=D();o(0,"button",71),I("click",function(){h(e);let i=c(3);return b(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return b(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&a(0),t&2){let e=c(3);w(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",72),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Bi(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),x(2,yi,1,0,"ng-template",null,7,_)(4,Ei,15,0,"ng-template",null,8,_)(6,Fi,23,25,"ng-template",null,9,_)(8,Vi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),a(14),x(15,Mi,1,0,"button",50)(16,ki,1,1),a(17," entries "),r(),o(18,"div",33),x(19,Ni,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Le(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),M(e.totalRecords()===-1?15:16),p(4),M(e.pagination().hasNext?19:-1)}}function Ai(t,m){if(t&1&&x(0,Bi,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Gi(t,m){if(t&1&&(o(0,"div",73)(1,"div",74)(2,"div",75)(3,"div",25)(4,"div",76)(5,"label",24),a(6,"Page"),r()(),o(7,"div",76),T(8,"input",77),r()()()(),o(9,"div",78)(10,"div",27),T(11,"i",79),o(12,"span",80),a(13),C(14,"number"),C(15,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(12),Le("Exporting data from ",y(14,3,e.filter().exportPageNumber)," - ",y(15,5,e.filter().exportPageSize),"")}}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",81),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Kt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({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=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(at),this.toastr=S(Ue),this.dayjsService=S(le),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,l=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:!l}}),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(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,l={},u=e.get("id");return be.IsNotEmpty(u)&&(l=v(g({},l),{accountID:u})),be.IsNotEmpty(n)&&be.IsNotEmpty(i)&&(l=v(g({},l),{from:n,to:i})),l})),{initialValue:null}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),ue(()=>{let e=this.filter();e&&(be.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),ue(()=>{let e=this.filter(),n=this.form.value.accountID;!e||be.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(l=>e.pageNumber===1?i:v(g({},i),{data:v(g({},i.data),{data:[...l?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return st(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 l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():null;break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":n[i]=l!=null?Number(l):null;break;default:n[i]=l}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(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(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 l=this.form.getRawValue(),{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(g({},l),{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",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",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 Outlets",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"],[1,"d-flex","gap-1"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","3"],[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"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["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 l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,Si,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Ai,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),x(8,Gi,16,7,"div",13)(9,Pi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(11,ri)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(12,ai)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[ne,H,ze,z,q,qe,oe,me,pe,nt,it,ee,Z,Te,Ht,ae,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,lt,te,W,U,rt,ot,zt,jt,Ye,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],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}}},St=Je(tt(ji),Qe(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}),et(t=>{let m=S(G),e=S(le),n={updateFilter(i){O(t,l=>v(g({},l),{filter:g(g({},l.filter),i)}))},getLoader:Ee(ge(xe(()=>m.getIncomeStatementLoader().pipe(Ie({next:i=>{O(t,l=>v(g({},l),{loader:i,filter:v(g({},l.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ee(ge(xe(i=>m.getIncomeStatement(i).pipe(Vt(()=>O(t,l=>v(g({},l),{isLoading:!0}))),Ie({next:l=>{O(t,u=>v(g({},u),{data:l,isLoading:!1}))},error:l=>{console.error(l)}})))))};return n}),Ze({onInit:t=>{t.getLoader()}}));var Ct=()=>({}),vt=t=>["/pages/chart-of-account/account/",t],yt=()=>["/pages/report/general-ledger"],Et=(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 b(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),x(1,qi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function Ui(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 Wi(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),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Ki(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),C(7,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,1,e.store.totalRevenue()))}}function Yi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function $i(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),x(3,Ui,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Yi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(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),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(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),C(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),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalCOGS())),p(8),f(y(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),x(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);p(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),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(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),C(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),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalExpense())),p(8),f(y(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),x(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);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function ln(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),x(4,$i,11,1)(5,en,11,1)(6,an,11,1),r()()),t&2){let e,n,i,l,u,d=c();ct((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),ct((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),M(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:F(5,Ct)).length>0?4:-1),p(),M(d.Object.keys((l=(l=d.store.data().data)==null?null:l.cogs)!==null&&l!==void 0?l:F(6,Ct)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:F(7,Ct)).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,"Outlet"),r(),T(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 l=c();return b(l.onCashierSearch(i))})("onSelect",function(i){h(e);let l=c();return b(l.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),T(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var Yt=(()=>{class t{constructor(){this.dayjsService=S(le),this.store=S(St),this.fb=S(Ce),this.reportService=S(G),this.roleService=S(ie),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ue(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(ke("Cashier Suggestions"),L(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),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,[l,u])=>(l==="from"||l==="to"?u instanceof Date&&(i[l]=this.dayjsService.from(u).format()):i[l]=u||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(ke("Export Profit & Loss"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{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([St])],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 Outlet",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 l=D();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOK())}),x(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),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,Te,ae,re,Q,$,K,Y,X,J,ce,se,oe,me,pe,te,Xe,W,U,De,we,ee,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=Rt(qt());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,It.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Je(tt(mn),Qe(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))})),et(t=>{let m=S(G),e={updateFilter:n=>{O(t,i=>v(g({},i),{filter:n}))},fetchBalanceSheet:Ee(ge(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,l])=>l!=null&&l!=="")}),xe(n=>m.getBalanceSheet(n).pipe(Ie({next:i=>{O(t,l=>v(g({},l),{data:i}))},error:i=>{console.error(i)}}))),Ft(1))),fetchLoader:Ee(ge(xe(()=>m.getBalanceSheetLoader().pipe(Ie({next:n=>{O(t,i=>v(g({},i),{metadata:n,filter:{date:(0,It.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Ze(t=>({onInit:()=>{t.fetchLoader()}})));var $t=Rt(qt());var wt=t=>["/pages/chart-of-account/account/",t],Dt=()=>["/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 b(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),x(1,cn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.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),C(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",Nt(11,sn,e.accountID,n.store.filter().date)),p(),f(y(9,6,e.amount))}}function fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalAsset())," ")}}function gn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function xn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),x(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,fn,6,3,"ng-template",null,5,_)(9,gn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function hn(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),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function Sn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalLiability())," ")}}function Cn(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),x(3,hn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Sn,6,3,"ng-template",null,5,_)(9,Cn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(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),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(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),C(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),C(11,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,2,e.store.totalEquity())," "),p(6),w(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Tn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function wn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),x(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),a(7," <"),x(8,In,12,6,"ng-template",null,5,_)(10,Tn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),x(2,xn,11,1)(3,vn,11,1)(4,wn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),M(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),M(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),M(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;p(2),f(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),x(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),T(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=S(Tt),this.ReportServiceStore=S(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=S(ie),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Ot({date:new dt(new Date),outletID:new dt([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,$t.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(ke("Export Balance Sheet"),L(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{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([Tt])],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","5%"],["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 Outlet",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 l=D();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(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),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,me,pe,oe,ee,Z,Q,$,K,Y,X,J,ce,se,ae,re,ye,te,Xe,W,U],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
|
-
,
|
|
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
|
-
,
|
|
5
|
-
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ei=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-trial-balance works!"),r(),a(2,`
|
|
6
|
-
,
|
|
7
|
-
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Vn=()=>({width:"30vw"}),Ln=()=>({"1199px":"75vw","575px":"90vw"}),Mn=t=>["/pages/journal/journal-entry/",t],kn=t=>({"ng-dirty ng-invalid":t}),Nn=()=>({scrollHeight:"250px"});function Bn(t,m){if(t&1){let e=D();o(0,"p-button",27),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function An(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),a(2,"Return to Accounts"),r(),x(3,Bn,1,0,"p-button",26),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function Gn(t,m){if(t&1&&(o(0,"div",24)(1,"span",31)(2,"h2",32),a(3),r()(),o(4,"span",31)(5,"h2",32),a(6),r()()()),t&2){let e=c().$implicit;p(3),f(e.name),p(3),w(" (",e.chartOfAccountCode,") ")}}function Pn(t,m){t&1&&(o(0,"tr")(1,"th",33),a(2,"Outlet"),r(),o(3,"th",33),a(4,"No."),r(),o(5,"th",33),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",34),a(10,"Debit"),r(),o(11,"th",35),a(12,"Credit"),r(),o(13,"th",35),a(14,"Balance"),r()())}function On(t,m){if(t&1&&(o(0,"div",38)(1,"a",39),a(2),r(),T(3,"div",41),o(4,"span",42),a(5),r()()),t&2){let e=c().$implicit,n=c(4);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function jn(t,m){if(t&1&&(o(0,"div",38),T(1,"span",41)(2,"div",41),o(3,"span",42),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function zn(t,m){if(t&1&&(o(0,"tr")(1,"td",36),a(2),r(),o(3,"td",36)(4,"a",37),a(5),r()(),o(6,"td",36),a(7),C(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),a(12),r(),x(13,On,6,4,"div",38)(14,jn,5,3,"div",38),r()(),o(15,"td",40),a(16),C(17,"number"),r(),o(18,"td",40),a(19),C(20,"number"),r(),o(21,"td",40),a(22),C(23,"number"),r()()),t&2){let e=m.$implicit,n=c(4);p(2),f(e.outletName),p(2),s("routerLink",V(19,Mn,e.id)),p(),f(e.number),p(2),f(Me(8,10,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?13:14),p(3),w(" ",y(17,13,e.debitAmount)," "),p(3),w(" ",y(20,15,e.creditAmount)," "),p(3),f(y(23,17,e.balance))}}function qn(t,m){if(t&1&&(o(0,"tr"),T(1,"td",43),o(2,"td",44),a(3,"Total"),r(),o(4,"td",44),a(5),C(6,"number"),r(),o(7,"td",44),a(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c().$index,n=c(3);p(5),w(" ",y(6,2,n.items().data[e].debitTotal)," "),p(3),w(" ",y(9,4,n.items().data[e].creditTotal)," ")}}function Hn(t,m){t&1&&(o(0,"tr")(1,"td",45)(2,"span"),a(3,"No records found."),r()()())}function Un(t,m){if(t&1&&(o(0,"p-table",30),x(1,Gn,7,2,"ng-template",null,5,_)(3,Pn,15,0,"ng-template",null,6,_)(5,zn,24,21,"ng-template",null,7,_)(7,qn,11,6,"ng-template",null,4,_)(9,Hn,4,0,"ng-template",null,8,_),r()),t&2){let e=m.$implicit;s("value",e.data)}}function Wn(t,m){if(t&1&&(o(0,"div",29),Fe(1,Un,11,1,"p-table",30,Re),r()),t&2){let e=c(2);p(),Ve(e.items().data)}}function Kn(t,m){if(t&1&&x(0,Wn,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Yn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",62),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function $n(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",62),a(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function Xn(t,m){t&1&&(o(0,"div",63),a(1," Account is required. "),r())}function Jn(t,m){if(t&1&&(o(0,"div",64)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Qn(t,m){if(t&1&&(o(0,"div",55)(1,"div",21),T(2,"p-radiobutton",65),o(3,"label",66),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),Mt("for",e.key),p(),f(e.value)}}function Zn(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),a(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function eo(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),a(2,"Supplier"),r(),o(3,"p-autocomplete",68),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.supplierSuggestions())}}function to(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),a(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function io(t,m){if(t&1){let e=D();o(0,"form",46)(1,"div",38)(2,"label",47),a(3,"Accounts"),r(),o(4,"p-multiselect",48),I("onChange",function(i){h(e);let l=c();return b(l.onAccountChange(i))}),x(5,Yn,10,2,"ng-template",null,9,_)(7,$n,10,2,"ng-template",null,10,_),r(),x(9,Xn,2,0,"div",49),r(),o(10,"div",38)(11,"label",47),a(12,"From"),r(),o(13,"div",50),T(14,"p-datepicker",51)(15,"p-datepicker",52),r()(),o(16,"div",38)(17,"label",47),a(18,"Outlets"),r(),o(19,"p-multiselect",53),x(20,Jn,3,1,"ng-template",null,10,_),r()(),o(22,"div",38)(23,"label",47),a(24,"Category"),r(),o(25,"p-treeselect",54),I("onFocus",function(){h(e);let i=c();return b(i.onCategoryFocus())}),r()(),o(26,"div",38)(27,"label",18),a(28,"Contact Type"),r(),o(29,"div",16),Fe(30,Qn,5,4,"div",55,Re),r()(),o(32,"div",38)(33,"label",18),a(34,"Sort order"),r(),o(35,"div",16)(36,"div",55)(37,"div",21),T(38,"p-radiobutton",56),o(39,"label",57),a(40,"Asc"),r()()(),o(41,"div",58)(42,"div",21),T(43,"p-radiobutton",59),o(44,"label",60),a(45,"Desc"),r()()()()(),x(46,Zn,4,1,"div",38)(47,eo,4,1,"div",38)(48,to,4,1,"div",38),r()}if(t&2){let e,n,i,l,u,d,k=c();s("formGroup",k.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(e=k.loaderMetadata())==null||e.options==null?null:e.options.accounts)("selectionLimit",5)("ngClass",V(22,kn,((n=k.form.get("listAccountID"))==null?null:n.invalid)&&(((n=k.form.get("listAccountID"))==null?null:n.touched)||((n=k.form.get("listAccountID"))==null?null:n.dirty)))),p(5),s("ngIf",((i=k.form.get("listAccountID"))==null?null:i.invalid)&&(((i=k.form.get("listAccountID"))==null?null:i.touched)||((i=k.form.get("listAccountID"))==null?null:i.dirty))),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(l=k.loaderMetadata())==null||l.options==null?null:l.options.outlets),p(6),s("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",F(24,Nn))("options",k.categoriesOptions()),p(5),Ve((u=k.loaderMetadata())==null||u.options==null?null:u.options.contactTypeOptions),p(8),s("value",!0),p(5),s("value",!1),p(3),M((d=k.form.controls.contactType.value)===1?46:d===2?47:48)}}function no(t,m){if(t&1){let e=D();o(0,"p-button",69),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function oo(t,m){if(t&1){let e=D();o(0,"p-button",70),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",71),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var ti=(()=>{class t{buildReferenceUrl(e){return st(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({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=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(at),this.toastr=S(Ue),this.dayjsService=S(le),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=Math.min(e.pageNumber*e.pageSize,isFinite(n)?n:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(n)?e.pageNumber*e.pageSize<n:!0}}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("multiple"),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=R(()=>{let e=this.baseFilter(),n=this.queryFilter(),i=this.localFilter();return e?g(g(g({},e),n??{}),i):null}),this.creditSubTotal=R(()=>0),this.debitSubTotal=R(()=>0),this.initializeForm(),ue(()=>{let e=this.filter();e&&(e.listAccountID.length>0||e.listCategoryID.length>0)&&(this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1}),this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(n=>{this.items.set(n)}))})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(null),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),listCategoryID:this.fb.control([]),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 l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":n[i]=l!=null?Number(l):null;break;default:n[i]=l}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}onFormValueChange(){let e=this.form.controls.listAccountID.value,n=this.form.controls.listCategoryID.value;e.length<=0&&n.length<=0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1})):e.length>0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.disable({emitEvent:!1})):n.length>0&&(this.form.controls.listAccountID.disable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1}))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at most 5 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)}buildFilterBody(){let l=this.form.value,{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],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(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=fe(l,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],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(g({},e),{pageNumber:n+1})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(g({},l),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-multiple-ledger"]],decls:28,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"row"],[1,"col"],["for",""],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],[1,"d-flex","gap-2"],["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,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","selectionLimit","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","key","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"col-4"],["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,"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"],["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 l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),x(1,An,4,1,"ng-template",null,0,_)(3,Kn,1,1,"ng-template",null,1,_)(5,io,49,25,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),o(8,"div",13)(9,"div",14)(10,"div",15)(11,"div",16)(12,"div",17)(13,"label",18),a(14,"Page"),r()(),o(15,"div",17),T(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),T(19,"i",22),o(20,"span",23),a(21),C(22,"number"),C(23,"number"),r()()()(),x(24,no,1,2,"ng-template",null,3,_)(26,oo,2,0,"ng-template",null,4,_),r()}if(n&2){let l;s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(17,Vn)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(18,Ln)),p(2),s("formGroup",i.form),p(12),Le("Exporting data from ",y(22,13,(l=i.filter())==null?null:l.exportPageNumber)," - ",y(23,15,(l=i.filter())==null?null:l.exportPageSize),"")}},dependencies:[ne,H,ze,z,q,qe,oe,me,pe,nt,it,ee,Z,Te,ae,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,Ut,lt,te,W,U,rt,ot,Ye,Ke],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var $a=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Kt},{path:"multiple-general-ledger",component:ti},{path:"profit-loss",component:Yt},{path:"balance-sheet",component:Jt},{path:"comparative-balance",component:Qt},{path:"trial-balance",component:ei},{path:"cash-flow",component:Zt}]}];export{$a as REPORTS_ROUTES};
|
package/chunk-F7JURLD3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-XD7VHCRC.js";import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Te,b as Fe}from"./chunk-3A4BFUGD.js";import{d as te,e as qe,i as we,j as Me,k as ne}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Ae}from"./chunk-QF4D5YPK.js";import{a as re,b as pe}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Y,b as K}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{a as Ee,b as z}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as F}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import{a as H,b as $}from"./chunk-2XUSZCQL.js";import{a as ee,b as ye,c as be,d as Pe,e as Oe,f as Ie,g as Je}from"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{o as Ke,w as G,x as L}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{e as j,f as _e,j as ae,k as ge,l as xe,m as he,n as Ye,o as Ce,u as Se,w as Z,x as ve}from"./chunk-OIBDX2CA.js";import{b as ie,d as ze,e as N,l as D}from"./chunk-AOOG6YOT.js";import{a as fe}from"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{k as A,o as He,s as T}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as v,Cc as de,Db as _,Dc as W,Ec as oe,Ha as M,Lb as s,Nc as Ue,Ob as q,Oc as je,Qb as $e,Rb as b,Rc as u,Tb as P,Ub as O,Vb as a,Wb as i,Xb as B,Y as U,_ as w,bd as X,c as se,ca as ue,cb as Ve,ec as y,fc as c,hb as p,ia as h,qa as C,ra as S,rc as m,s as Q,sc as d,tc as I,vc as We,xb as E}from"./chunk-NMCKMUY4.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=h(fe)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(k||{});var it={[k.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[k.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[k.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[k.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[k.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[k.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[k.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[k.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[k.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function _t(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function gt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function xt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,xt,7,2,"ng-template",null,2,u)(10,ht,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function St(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,St,7,2,"ng-template",null,2,u)(10,vt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),P(4,Ct,12,4,"div",14,b),i()(),a(6,"div",12)(7,"div",13),P(8,yt,12,4,"div",14,b),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Pt(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),P(3,gt,2,2,"p-tab",10,b),i(),a(5,"p-tabpanels"),P(6,bt,10,2,"p-tabpanel",10,b),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function Ot(t,r){if(t&1&&_(0,Pt,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(R),this.fb=h(Se),this.tab=M(k.POSGLOBAL_SELL),this.tabs=M(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=M(null),this.form=M([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(w(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:g,accountID:V}of l){let Be=`${g}_${V}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:V||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,_t,2,0,"ng-template",null,0,u)(3,Ot,1,1,"ng-template",null,1,u),i())},dependencies:[F,ot,nt,tt,et,Xe,Ze,Ke,K,Y,Z,ge,j,_e,T,A,D,L,G,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=t=>[t];function Et(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Tt(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),P(4,Et,2,1,"th",7,b),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function Ft(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function wt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),P(4,Ft,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,It,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Mt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Tt,6,0,"ng-template",null,1,u)(3,wt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("value",e.paymentConfiguration().payment)}}function Dt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Mt,5,1,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)("scrollable",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(R),this.paymentConfiguration=M(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(w(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(w(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&_(0,Dt,3,2,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[F,ne,te,qe,T,A,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Rt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=ye(Ie(Rt),be(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(R);return{updateFilter:n=>{ee(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(U(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{ee(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Pe(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var kt=t=>[t];function At(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Nt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),P(3,At,2,1,"th",null,b),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Gt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Lt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),P(4,Gt,2,1,"td",null,b),i()),t&2){let e=r.$implicit;p(2),s("routerLink",oe(2,kt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function Bt(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Vt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function $t(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Nt,5,0,"ng-template",null,1,u)(4,Lt,6,4,"ng-template",null,2,u)(6,Bt,1,3,"ng-template",null,3,u)(8,Vt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(Ge)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet"]],features:[de([Ge])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();a(0,"app-main-panel",5),y("search",function(V){return C(l),S(o.onSearch(V))}),_(1,$t,10,5,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)("scrollable",!0)},dependencies:[F,T,z,ne,te,D,N,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Wt=()=>({height:"calc(100vh - 100px)"}),Ut=()=>({height:"calc(100vh - 150px)"});function jt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Ht(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function zt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Yt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Ht,7,2,"ng-template",null,2,u)(6,zt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function Kt(t,r){t&1&&B(0,"hr")}function Jt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),P(5,Yt,8,3,"div",12,b),i()(),_(7,Kt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,V=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(V.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function qt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),P(4,Jt,8,5,null,null,b),i()()()()),t&2){let e=c();q(W(5,Wt)),p(),q(W(6,Ut)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.outletForm=M(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),w(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,jt,3,0,"ng-template",null,0,u)(3,qt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[F,T,A,He,z,ve,ge,j,_e,xe,Ce,he,Ye,K,Y,$,H,re,L,G,D,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=()=>({height:"calc(100vh - 100px)"}),en=()=>({width:"100%",height:"calc(100vh - 150px)"}),tn=()=>({width:"100%"});function nn(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function on(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),B(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,on,7,2,"ng-template",null,2,u)(10,an,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),q(W(7,tn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function pn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),P(3,rn,12,8,"div",9,b),i()()()),t&2){let e=c(3);q(W(4,Zt)),p(),q(W(5,en)),p(2),O(e.paymentForm().form.accounts)}}function ln(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,nn,3,0,"ng-template",null,0,u)(3,pn,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function mn(t,r){if(t&1&&_(0,ln,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var mt=(()=>{class t{constructor(){this.route=h(ie),this.POSSetupService=h(R),this.paymentForm=M(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),U(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),w(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),w(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&_(0,mn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[z,Ee,F,T,A,pe,re,K,Y,Z,j,ae,D,N,L,G,$],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function cn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function sn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function un(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function dn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,sn,7,2,"ng-template",null,2,u)(7,un,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function fn(t,r){if(t&1&&(a(0,"p-panel")(1,"div",8)(2,"div",9)(3,"div",10),P(4,dn,9,3,"div",11,b),i()()()()),t&2){let e=c();p(4),O(e.taxForm().form)}}var ct=(()=>{class t{constructor(){this.POSSetupService=h(R),this.taxForm=M(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(w(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(w(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,cn,4,0,"ng-template",null,0,u)(3,fn,6,0,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,z,T,K,Y,pe,Z,j,ae,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _n=()=>({"min-width":"50rem"}),gn=t=>[t];function xn(t,r){t&1&&B(0,"p-button",6)}function hn(t,r){if(t&1&&_(0,xn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Cn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function Sn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td")(4,"a",10),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",oe(4,gn,e.id)),p(),d(e.name),p(2),d(e.description)}}function vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onSelectAll(o))}),_(2,Cn,7,0,"ng-template",null,2,u)(4,Sn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.writeoffList().data)("tableStyle",W(2,_n))}}var st=(()=>{class t{constructor(){this.POSSetupService=h(R),this.writeoffList=M(null),this.hasCheckedItems=X(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),w(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=x(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,hn,1,1,"ng-template",null,0,u)(3,vn,6,3,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,T,A,ne,te,we,Me,D,N,L,G,$,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yn=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function bn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Pn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function On(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function In(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Pn,5,2,"ng-template",null,2,u)(7,On,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function En(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),P(5,In,9,5,"div",12,b),i()()()()()),t&2){let e=c(2);p(),q(W(2,yn)),p(4),O(e.writeOffForm().form)}}function Tn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,bn,4,0,"ng-template",null,0,u)(3,En,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(R),this.route=h(ie),this.writeOffForm=M(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),U(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),w(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,V)=>V===n?x(f({},g),{accountID:e}):g)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&_(0,Tn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[F,T,A,z,Ee,pe,re,K,Y,Z,j,ae,D,N,L,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var dt=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fn={data:{expenseOptions:[]}},Le=ye(Ie(Fn),Je("POSExpenseOptionStore"),be(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(dt);return{onRowSelect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){ee(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(U(()=>r.getExpenseOptions().pipe(Fe({next:n=>{ee(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Pe({onInit:t=>{t.getExpenseOptions()}}));function wn(t,r){t&1&&B(0,"p-button",6)}function Mn(t,r){if(t&1&&_(0,wn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Dn(t,r){t&1&&(a(0,"tr")(1,"th",8),B(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Rn(t,r){if(t&1&&(a(0,"tr")(1,"td"),B(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),B(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function kn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Dn,9,0,"ng-template",null,2,u)(4,Rn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();p(),s("value",e.store.data().expenseOptions)}}var ft=(()=>{class t{constructor(){this.store=h(Le)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-pos-expense-option"]],features:[de([Le])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option",3,"scrollable"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","1rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Mn,1,1,"ng-template",null,0,u)(3,kn,6,1,"ng-template",null,1,u),i()),n&2&&s("scrollable",!0)},dependencies:[F,ne,te,we,Me,$,H,L,G,T,A],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ga=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:mt},{path:"taxs",component:ct},{path:"writeoff",component:st},{path:"writeoff/:id",component:ut},{path:"expense-option",component:ft}]}];export{Ga as POS_SETUP_ROUTES};
|
package/chunk-KQEKK7SJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as X}from"./chunk-WQLQI7VC.js";import{d as W,i as q,j as K,k as G}from"./chunk-EL5BUFMO.js";import"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Q}from"./chunk-QF4D5YPK.js";import"./chunk-2AAVNIG7.js";import"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as O}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{w as B}from"./chunk-H6HNANYB.js";import{a as N,b as U}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-PPSWJ3KZ.js";import"./chunk-2MKKFLNJ.js";import{k as I}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as T,Db as h,Ec as A,Ha as b,L as R,Lb as d,Qb as v,Rc as _,Vb as i,Wb as o,Xb as w,Y as J,_ as k,bd as S,cd as H,ec as x,fc as r,hb as f,ia as D,qa as m,ra as c,rc as u,s as j,sc as V,vc as F,wc as M,xb as E,xc as z,yc as P}from"./chunk-NMCKMUY4.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)}}function re(t,p){if(t&1&&h(0,le,9,5,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(Q("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,G,W,q,K,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
|
package/chunk-OVSN4E2D.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as Ke,b as Qe,c as Xe,d as Ye,e as Ze,f as et}from"./chunk-XD7VHCRC.js";import{a as $e,b as ze,c as Ue,d as qe}from"./chunk-UP67MADL.js";import{a as We,b as He}from"./chunk-NCDT6JPP.js";import{a as Le}from"./chunk-JRVYSBUZ.js";import{b as Me}from"./chunk-ULJ2Y7SG.js";import{a as Je,b as je}from"./chunk-HG5MKVNR.js";import"./chunk-NZN6QJR3.js";import{a as Be,b as Ve,d as Oe,k as ke}from"./chunk-EL5BUFMO.js";import{a as Te,b as we}from"./chunk-EQ4PLHI4.js";import"./chunk-H7Q35Y7G.js";import"./chunk-R7N6BWL5.js";import{a as Re}from"./chunk-QF4D5YPK.js";import{a as Q,b as X}from"./chunk-VJ3IBUVO.js";import"./chunk-2AAVNIG7.js";import{a as Ge,b as Pe}from"./chunk-LFZCMZAP.js";import"./chunk-6A2KUPOG.js";import{a as Ne,b as De}from"./chunk-36OX4S7M.js";import"./chunk-Q5CVMJZC.js";import"./chunk-3GGXPPQT.js";import"./chunk-MFK5RQPJ.js";import{b as Y}from"./chunk-KJ2WX3FC.js";import"./chunk-6GN3MGBY.js";import"./chunk-Q24GCSGD.js";import{h as A}from"./chunk-YN2HKWAW.js";import"./chunk-VGNJD35F.js";import{a as J,b as j}from"./chunk-2XUSZCQL.js";import"./chunk-YV2QJ63P.js";import"./chunk-ARH3WEEF.js";import{n as K,o as F,w as k,x as R}from"./chunk-H6HNANYB.js";import"./chunk-2D2YD753.js";import{Ha as O,La as Ee,b as N,c as le,e as y,f as D,j as Ae,l as G,m as W,n as Ie,o as P,u as B,w as H,x as V}from"./chunk-OIBDX2CA.js";import{b as Ce,e as xe,l as Se}from"./chunk-AOOG6YOT.js";import{a as Fe}from"./chunk-PPSWJ3KZ.js";import{a as ye}from"./chunk-2MKKFLNJ.js";import{h as be,k as ve,q as _e,s as S}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as _,Cc as q,Db as g,Dc as I,Ec as oe,Ha as L,L as se,Lb as p,Nc as re,Ob as $,Oc as ae,Rb as T,Rc as f,Tb as w,Ub as M,Vb as i,Wb as n,Xb as c,Z as ue,_ as E,ca as de,ec as C,fc as d,g as pe,hb as l,ia as u,nb as ie,qa as h,ra as b,rc as r,s as ce,sc as U,tc as z,wc as fe,xb as x,xc as ge,yc as he}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var v=(()=>{class t{#e=u(Fe);fetchLoaderConfiguration(){return this.#e.get("","api/SetupLoader/Load")}updateAccountingIntegrationConfiguration(e){return this.#e.post(void 0,"/api/setup/SubmitConfig",e)}fetchOpeningBalanceFormConfiguration(){return this.#e.get("","/api/setup/OpeningBalance/Form")}submitOpeningBalanceFormConfiguration(e){return this.#e.post("","api/setup/OpeningBalance/Submit",e)}fetchAPICredential(){return this.#e.get(void 0,"/api/AccountConfig")}updateAPICredential(e){return this.#e.put(void 0,"/api/AccountConfig",e)}verifyAPICredential(e){return this.#e.post(void 0,"/api/AccountConfig/Validate",e)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ut=()=>({height:"calc(100vh - 100px)"});function dt(t,m){if(t&1){let e=_();i(0,"div",4)(1,"a",5),r(2,"Cancel"),n(),i(3,"p-button",6),C("click",function(){h(e);let a=d();return b(a.updateAccountingIntegration())}),n()()}}function ft(t,m){if(t&1&&(i(0,"p-tab",8),r(1),n()),t&2){let e=m.$implicit,o=m.$index;p("value",o),l(),U(e)}}function gt(t,m){if(t&1&&(i(0,"div",25),c(1,"p-radiobutton",41),i(2,"label",42),r(3),n()()),t&2){let e=m.$implicit;l(),p("value",e.key)("inputId",e.value),l(),p("for",e.value),l(),U(e.value)}}function ht(t,m){if(t&1&&(i(0,"div",40)(1,"div",25),c(2,"p-radiobutton",43),i(3,"label",42),r(4),n()()()),t&2){let e=m.$implicit;l(2),p("value",e.key)("inputId",e.key.toString()),l(),p("for",e.key),l(),U(e.value)}}function bt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),w(4,ft,2,2,"p-tab",8,T),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),r(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),r(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),r(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),r(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),r(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),r(37,"Reset Every"),n(),i(38,"div",24),w(39,gt,4,4,"div",25,T),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),r(45,"Journal Generate"),n(),i(46,"p"),r(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),r(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),r(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),r(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),r(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),r(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),r(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),r(88,"Accounting For Treatment"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),w(92,ht,5,4,"div",40,T),n()()()()()()()()()()()()),t&2){let e,o,a,s=d();$(I(8,ut)),l(2),p("value",0)("formGroup",s.form),l(2),M(s.tabs()),l(3),p("value",0),l(26),p("options",(e=s.accountingIntegration())==null||e.options==null?null:e.options.monthlyResetPeriodFormat),l(6),M((o=s.accountingIntegration())==null||o.options==null?null:o.options.resetPeriods),l(2),p("value",1),l(38),p("value",2),l(13),M((a=s.accountingIntegration())==null||a.options==null?null:a.options.generatePrepaidJournal)}}var nt=(()=>{class t{constructor(){this.accountingSetupService=u(v),this.fb=u(B).nonNullable,this.tabs=L(["Numbering","Journal","Report"]),this.accountingIntegration=L(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(E(e=>{this.accountingIntegration.set(e),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],["formGroupName","number",3,"value"],[1,""],[1,"fs-5"],[1,"row"],[1,"col-6"],[1,"row","row-gap-3"],[1,"d-flex","flex-column"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["for","",1,"fs-4"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","journalGenerate",1,"row"],[1,"col-12"],[1,"col-10"],[1,"col-md-4","mb-3"],["formControlName","transferOrder"],[1,"col-md-6","mb-4"],["formControlName","paymentDiscount"],[1,"col-12","mb-2"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-4"],["for","generatePrepaidJournal",1,"fs-4","mb-2"],[1,"col-8"],[1,"col-4"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,dt,4,0,"ng-template",null,0,f)(3,bt,94,9,"ng-template",null,1,f),n())},dependencies:[S,et,Ze,Ye,Xe,Ke,Qe,A,Y,Ve,Be,V,y,D,G,P,W,F,Pe,Ge,je,Je,Se,xe,R,k,De,Ne,X,Q],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var Ct=()=>({height:"cacl(100vh - 200px)"}),xt=()=>({height:"calc(100vh - 250px)"}),it=()=>({});function St(t,m){if(t&1){let e=_();i(0,"div")(1,"p-button",5),C("onClick",function(){h(e);let a=d();return b(a.submitForm())}),n()()}}function yt(t,m){t&1&&(i(0,"div",17)(1,"h3",18),r(2,"Date"),n(),c(3,"p-datePicker",19),n())}function Ft(t,m){t&1&&(i(0,"tr")(1,"th",25),r(2,"Account Name"),n(),i(3,"th",26),r(4,"Debit"),n(),i(5,"th",26),r(6,"Credit"),n()())}function At(t,m){if(t&1&&(i(0,"tr",9)(1,"td",25),r(2),n(),i(3,"td"),c(4,"input",27),n(),i(5,"td"),c(6,"input",28),n()()),t&2){let e,o=m.$implicit,a=m.rowIndex,s=d(4);p("formGroupName",a),l(2),z(" ",(e=s.asFormGroup(o).get("accountName"))==null?null:e.value," "),l(2),p("autoNumeric",I(4,it)),l(2),p("autoNumeric",I(5,it))}}function It(t,m){if(t&1&&(i(0,"div",9)(1,"h4",20),r(2),n(),i(3,"div",21)(4,"p-table",22),g(5,Ft,7,0,"ng-template",23)(6,At,7,6,"ng-template",24),n()()()),t&2){let e=m.$implicit,o=m.$index,a=d(3);p("formGroupName",o),l(2),z(" ",e.get("name").value," "),l(2),p("value",a.getItemsArray(a.asFormGroup(e)).controls)}}function Et(t,m){if(t&1&&(i(0,"p-panel",7),g(1,yt,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",8),w(6,It,7,3,"div",9,T),n()(),i(8,"div",10)(9,"table",11)(10,"tr")(11,"td",12)(12,"p",13),r(13," Total: "),n()(),i(14,"td",14)(15,"p",15),r(16),re(17,"number"),n()(),i(18,"td",16)(19,"p",15),r(20),re(21,"number"),n()()()()()()),t&2){let e=d(2);$(I(11,Ct)),p("formGroup",e.formGroups),l(4),$(I(12,xt)),l(2),M(e.formsArray.controls),l(10),z(" ",ae(17,7,e.subtotalDebit)," "),l(4),z(" ",ae(21,9,e.subtotalCredit)," ")}}function Tt(t,m){if(t&1&&g(0,Et,22,13,"p-panel",6),t&2){let e=d();p("ngIf",e.formGroups)}}var rt=(()=>{class t{constructor(){this.destroy$=new pe,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(B),this.accSetupService=u(v),this.dayjsService=u(Me),this.date=new Date,this.routes=u(Ce)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(se(300),ue(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let o=e.map(a=>this.createItemGroup(a));return this.fb.array(o)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ce(e=>e.data),Re("response"),E(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(a=>a.items&&a.items.length>0).forEach(a=>{this.formsArray.push(this.createFormGroup(a))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(o=>{let a=this.getItemsArray(o),s=a.controls.reduce((ee,te)=>{let ne=te.get("debitAmount").value||0;return ee+ne},0),ct=a.controls.reduce((ee,te)=>{let ne=te.get("creditAmount").value||0;return ee+ne},0);this.subtotalDebit+=s,this.subtotalCredit+=ct})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((o,[a,s])=>(a==="date"?o[a]=s instanceof Date?this.dayjsService.format(s):s:a==="forms"?o.form=s:o[a]=s,o),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-acc-opening-balance-form"]],features:[q([O])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
|
|
2
|
-
width`,`calc(
|
|
3
|
-
100% - 243px
|
|
4
|
-
)`,`/* adjust width to fit the remaining space */
|
|
5
|
-
z-index`,"91","background-color","white",`/* added background */
|
|
6
|
-
/* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
|
|
7
|
-
padding`,"8px 0",`/* added padding for height */
|
|
8
|
-
border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],["formControlName","debitAmount",1,"fs-3","form-control",3,"autoNumeric"],["formControlName","creditAmount",1,"fs-3","form-control",3,"autoNumeric"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,St,2,0,"ng-template",null,0,f)(3,Tt,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",4)),o&2&&p("scrollable",!0)},dependencies:[A,Y,Ee,S,ve,_e,we,Te,ke,Oe,X,Q,H,N,y,D,F,Ue,R,k,j,J,Le,V,G,P,W,Ie,He,We],styles:["[_nghost-%COMP%]{display:block} .container-wrapper .p-datatable .p-datatable-thead>tr>th{top:0!important}"],changeDetection:0})}}return t})();var at=t=>({"ng-invalid ng-dirty":t});function Mt(t,m){if(t&1){let e=_();i(0,"p-button",4),C("onClick",function(){h(e);let a=d();return b(a.verifyCredentials())}),r(1,"Verify"),n(),i(2,"p-button",4),C("onClick",function(){h(e);let a=d();return b(a.saveCredentials())}),r(3,"Update"),n()}}function Nt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),r(2,"Account"),n(),i(3,"small",14),r(4,"Configure Client ID and Client Secret"),n()())}function Dt(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,Nt,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),r(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),r(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=d();l(4),p("formGroup",e.credentialForm),l(5),p("ngClass",oe(3,at,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),p("ngClass",oe(5,at,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var lt=(()=>{class t{constructor(e,o){this.fb=e,this.messageService=o,this.setupService=u(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(E(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[le.required]],clientSecret:["",[le.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:o=>{console.log("Verify result:",o),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:o=>{console.error("Verify failed:",o),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(o){return new(o||t)(ie(B),ie(O))}}static{this.\u0275cmp=x({type:t,selectors:[["app-api-credential"]],features:[q([O])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Mt,4,0,"ng-template",null,0,f)(3,Dt,15,7,"ng-template",null,1,f),n())},dependencies:[S,be,V,N,y,D,G,P,F,K,j,J,A,R,k,qe],encapsulation:2})}}return t})();function Gt(t,m){if(t&1){let e=_();i(0,"button",4),C("click",function(){h(e);let a=d();return b(a.onFormatJournal())}),r(1," Format "),n()}}function Pt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),r(3,"Journal Configuration"),n(),i(4,"small",15),r(5," Enter your account information to format journal entries "),n()()())}function Bt(t,m){if(t&1){let e=_();i(0,"div",5)(1,"p-panel"),g(2,Pt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),he("ngModelChange",function(a){h(e);let s=d();return ge(s.subdomain,a)||(s.subdomain=a),b(a)}),n(),i(8,"label",10),r(9,"Subdomain"),n()(),i(10,"small",11),r(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=d();l(7),fe("ngModel",e.subdomain)}}var mt=(()=>{class t{constructor(){this.setupService=u(v),this.subdomain=L(""),this.toastrService=u(ye)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Gt,2,0,"ng-template",null,0,f)(3,Bt,12,1,"ng-template",null,1,f),n())},dependencies:[S,H,N,y,Ae,F,K,A,j,J,ze,$e],encapsulation:2})}}return t})();var pt=()=>u(v).fetchOpeningBalanceFormConfiguration();var bi=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"journal-tag",loadComponent:()=>import("./chunk-KQEKK7SJ.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-34WPW5D2.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-B5ICLX2M.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:nt},{path:"opening-balance-form",component:rt,resolve:{data:pt}},{path:"api-crendetial",component:lt},{path:"format-journal",component:mt},{path:"closing-entries",loadComponent:()=>import("./chunk-AYBSWMQT.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-55PBPTNF.js").then(t=>t.ClosingFormComponent)}]}];export{bi as ACCOUNTING_SETUP_ROUTES};
|
package/chunk-PUGHX4BL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-EK3VPTHC.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-NVB5C5WN.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-4OROB43Y.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-QMVQ67BR.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-CBAJ6F64.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-M675R5IO.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-4LUDLDRM.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-3E76NHYR.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-3O7PYVJB.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
|