dealposbooks 5.48.0 → 5.49.1
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/3rdpartylicenses.txt +5 -5
- package/assets/scss/layouts/_sidebar.scss +2 -1
- package/assets/scss/style.scss +10 -0
- package/{chunk-DDM2KWNX.js → chunk-2LNMV22E.js} +1 -1
- package/chunk-3KWJOHNE.js +1 -0
- package/chunk-3ZDXMXR7.js +1 -0
- package/chunk-4CT2IUWQ.js +1 -0
- package/chunk-5DRALZZF.js +1 -0
- package/{chunk-VKT27VPR.js → chunk-64PX5TMF.js} +2 -2
- package/chunk-6JPM6TG4.js +1 -0
- package/chunk-75DDNXGP.js +1 -0
- package/chunk-7A5MPGKC.js +1 -0
- package/{chunk-YPOBALKC.js → chunk-AFKKNLDY.js} +1 -1
- package/chunk-AQYWE6TS.js +1 -0
- package/chunk-AYUYBSUN.js +1 -0
- package/chunk-BGO4VAXH.js +1 -0
- package/chunk-BRKRIPYY.js +1 -0
- package/{chunk-NNNKDAA2.js → chunk-CAS5GLLU.js} +1 -1
- package/{chunk-FUCKNGW4.js → chunk-CB44HQLK.js} +2 -2
- package/chunk-CUCSYZR2.js +202 -0
- package/{chunk-F6LZM7H5.js → chunk-DGACZ747.js} +1 -1
- package/chunk-DNH5W432.js +1 -0
- package/{chunk-FSB3LHPU.js → chunk-EBEY2MBR.js} +1 -1
- package/{chunk-RXR5DXWS.js → chunk-ELMSU4U7.js} +1 -1
- package/{chunk-2JNXKEYZ.js → chunk-EMJBQMMM.js} +1 -1
- package/{chunk-VW2FJYIZ.js → chunk-ES2YST7G.js} +1 -1
- package/{chunk-CEK7MQW2.js → chunk-F7JOE6RA.js} +1 -1
- package/{chunk-LBREDZL5.js → chunk-FWAGEKIF.js} +1 -1
- package/chunk-G75NZLKG.js +1 -0
- package/chunk-GPXKVMG6.js +1 -0
- package/{chunk-LXLOWSN6.js → chunk-HCJK6VTO.js} +1 -1
- package/chunk-IU5ELUD3.js +1 -0
- package/chunk-IUM4NWIG.js +1 -0
- package/chunk-L5U2UBAI.js +1 -0
- package/chunk-LJYIEJUY.js +1 -0
- package/{chunk-W63NE6LU.js → chunk-LKOCOLCM.js} +4 -4
- package/{chunk-ZQWFATZY.js → chunk-LUNMW7NC.js} +1 -1
- package/chunk-LWPIHDR2.js +130 -0
- package/chunk-MJZFJU44.js +1 -0
- package/chunk-MMRINCFB.js +1 -0
- package/chunk-MR3OGQ2R.js +1 -0
- package/chunk-N3QZNL7B.js +7 -0
- package/chunk-NGLRDAET.js +1 -0
- package/chunk-NMU2YBAB.js +1 -0
- package/chunk-O26EFRQ7.js +1 -0
- package/chunk-O7CGBSJM.js +1 -0
- package/chunk-PDW76PO5.js +1 -0
- package/{chunk-BG6BR7KI.js → chunk-PKO36DGM.js} +1 -1
- package/{chunk-FVYL3BQ7.js → chunk-PMLX776V.js} +1 -1
- package/{chunk-SFMFIWMX.js → chunk-PNWKXR6W.js} +1 -1
- package/{chunk-UEFTMQDF.js → chunk-Q4KG7LH6.js} +1 -1
- package/chunk-QB5TEFDM.js +1 -0
- package/{chunk-NPXVSAMB.js → chunk-R6JSPQYG.js} +1 -1
- package/chunk-RYDK5DLZ.js +1 -0
- package/chunk-TXDQN45R.js +8 -0
- package/chunk-UHYWK6PC.js +129 -0
- package/{chunk-EQTP2O7O.js → chunk-UJQIYFRL.js} +1 -1
- package/chunk-UKAT6MZE.js +1 -0
- package/chunk-UQIX3KIP.js +1 -0
- package/chunk-V62KSQJI.js +1 -0
- package/chunk-VIKI37CB.js +1 -0
- package/{chunk-T367AQJ2.js → chunk-VKNINE5Q.js} +1 -1
- package/chunk-WUBLGOX2.js +1 -0
- package/chunk-XVQLGYG2.js +1 -0
- package/chunk-YP2RRUG5.js +1 -0
- package/chunk-ZC3INGLB.js +1 -0
- package/index.html +2 -2
- package/main-SFIF6D5T.js +1 -0
- package/package.json +1 -1
- package/{styles-4L5CAR46.css → styles-FYY2LVCE.css} +1 -1
- package/chunk-2H7KQZEC.js +0 -8
- package/chunk-3NWFEFT2.js +0 -1
- package/chunk-4LI7GDDM.js +0 -1
- package/chunk-5FV7K5RQ.js +0 -1
- package/chunk-6GQ4PTPT.js +0 -7
- package/chunk-7OP477BS.js +0 -1
- package/chunk-7WCUKMRG.js +0 -1
- package/chunk-ACDLAA4B.js +0 -1
- package/chunk-B3VZ2ZHJ.js +0 -1
- package/chunk-BNPR5SPH.js +0 -1
- package/chunk-CVDRHTES.js +0 -1
- package/chunk-CZSVRFCL.js +0 -1
- package/chunk-DSZOROE6.js +0 -1
- package/chunk-F3RSX7TC.js +0 -1
- package/chunk-G42V3ZZU.js +0 -1
- package/chunk-H7GQCGCR.js +0 -1
- package/chunk-IDHDHBFV.js +0 -202
- package/chunk-JE4XET33.js +0 -1
- package/chunk-LCKRY7CZ.js +0 -1
- package/chunk-O76TW6JA.js +0 -1
- package/chunk-OVDG3ZBT.js +0 -1
- package/chunk-PQL4GCC5.js +0 -1
- package/chunk-RE5GBQH6.js +0 -1
- package/chunk-S2BFXF7C.js +0 -1
- package/chunk-SUXEBUIX.js +0 -1
- package/chunk-SV6BE4HG.js +0 -130
- package/chunk-TOGXYKTE.js +0 -1
- package/chunk-UI2UMYSE.js +0 -1
- package/chunk-V22QPBAO.js +0 -1
- package/chunk-VVAI7ZGN.js +0 -1
- package/chunk-W5E37PZP.js +0 -1
- package/chunk-WKHQICFW.js +0 -1
- package/chunk-WOYTUHJD.js +0 -1
- package/chunk-WPJGKTVO.js +0 -129
- package/chunk-XCTUTMD3.js +0 -1
- package/chunk-XOSALV7T.js +0 -1
- package/chunk-Y7SF5NXD.js +0 -1
- package/main-XTOQBEFQ.js +0 -1
package/chunk-2H7KQZEC.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as He,b as Ke,c as Qe,d as Xe,e as Ye,f as Ze}from"./chunk-RM5HLXNW.js";import{a as Le,b as $e,c as ze,d as Ue}from"./chunk-3UAQHNUY.js";import{a as qe,b as We}from"./chunk-E6SW7I4D.js";import{a as je}from"./chunk-KZHI6PGZ.js";import{b as Ve}from"./chunk-YPOBALKC.js";import{a as Re,b as Je}from"./chunk-B4C3ZPN6.js";import"./chunk-MHRSQRHT.js";import{a as Be,b as ke,k as Oe}from"./chunk-F6LZM7H5.js";import{a as Te,b as Me}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as we}from"./chunk-BT7Y4ADP.js";import{a as Q,b as X}from"./chunk-DJXQKSLT.js";import"./chunk-T367AQJ2.js";import{a as Ge,b as Pe}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import{a as Ne,b as De}from"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import{b as Y}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as A}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as R,b as J}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as K,o as F,w as O,x as V}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{Ha as k,b as w,c as le,e as y,f as N,j as Ie,l as D,m as W,n as Ee,o as G,u as P,w as H,x as B}from"./chunk-VMI3QWC6.js";import{b as xe,e as Se,l as ye}from"./chunk-F7PVAVLQ.js";import{a as Ae}from"./chunk-DSZOROE6.js";import{a as Fe}from"./chunk-2BI7WNJP.js";import{h as he,j as ve,k as Ce,q as _e,s as S}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as q,Eb as g,Ec as z,Fc as oe,Ha as j,L as se,Mb as p,Oc as re,Pb as L,Pc as ae,Sb as E,Sc as f,Ub as T,Vb as M,Wb as i,Xb as n,Yb as c,Z as ue,_ as I,ac as C,ca as de,fc as _,g as pe,gc as d,ia as u,ib as l,ob as ie,qa as b,ra as h,s as ce,sc as r,tc as U,uc as $,xc as fe,yb as x,yc as ge,zc as be}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var v=(()=>{class t{#e=u(Ae);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 ct=()=>({height:"calc(100vh - 100px)"});function st(t,m){if(t&1){let e=C();i(0,"div",4)(1,"a",5),r(2,"Cancel"),n(),i(3,"p-button",6),_("click",function(){b(e);let a=d();return h(a.updateAccountingIntegration())}),n()()}}function ut(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 dt(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 ft(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 gt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",7)(3,"p-tablist"),T(4,ut,2,2,"p-tab",8,E),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"div",10)(9,"h3",11),r(10,"Accounting Numbering"),n(),i(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",13)(15,"div",15)(16,"label",16),r(17,"Digit"),n(),c(18,"p-inputnumber",17),n()(),i(19,"div",13)(20,"div",15)(21,"label",18),r(22,"Seed"),n(),c(23,"p-inputnumber",19),n()(),i(24,"div",13)(25,"div",15)(26,"label",20),r(27,"Last Number"),n(),c(28,"p-inputnumber",21),n()(),i(29,"div",13)(30,"div",15)(31,"label",22),r(32,"Format"),n(),c(33,"p-select",23),n()(),i(34,"div",13)(35,"div",15)(36,"label",22),r(37,"Reset Every"),n(),i(38,"div",24),T(39,dt,4,4,"div",25,E),n()()()()()()()(),i(41,"p-tabpanel",8)(42,"div",26)(43,"div",27)(44,"h3",11),r(45,"Journal Generate"),n(),i(46,"p"),r(47,"Configure generate transaction"),n()(),i(48,"div",12)(49,"div",28)(50,"div",12)(51,"div",29)(52,"div",15)(53,"label",22),r(54,"Outlet Delivery Journal"),n(),c(55,"p-toggleswitch",30),n()(),i(56,"div",31)(57,"div",15)(58,"label",22),r(59,"Payment Discount Journal On Payment"),n(),c(60,"p-toggleswitch",32),n()()()()()(),c(61,"hr"),i(62,"div",26)(63,"div",28)(64,"div",12)(65,"div",33)(66,"label",22),r(67,"Note"),n()(),i(68,"div",29)(69,"div",15)(70,"label",22),r(71,"Note Required On Journal"),n(),c(72,"p-toggleswitch",34),n()(),i(73,"div",29)(74,"div",15)(75,"label",22),r(76,"Trial Balance Footer Visible"),n(),c(77,"p-toggleswitch",35),n()(),c(78,"div",29),n()()()(),i(79,"p-tabpanel",36)(80,"div",10)(81,"h3",11),r(82,"Report"),n(),i(83,"div",12)(84,"div",27)(85,"div",37)(86,"div")(87,"label",38),r(88,"Accounting For Treatment"),n(),i(89,"div",12)(90,"div",39)(91,"div",12),T(92,ft,5,4,"div",40,E),n()()()()()()()()()()()()),t&2){let e,o,a,s=d();L(z(8,ct)),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 tt=(()=>{class t{constructor(){this.accountingSetupService=u(v),this.fb=u(P).nonNullable,this.tabs=j(["Numbering","Journal","Report"]),this.accountingIntegration=j(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup()})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control(""),noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(I(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,st,4,0,"ng-template",null,0,f)(3,gt,94,9,"ng-template",null,1,f),n())},dependencies:[S,Ze,Ye,Xe,Qe,He,Ke,A,Y,ke,Be,B,y,N,D,G,W,F,Pe,Ge,Je,Re,ye,Se,V,O,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 ht=()=>({height:"cacl(100vh - 200px)"}),vt=()=>({height:"calc(100vh - 250px)"});function Ct(t,m){if(t&1){let e=C();i(0,"div")(1,"p-button",5),_("onClick",function(){b(e);let a=d();return h(a.submitForm())}),n()()}}function _t(t,m){t&1&&(i(0,"div",17)(1,"h3",18),r(2,"Date"),n(),c(3,"p-datePicker",19),n())}function xt(t,m){if(t&1&&(i(0,"tr",9)(1,"td",27),r(2),n(),i(3,"td"),c(4,"input",28),n(),i(5,"td"),c(6,"input",29),n()()),t&2){let e,o=m.$implicit,a=m.index,s=d(4);p("formGroupName",a),l(2),$(" ",(e=s.asFormGroup(o).get("accountName"))==null?null:e.value," ")}}function St(t,m){if(t&1&&(i(0,"div",9)(1,"h4",20),r(2),n(),i(3,"div",21)(4,"table",22)(5,"thead",23)(6,"tr")(7,"th",24),r(8,"Account Name"),n(),i(9,"th",25),r(10,"Debit"),n(),i(11,"th",25),r(12,"Credit"),n()()(),i(13,"tbody"),g(14,xt,7,2,"tr",26),n()()()()),t&2){let e=m.$implicit,o=m.$index,a=d(3);p("formGroupName",o),l(2),$(" ",e.get("name").value," "),l(12),p("ngForOf",a.getItemsArray(a.asFormGroup(e)).controls)}}function yt(t,m){if(t&1&&(i(0,"p-panel",7),g(1,_t,4,0,"ng-template",null,2,f),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",8),T(6,St,15,3,"div",9,E),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);L(z(11,ht)),p("formGroup",e.formGroups),l(4),L(z(12,vt)),l(2),M(e.formsArray.controls),l(10),$(" ",ae(17,7,e.subtotalDebit)," "),l(4),$(" ",ae(21,9,e.subtotalCredit)," ")}}function Ft(t,m){if(t&1&&g(0,yt,22,13,"p-panel",6),t&2){let e=d();p("ngIf",e.formGroups)}}var it=(()=>{class t{constructor(){this.destroy$=new pe,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=u(P),this.accSetupService=u(v),this.dayjsService=u(Ve),this.date=new Date,this.routes=u(xe)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(se(300),ue(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let o=e.map(a=>this.createItemGroup(a));return this.fb.array(o)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(ce(e=>e.data),we("response"),I(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),mt=a.controls.reduce((ee,te)=>{let ne=te.get("creditAmount").value||0;return ee+ne},0);this.subtotalDebit+=s,this.subtotalCredit+=mt})}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([k])],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"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(o,a){o&1&&(i(0,"app-main-panel",3),g(1,Ct,2,0,"ng-template",null,0,f)(3,Ft,1,1,"ng-template",null,1,f),n(),c(5,"p-toast",4)),o&2&&p("scrollable",!0)},dependencies:[A,Y,S,ve,Ce,_e,Me,Te,Oe,X,Q,H,w,y,N,F,ze,V,O,J,R,je,B,D,G,W,Ee,We,qe],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var ot=t=>({"ng-invalid ng-dirty":t});function It(t,m){if(t&1){let e=C();i(0,"p-button",4),_("onClick",function(){b(e);let a=d();return h(a.verifyCredentials())}),r(1,"Verify"),n(),i(2,"p-button",4),_("onClick",function(){b(e);let a=d();return h(a.saveCredentials())}),r(3,"Update"),n()}}function Et(t,m){t&1&&(i(0,"div",12)(1,"h3",13),r(2,"Account"),n(),i(3,"small",14),r(4,"Configure Client ID and Client Secret"),n()())}function Tt(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,Et,5,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),r(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),r(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=d();l(4),p("formGroup",e.credentialForm),l(5),p("ngClass",oe(3,ot,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),l(5),p("ngClass",oe(5,ot,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var rt=(()=>{class t{constructor(e,o){this.fb=e,this.messageService=o,this.setupService=u(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(I(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(P),ie(k))}}static{this.\u0275cmp=x({type:t,selectors:[["app-api-credential"]],features:[q([k])],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,It,4,0,"ng-template",null,0,f)(3,Tt,15,7,"ng-template",null,1,f),n())},dependencies:[S,he,B,w,y,N,D,G,F,K,J,R,A,V,O,Ue],encapsulation:2})}}return t})();function Mt(t,m){if(t&1){let e=C();i(0,"button",4),_("click",function(){b(e);let a=d();return h(a.onFormatJournal())}),r(1," Format "),n()}}function wt(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 Nt(t,m){if(t&1){let e=C();i(0,"div",5)(1,"p-panel"),g(2,wt,6,0,"ng-template",null,2,f),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),be("ngModelChange",function(a){b(e);let s=d();return ge(s.subdomain,a)||(s.subdomain=a),h(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 at=(()=>{class t{constructor(){this.setupService=u(v),this.subdomain=j(""),this.toastrService=u(Fe)}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,Mt,2,0,"ng-template",null,0,f)(3,Nt,12,1,"ng-template",null,1,f),n())},dependencies:[S,H,w,y,Ie,F,K,A,J,R,$e,Le],encapsulation:2})}}return t})();var lt=()=>u(v).fetchOpeningBalanceFormConfiguration();var di=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"journal-tag",loadComponent:()=>import("./chunk-WKHQICFW.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-XOSALV7T.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-VVAI7ZGN.js").then(t=>t.JournalTagFormComponent)},{path:"accounting-integration",component:tt},{path:"opening-balance-form",component:it,resolve:{data:lt}},{path:"api-crendetial",component:rt},{path:"format-journal",component:at},{path:"closing-entries",loadComponent:()=>import("./chunk-B3VZ2ZHJ.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-H7GQCGCR.js").then(t=>t.ClosingFormComponent)}]}];export{di as ACCOUNTING_SETUP_ROUTES};
|
package/chunk-3NWFEFT2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as re}from"./chunk-G4XX7EU2.js";import{a as ut}from"./chunk-KZHI6PGZ.js";import{a as dt,b as gt}from"./chunk-UVSR4LPB.js";import{a as Ke}from"./chunk-F3RSX7TC.js";import{a as Rt,b as pt}from"./chunk-YPOBALKC.js";import{a as mt}from"./chunk-XKI7WLHE.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import{a as st,b as ct}from"./chunk-PGOSR3RI.js";import{a as et}from"./chunk-6WWXJJID.js";import"./chunk-U2VDC52W.js";import{a as ne,b as ie}from"./chunk-3VQUNDVT.js";import{b as ot,d as Me,i as at,j as lt,k as ke}from"./chunk-F6LZM7H5.js";import{a as it,b as rt}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as Ve}from"./chunk-BT7Y4ADP.js";import{a as ye,b as Re}from"./chunk-DJXQKSLT.js";import"./chunk-T367AQJ2.js";import{a as Pe,b as De}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import{b as Q}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{f as nt,i as L}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as N,b as A}from"./chunk-AD247LWQ.js";import{b as T,c as Ie,d as tt,e as Te,f as we,g as Fe}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as Se,o as Ce,w as Y,x as J}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as xe,c as K,e as X,f as _e,i as Xe,j as Ye,k as he,l as Ee,o as ve,u as Je,v as Qe,w as Ze,x as be}from"./chunk-VMI3QWC6.js";import{b as de,d as ge,e as k,l as V}from"./chunk-F7PVAVLQ.js";import{a as fe}from"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{h as We,k as D,p as ue,q as W,s as M}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as ze,Dc as me,Eb as h,Ec as $e,Fc as C,Ha as q,J as Oe,Mb as m,Oc as S,Pc as F,Qc as U,Rb as Ge,Sb as G,Sc as x,Ub as H,Vb as $,Wb as r,Xb as n,Y as O,Yb as d,_ as w,ac as y,bd as te,c as ee,ca as le,fc as R,gc as g,ia as u,ib as l,qa as v,ra as b,s as z,sc as a,tc as E,ua as qe,uc as I,wc as He,xa as Ue,xc as pe,yb as P,yc as se,zc as ce}from"./chunk-6QJHEOXN.js";import{a as f,b as _,e as yt}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{#e=u(fe);#t=u(Ke);getRecurringExpenseLoader(){return this.#e.get(void 0,"api/RecurringExpenseLoader/GetList")}getRecurringExpenses(e){return this.#e.post(void 0,"api/RecurringExpense/GetList",e)}fetchRecurringExpenseForm(e){return this.#e.get(void 0,`api/RecurringExpense/form/${e??""}`)}fetchSupplierSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",o)}fetchCustomerSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",o)}submitRecurringExpense(e,o={}){return this.#e.post(void 0,"api/RecurringExpense/submit",e,o)}removeRecurringExpense(e){return this.#e.delete(void 0,`api/RecurringExpense/${e}`,void 0)}removeRecurringExpenses(e){let o={body:e};return this.#e.delete(void 0,"api/RecurringExpense/Batch",o)}getRecurringExpenseByID(e){return this.#e.get(void 0,`api/RecurringExpense/Info/${e}`)}getAssetValueList(){return this.#e.get(void 0,"api/AssetValue/GetListt")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var It={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{text:null,Frequency:0,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Ne=Ie(Fe(It),tt(t=>({first:te(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:te(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:te(()=>t.data().data.some(c=>c.checked)),checkedInvoice:te(()=>t.data().data.filter(c=>c.checked).map(c=>c.id))})),we(t=>{let c=u(B);return{updateFilter(o){T(t,i=>_(f({},i),{filter:f(f({},i.filter),o)}))},onRowSelect(o){T(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!0}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onRowUnselect(o){T(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!1}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onHeaderCheckboxToggle(o){T(t,i=>{let s=i.data.data.map(p=>_(f({},p),{checked:o}));return _(f({},i),{data:_(f({},i.data),{data:s})})})},getRecurringExpenseLoader:ne(ee(O(()=>c.getRecurringExpenseLoader().pipe(ie({next:o=>{T(t,i=>_(f({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ne(ee(z(o=>Object.entries(o).reduce((i,[s,p])=>(p!=null&&(i[s]=p),i),{})),O(o=>c.getRecurringExpenses(o).pipe(ie({next:i=>{T(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),Te(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var Ft=["class","page"],Pt=t=>["details/",t];function Dt(t,c){if(t&1){let e=y();r(0,"p-button",12),R("onClick",function(){v(e);let i=g(2);return b(i.onDeleteSelected())}),n()}}function Mt(t,c){if(t&1&&(r(0,"div",8),h(1,Dt,1,0,"p-button",9),r(2,"a",10),d(3,"i",11),r(4,"span"),a(5,"Add"),n()()()),t&2){let e=g();l(),m("ngIf",e.store.hasCheckedRows())}}function kt(t,c){t&1&&(r(0,"tr")(1,"th"),d(2,"p-tableHeaderCheckbox"),n(),r(3,"th"),a(4,"Outlet"),n(),r(5,"th"),a(6,"Name"),n(),r(7,"th"),a(8,"Expense Account"),n(),r(9,"th"),a(10,"Start Date"),n(),r(11,"th"),a(12,"End Date"),n(),r(13,"th"),a(14,"Last Expense"),n(),r(15,"th"),a(16,"Amount"),n(),r(17,"th"),a(18,"Frequency"),n()())}function Vt(t,c){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",14),n(),r(3,"td"),a(4),n(),r(5,"td")(6,"a",15),a(7),n()(),r(8,"td"),a(9),n(),r(10,"td"),a(11),S(12,"date"),n(),r(13,"td"),a(14),S(15,"date"),n(),r(16,"td"),a(17),S(18,"date"),n(),r(19,"td"),a(20),S(21,"number"),n(),r(22,"td"),a(23),n()()),t&2){let e=c.$implicit;l(2),m("value",e),l(2),E(e.outletName),l(2),m("routerLink",C(21,Pt,e.id)),l(),E(e.name),l(2),E(e.expenseName),l(2),E(U(12,10,e.startDate,"d MMM y")),l(3),E(U(15,13,e.endDate,"d MMM y")),l(3),E(U(18,16,e.lastExpenseDate,"d MMM y")),l(3),E(F(21,19,e.amount)),l(3),E(e.repeatTypeLabel)}}function Nt(t,c){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=g(2);l(),He(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function At(t,c){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Lt(t,c){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",13),R("onPage",function(i){v(e);let s=g();return b(s.onPageChange(i))})("onHeaderCheckboxToggle",function(i){v(e);let s=g();return b(s.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){v(e);let s=g();return b(s.onRowSelect(i))})("onRowUnselect",function(i){v(e);let s=g();return b(s.onRowUnselect(i))}),h(2,kt,19,0,"ng-template",null,3,x)(4,Vt,24,23,"ng-template",null,4,x)(6,Nt,2,3,"ng-template",null,5,x)(8,At,4,0,"ng-template",null,6,x),n()()}if(t&2){let e=g();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function Bt(t,c){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),d(4,"p-select",20),n()()),t&2){let e=g();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var _t=(()=>{class t extends mt{constructor(){super(...arguments),this.store=u(Ne),this.recurringExpenseService=u(B),this.fb=u(Je),this.isDialogFilterVisible=q(!1)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(w(()=>{this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(f({},this.store.filter()),{text:e}))}onFilterEvent(){this.onSubmitFilterDialog()}onSubmitFilterDialog(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((o,[i,s])=>(s!=null&&(o[i]=s),o),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(o=>!o)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}initForm(){let{text:e,Frequency:o,pageNumber:i,pageSize:s,export:p,exportPageNumber:j,exportPageSize:Ct}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),pageSize:this.fb.control(s),export:this.fb.control(p),exportPageNumber:this.fb.control(j),exportPageSize:this.fb.control(Ct)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=qe(t)))(i||t)}})()}static{this.\u0275cmp=P({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[me([Ne]),ze],attrs:Ft,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Recurring Expenses",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[3,"value"],[1,"link-primary",3,"routerLink"],["colspan","9"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","Frequency","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Type",3,"options"]],template:function(o,i){if(o&1){let s=y();r(0,"app-main-panel",7),R("search",function(j){return v(s),b(i.onSearchEvent(j))}),ce("isDialogFilterVisibleChange",function(j){return v(s),se(i.isDialogFilterVisible,j)||(i.isDialogFilterVisible=j),b(j)}),R("filterConfirmed",function(){return v(s),b(i.onFilterEvent())}),h(1,Mt,6,1,"ng-template",null,0,x)(3,Lt,10,5,"ng-template",null,1,x)(5,Bt,5,2,"ng-template",null,2,x),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),pe("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[L,k,Q,ke,Me,at,lt,M,D,W,ue,V,nt,De,Pe,J,Y,be,he,X,_e,Ee,ve,A,N],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Z=yt(Rt());var qt=["class","page"],Ut=()=>["/pages/recurring/recurring-expense"],ae=t=>({"ng-dirty ng-invalid":t});function zt(t,c){if(t&1){let e=y();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),R("click",function(){v(e);let i=g();return b(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",$e(1,Ut)))}function Gt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Ht(t,c){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=c.$implicit;l(2),I(" ",e.name," ")}}function $t(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Wt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Kt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Xt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Yt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Jt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Qt(t,c){if(t&1){let e=y();r(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-scroll-panel")(4,"div",12)(5,"div",13)(6,"form",14)(7,"div",15)(8,"div",13)(9,"div",16)(10,"label",17),a(11,"Name"),n(),d(12,"input",18),r(13,"div"),H(14,Gt,2,1,"small",19,G),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Outlet"),n(),r(21,"p-select",21),h(22,Ht,3,1,"ng-template",null,3,x),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),R("completeMethod",function(i){v(e);let s=g(2);return b(s.searchContact(i))}),n()(),r(30,"div"),H(31,$t,2,1,"small",19,G),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),d(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),d(42,"p-datepicker",24),n()(),d(43,"div",25),n(),d(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),d(50,"input",26),r(51,"div"),H(52,Wt,2,1,"small",19,G),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),d(58,"p-select",27),n()(),r(59,"div",20)(60,"div",16)(61,"label",17),a(62,"Expense (Debit)"),n(),r(63,"p-select",28),h(64,Kt,6,2,"ng-template",null,3,x),n()(),r(66,"div"),H(67,Xt,2,1,"small",19,G),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),h(74,Yt,6,2,"ng-template",null,3,x),n()(),r(76,"div"),H(77,Jt,2,1,"small",19,G),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),d(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,s,p=g(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",C(16,ae,p.isInvalid("name"))),l(2),$(p.getErrors("name")),l(7),m("options",(e=p.recurringExpenseData())==null||e.options==null?null:e.options.entities),l(8),m("showClear",!0)("ngClass",C(18,ae,p.isInvalid("contact")))("suggestions",p.customerSupplierSuggestions()),l(2),$(p.getErrors("contact")),l(6),m("iconDisplay","input")("showIcon",!0),l(5),m("iconDisplay","input")("showIcon",!0),l(8),m("ngClass",C(20,ae,p.isInvalid("amount"))),l(2),$(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses)("ngClass",C(22,ae,p.isInvalid("expenseAccountID"))),l(4),$(p.getErrors("expenseAccountID")),l(6),m("ngClass",C(24,ae,p.isInvalid("paymentAccountID")))("options",(s=p.recurringExpenseData())==null||s.options==null?null:s.options.assets),l(4),$(p.getErrors("paymentAccountID"))}}function Zt(t,c){if(t&1&&h(0,Qt,84,26,"div",8),t&2){let e=g();m("ngIf",e.recurringExpenseData())}}var Be=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.fb=u(Qe),this.destroyRef=u(Ue),this.route=u(de),this.recurringExpenseData=q(null),this.customerSupplierSuggestions=q([]),this.router=u(ge),this.contactType=new Xe(0),this.dayjsService=u(pt)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[K.required]),repeatTypeID:this.fb.control(1,[K.required]),startDate:this.fb.control((0,Z.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[K.required]),paymentAccountID:this.fb.control(null,[K.required]),expenseAccountID:this.fb.control(null,[K.required]),contact:this.fb.control("",[]),description:this.fb.control(""),repeatTypeLabel:this.fb.control(""),outletID:this.fb.control(""),creatorID:this.fb.control(""),created:this.fb.control(""),modifierID:this.fb.control(""),modified:this.fb.control("")})}fetchRecurringExpenseForm(){this.route.paramMap.pipe(z(e=>e.get("id")),O(e=>e?this.recurringExpenseService.fetchRecurringExpenseForm(e):this.recurringExpenseService.fetchRecurringExpenseForm()),w(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"startDate":i[s]=(0,Z.default)(p).isSame((0,Z.default)("0001-01-01T00:00:00"))?(0,Z.default)().toDate():(0,Z.default)(p).toDate();break;case"repeatTypeID":i[s]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[s]=p===re?null:p;break;case"expenseAccountID":i[s]=p===re?null:p;break;default:i[s]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(w(this.customerSupplierSuggestions.set)).subscribe()}onSubmit(){let e=this.recurringExpenseForm.value;if(this.recurringExpenseForm.invalid){this.recurringExpenseForm.markAllAsTouched();return}let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"amount":i[s]=+p;break;case"startDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"contact":typeof p=="string"?i.contactID=p:typeof p=="object"&&p!==null?i.contactID=p&&Object.prototype.hasOwnProperty.call(p,"Key")?p.Key:p:i.contactID=re;break;default:i[s]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(w(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}isInvalid(e){let o=this.recurringExpenseForm.controls[e];return o.invalid&&(o.dirty||o.touched)}getErrors(e){if(!this.isInvalid(e))return null;let o=this.recurringExpenseForm.controls[e];if(!o.errors)return null;let i=[];for(let[s,p]of Object.entries(o.errors))switch(s){case"required":i.push("This field is required.");break;case"minlength":i.push(`Minimum length is ${p.requiredLength} characters.`);break;case"maxlength":i.push(`Maximum length is ${p.requiredLength} characters.`);break;case"email":i.push("Please enter a valid email address.");break;case"pattern":i.push("The format is invalid.");break;case"min":i.push(`Minimum value is ${p.min}.`);break;case"max":i.push(`Maximum value is ${p.max}.`);break;default:i.push("Invalid value.")}return i}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:qt,decls:5,vars:2,consts:[["actionButton",""],["content",""],["outlet",""],["item",""],["pageTitle","Recurring Expense Form",3,"hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit","icon","fa-solid fa-plus",3,"click"],["class","row justify-content-center",4,"ngIf"],[1,"row","justify-content-center"],[1,"col-6"],[1,"h-100","d-flex"],[1,"row","justify-content-center","h-100"],[1,"col-12"],[1,"d-flex","flex-column","row-gap-2",3,"formGroup"],[1,"row","row-gap-2"],[1,"d-flex","flex-column"],["for",""],["formControlName","name","type","text","pInputText","",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["filter","","filterBy","name","appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["formControlName","contact","inputStyleClass","w-100","styleClass","w-100","optionLabel","Value","optionValue","Key",3,"completeMethod","showClear","ngClass","suggestions"],["dateFormat","mm/dd/yy","appendTo","body","formControlName","startDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],["appendTo","body","formControlName","endDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"col"],["formControlName","amount","type","text","appMaskNumber","","pInputText","",3,"ngClass"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense","filter","","filterBy","code,value",3,"options","ngClass"],["appendTo","body","formControlName","paymentAccountID","optionLabel","value","optionValue","key","filter","","filterBy","code,value","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["formControlName","description","rows","3","cols","30","pTextarea",""],[1,"flex","items-center","gap-2"],[1,"text-truncate","d-inline-block",2,"max-width","250px"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,zt,4,2,"ng-template",null,0,x)(3,Zt,1,1,"ng-template",null,1,x),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[L,Q,Ce,Se,De,Pe,rt,it,gt,dt,ct,st,Re,ye,M,We,D,be,he,xe,X,_e,Ee,ve,V,k,J,Y,ut,A,N,ot],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var en=["class","page"],tn=t=>["/pages/recurring/recurring-expense/edit",t];function nn(t,c){if(t&1&&(r(0,"a",7),d(1,"i",8),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=g(4);m("routerLink",C(1,tn,e.currentRecurringExpense().id))}}function rn(t,c){if(t&1){let e=y();r(0,"p-button",9),R("onClick",function(){v(e);let i=g(4);return b(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function on(t,c){if(t&1&&(r(0,"div",4),h(1,nn,4,3,"a",5)(2,rn,1,0,"p-button",6),n()),t&2){let e=g(3);l(),m("ngIf",e.roleService.setup().recurring),l(),m("ngIf",e.roleService.setup().recurring)}}function an(t,c){if(t&1&&h(0,on,3,2,"div",3),t&2){let e=g(2);m("ngIf",e.currentRecurringExpense())}}function ln(t,c){if(t&1){let e=y();r(0,"p-panel",13)(1,"p-scroll-panel")(2,"div",10)(3,"div",14)(4,"div",15)(5,"div",14)(6,"div",16)(7,"div",17)(8,"div",18)(9,"label",19),a(10,"Outlet"),n(),r(11,"input",20),ce("ngModelChange",function(i){v(e);let s=g(3);return se(s.currentRecurringExpense().outletName,i)||(s.currentRecurringExpense().outletName=i),b(i)}),n()()(),r(12,"div",17)(13,"div",18)(14,"label",19),a(15,"Supplier"),n(),d(16,"input",21),n()(),r(17,"div",17)(18,"div",18)(19,"label",19),a(20,"From"),n(),d(21,"input",22),S(22,"date"),n()(),r(23,"div",17)(24,"div",18)(25,"label",19),a(26,"To"),n(),d(27,"input",22),S(28,"date"),n()()(),d(29,"hr"),r(30,"div",16)(31,"div",17)(32,"div",18)(33,"label",19),a(34,"Amount"),n(),d(35,"input",22),S(36,"number"),n()(),r(37,"div",17)(38,"div",18)(39,"label",19),a(40,"Frequency"),n(),d(41,"input",22),n()(),r(42,"div",17)(43,"div",18)(44,"label",19),a(45,"Expense (Debit)"),n(),d(46,"input",22),n()(),r(47,"div",17)(48,"div",18)(49,"label",19),a(50,"Payment (Credit)"),n(),d(51,"input",22),n()(),r(52,"div",23)(53,"div",18)(54,"label",19),a(55,"Description"),n(),d(56,"textarea",24),n()()()()()()()()()}if(t&2){let e=g(3);l(11),pe("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",U(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",U(28,12,e.currentRecurringExpense().endDate,"d MMM y")),l(8),m("value",F(36,15,e.currentRecurringExpense().amount)),l(6),m("value",e.currentRecurringExpense().repeatTypeLabel),l(5),m("value",e.currentRecurringExpense().expenseName),l(5),m("value",e.currentRecurringExpense().paymentName),l(5),m("value",e.currentRecurringExpense().description)}}function pn(t,c){if(t&1&&(r(0,"div",10)(1,"div",11),h(2,ln,57,17,"p-panel",12),n()()),t&2){let e=g(2);l(2),m("ngIf",e.currentRecurringExpense())}}function sn(t,c){if(t&1&&(r(0,"app-main-panel",2),h(1,an,1,1,"ng-template",null,0,x)(3,pn,3,1,"ng-template",null,1,x),n()),t&2){let e=g();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var Et=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.route=u(de),this.router=u(ge),this.currentRecurringExpense=q(null),this.roleService=u(et)}ngOnInit(){this.route.paramMap.pipe(z(e=>e.get("id")),Ve("params"),Oe(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),w(e=>this.currentRecurringExpense.set(e)),Ve("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(w(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:en,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["class","p-button p-button-outlined p-button-secondary d-flex gap-2 align-items-center",3,"routerLink",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],[1,"row","justify-content-center"],[1,"col-6"],["class","h-100 d-flex",4,"ngIf"],[1,"h-100","d-flex"],[1,"col"],[1,"row"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["readonly","","type","text","pInputText","",3,"ngModelChange","ngModel"],["type","text","readonly","","pInputText","",3,"value"],["readonly","","type","text","pInputText","",3,"value"],[1,"col","col-lg-12"],["readonly","","rows","5","cols","30","pTextarea","",3,"value"]],template:function(o,i){o&1&&h(0,sn,5,3,"app-main-panel",2),o&2&&Ge(i.currentRecurringExpense()?0:-1)},dependencies:[L,Q,M,D,W,ue,Ce,Se,Ze,xe,X,Ye,J,Y,V,k,A,N,Re,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vt=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:_t},{path:"create",component:Be},{path:"details/:id",component:Et},{path:"edit/:id",component:Be}]}];var bt=(()=>{class t{constructor(){this.httpService=u(fe)}getAssetValue(e){return this.httpService.post(void 0,"/api/AssetValue/GetList",e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var cn={filter:{Text:"",Frequency:0,PageNumber:1,PageSize:10},data:null},je=Ie(Fe(cn),we(t=>{let c=u(bt);return{getAssetValue:ne(ee(O(o=>c.getAssetValue(o).pipe(ie({next:i=>{T(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{T(t,i=>_(f({},i),{filter:o}))}}}),Te({onInit:t=>{t.getAssetValue(t.filter())}}));var mn=t=>["/pages/recurring/recurring-expense/details/",t];function un(t,c){t&1&&d(0,"div",5)}function dn(t,c){t&1&&(r(0,"tr")(1,"th"),a(2,"Outlet"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",8),a(8,"Price on Purchase"),n(),r(9,"th",8),a(10,"Accomulated Depreciation"),n(),r(11,"th",8),a(12,"Book Value"),n(),r(13,"th",8),a(14,"Frequency"),n()())}function gn(t,c){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",9),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",8),a(9),S(10,"number"),n(),r(11,"td",8),a(12),S(13,"number"),n(),r(14,"td",8),a(15),S(16,"number"),n(),r(17,"td",8),a(18),S(19,"number"),n()()),t&2){let e=c.$implicit;l(2),E(e.entityName),l(2),m("routerLink",C(16,mn,e.id)),l(),E(e.name),l(2),E(e.accountCode),l(2),E(F(10,8,e.priceOnPurchase)),l(3),I(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),I(" ",F(16,12,e.bookValue)," "),l(3),I(" ",F(19,14,e.depreciationPerYear)," ")}}function fn(t,c){if(t&1&&(r(0,"p-panel")(1,"p-table",7),h(2,dn,15,0,"ng-template",null,2,x)(4,gn,20,18,"ng-template",null,3,x),n()()),t&2){let e=g(2);l(),m("value",e.store.data().data)("rows",e.store.filter().PageSize)("totalRecords",e.store.data().count)}}function xn(t,c){if(t&1&&h(0,fn,6,3,"p-panel",6),t&2){let e=g();m("ngIf",e.store.data())}}var St=(()=>{class t{constructor(){this.store=u(je)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-asset-value"]],features:[me([je])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],[4,"ngIf"],["styleClass","h-100","dataKey","id",1,"",3,"value","rows","totalRecords"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,un,1,0,"ng-template",null,0,x)(3,xn,1,1,"ng-template",null,1,x),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[L,M,D,W,A,N,ke,Me,V,k],encapsulation:2})}}return t})();var mr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:vt},{path:"asset-value",component:St},{path:"post-to-journal",loadComponent:()=>import("./chunk-LCKRY7CZ.js").then(t=>t.PostRecurringExpenseComponent)}];export{mr as RECURRING_ROUTES};
|
package/chunk-4LI7GDDM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-ZQWFATZY.js";import"./chunk-YPOBALKC.js";import{a as I,b as E}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as H}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as R,b as D}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as V,x as j,y as N,z as G}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-DSZOROE6.js";import{a as F}from"./chunk-2BI7WNJP.js";import{n as w,s as $}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as P,Eb as B,Ec as C,Mb as p,Oc as c,Pb as h,Pc as s,Sc as x,W as T,Wb as n,Xb as o,Y as M,Yb as m,_ as S,ac as O,fc as _,gc as l,h as y,ia as f,ib as a,qa as g,ra as d,s as u,sa as b,ta as k,yb as A}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=O();n(0,"div",3)(1,"p-button",4),_("onClick",function(){g(t);let r=l();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),_("onClick",function(){g(t);let r=l();return d(r.onMigrateOutletAccount())}),o()()}if(i&2){let t=l();a(2),p("disabled",s(3,2,t.countInBooks$)!==0)("pTooltip",s(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),m(3,"app-migration-cards",7),c(4,"async"),b(),n(5,"svg",8),m(6,"path",9),o(),k(),m(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let t=l();h(C(12,q)),a(),h(C(13,q)),a(2),p("migrationCount",s(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",s(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var ut=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new y(void 0),this.pageTitle="Outlet Account"}ngOnInit(){let t=this.refresh$.pipe(M(()=>this.migrateService.getOutletAccountCount()),S(e=>console.log("API response:",e)),T(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateOutletAccount(){this.migrateService.migrateOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormat(){confirm("Are you sure you want to format?")&&this.migrateService.formatOutletAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=A({type:i,selectors:[["app-outlet-account"]],features:[P([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(n(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),o()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,w,j,V,E,I,D,R,G,N,L],encapsulation:2})}}return i})();export{ut as OutletAccountComponent};
|
package/chunk-5FV7K5RQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-2JNXKEYZ.js";import{a as Me}from"./chunk-KZHI6PGZ.js";import{a as ne}from"./chunk-F3RSX7TC.js";import{b as Ne}from"./chunk-YPOBALKC.js";import{a as Re}from"./chunk-XKI7WLHE.js";import"./chunk-U2VDC52W.js";import{a as M,b as P}from"./chunk-3VQUNDVT.js";import{d as Ve,i as Je,j as De,k as ke}from"./chunk-F6LZM7H5.js";import{a as Ee,b as Ie}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import"./chunk-T367AQJ2.js";import{a as Ae,b as Fe}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as Te}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as ge,b as he}from"./chunk-AD247LWQ.js";import{a as Se,b as w,c as Ce,d as ve,e as we,f as ye,g as je}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as ue,o as ce,w as fe,x as _e,y as xe,z as be}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as oe,e as re,f as ae,k as le,l as me,o as pe,u as se,x as de}from"./chunk-VMI3QWC6.js";import"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{h as X,j as Y,k as Z,p as ee,q as te,s as ie}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as L,Dc as Q,Eb as g,Fc as E,Ha as D,Mb as s,Oc as I,Pc as $,Qc as R,Sc as C,Wb as a,Xb as r,Y as J,Yb as b,_ as H,ac as j,bd as y,c as F,db as B,eb as G,fc as T,gc as f,ia as v,ib as m,qa as h,ra as x,s as V,sc as p,tc as S,uc as k,wc as W,xc as K,yb as U,yc as N,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as c}from"./chunk-YQFG5XE2.js";var Oe={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,outletName:""}},z=Ce(je(Oe),ve(t=>({first:y(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:y(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:y(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:y(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),ye(t=>{let l=v(A);return{updateFilter(n){w(t,i=>c(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){w(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!0}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onRowUnselect(n){w(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!1}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){w(t,i=>{let o=i.data.data.map(u=>c(d({},u),{checked:n}));return c(d({},i),{data:c(d({},i.data),{data:o})})})},getGJAdjustmentLoader:M(F(J(()=>l.getGJAdjustmentLoader().pipe(P({next:n=>{w(t,i=>c(d({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:M(F(V(n=>Object.entries(n).reduce((i,[o,u])=>(u!=null&&(i[o]=u),i),{})),J(n=>l.getAdjustmentJournal(n).pipe(V(i=>c(d({},i),{data:i.data.map(o=>c(d({},o),{checked:!1}))})),P({next:i=>{w(t,o=>c(d({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),we(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t});function He(t,l){if(t&1){let e=j();a(0,"p-button",10),T("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function Be(t,l){if(t&1&&g(0,He,1,0,"p-button",9),t&2){let e=f();s("ngIf",e.store.hasCheckedRows())}}function Ge(t,l){t&1&&(a(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),p(4,"Outlet"),r(),a(5,"th",14),p(6,"Number"),r(),a(7,"th",15),p(8,"Date"),r(),a(9,"th",14),p(10,"Adjustment Qty"),r(),a(11,"th",13),p(12,"Type"),r(),a(13,"th",16),p(14,"State"),r(),a(15,"th",17),p(16,"Note"),r(),b(17,"th",18),r())}function Ue(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",20),p(7),r()(),a(8,"td"),p(9),I(10,"date"),r(),a(11,"td"),p(12),I(13,"number"),r(),a(14,"td"),p(15),r(),a(16,"td"),p(17),r(),a(18,"td"),b(19,"div",21),r(),a(20,"td"),b(21,"p-button",22),r()()),t&2){let e=l.$implicit,n=f(2);m(2),s("value",e),m(2),S(e.outlet),m(2),s("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,G),m(),k(" ",e.number," "),m(2),S(R(10,12,e.date,"d MMM y")),m(3),S($(13,15,e.quantitySUM)),m(3),S(e.type),m(2),S(e.state),m(2),s("innerHTML",e.note,B),m(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Le(t,l){if(t&1&&p(0),t&2){let e=f(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function We(t,l){t&1&&(a(0,"tr")(1,"td",23)(2,"span"),p(3,"No records found."),r()()())}function Ke(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),T("onRowSelect",function(i){h(e);let o=f();return x(o.onRowSelect(i))})("onRowUnselect",function(i){h(e);let o=f();return x(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){h(e);let o=f();return x(o.onHeaderCheckboxToggle(i))})("onPage",function(i){h(e);let o=f();return x(o.onPageChange(i))}),g(2,Ge,18,0,"ng-template",null,3,C)(4,Ue,22,17,"ng-template",null,4,C)(6,Le,1,3,"ng-template",null,5,C)(8,We,4,0,"ng-template",null,6,C),r()()}if(t&2){let e=f();m(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function qe(t,l){if(t&1&&(a(0,"span",33),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;s("pTooltip",e.name),m(),k(" ",R(2,2,e.name,30)," ")}}function Qe(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function $e(t,l){if(t&1&&(a(0,"div"),g(1,Qe,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("from"))}}function Xe(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function Ye(t,l){if(t&1&&(a(0,"div"),g(1,Xe,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("to"))}}function Ze(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),S(e)}}function et(t,l){if(t&1&&(a(0,"div"),g(1,Ze,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("pageSize"))}}function tt(t,l){if(t&1&&(a(0,"form",24)(1,"div",25)(2,"label",26),p(3,"Outlet"),r(),a(4,"p-select",27),g(5,qe,3,5,"ng-template",null,7,C),r()(),a(7,"div",25)(8,"label",26),p(9,"From - To"),r(),a(10,"div",28),b(11,"p-datepicker",29),g(12,$e,2,1,"div",30),b(13,"p-datepicker",31),g(14,Ye,2,1,"div",30),r()(),a(15,"div",25)(16,"label",26),p(17,"Page Size"),r(),b(18,"input",32),g(19,et,2,1,"div",30),r()()),t&2){let e=f();s("formGroup",e.form),m(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),s("iconDisplay","input")("showIcon",!0)("ngClass",E(13,O,e.isInvalid("from"))),m(),s("ngIf",e.isInvalid("from")),m(),s("iconDisplay","input")("showIcon",!0)("ngClass",E(15,O,e.isInvalid("to"))),m(),s("ngIf",e.isInvalid("to")),m(4),s("ngClass",E(17,O,e.isInvalid("pageSize"))),m(),s("ngIf",e.isInvalid("pageSize"))}}var Ht=(()=>{class t extends Re{constructor(){super(),this.store=v(z),this.generateJournalService=v(A),this.authService=v(ne),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=v(se),this.dayjsService=v(Ne)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,pageSize:u,export:_,exportPageNumber:Pe,exportPageSize:ze}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),pageSize:this.fb.control(u),export:this.fb.control(_),exportPageNumber:this.fb.control(Pe),exportPageSize:this.fb.control(ze)})}onSearch(e){this.store.updateFilter(c(d({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(d({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(H(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-adjustment-journal"]],features:[Q([z]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=j();a(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),T("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,Be,1,1,"ng-template",null,0,C)(3,Ke,10,5,"ng-template",null,1,C)(5,tt,20,19,"ng-template",null,2,C),r()}n&2&&(s("isSearchableInput",!0)("isFilterable",!0),K("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Te,ke,Ve,Je,De,ie,X,Y,Z,te,ee,he,ge,_e,fe,Ie,Ee,Fe,Ae,de,le,oe,re,ae,me,pe,ce,ue,Se,be,xe,Me],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Ht as AdjustmentJournalComponent};
|
package/chunk-6GQ4PTPT.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as pt}from"./chunk-FQRRGJBE.js";import{a as De,b as Re}from"./chunk-UVSR4LPB.js";import{a as Se}from"./chunk-F3RSX7TC.js";import{a as Ht,b as ce}from"./chunk-YPOBALKC.js";import{b as rt}from"./chunk-B4C3ZPN6.js";import{b as Wt,c as at,d as lt}from"./chunk-LXLOWSN6.js";import{a as de,b as ue}from"./chunk-RXR5DXWS.js";import"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import{a as oe}from"./chunk-6WWXJJID.js";import"./chunk-U2VDC52W.js";import{a as Ie,b as we}from"./chunk-3VQUNDVT.js";import{a as it,b as nt,d as me,k as se}from"./chunk-F6LZM7H5.js";import{a as le,b as pe}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as ot}from"./chunk-NNNKDAA2.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{b as Ee}from"./chunk-DJXQKSLT.js";import"./chunk-T367AQJ2.js";import{a as qt,b as Te}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import{d as Ue}from"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import{b as ae}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{e as et,f as tt,i as re}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as $e,b as ne}from"./chunk-AD247LWQ.js";import{b as O,c as Ye,d as Xe,e as Je,f as Qe,g as Ze}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as Ot,o as Ke,w as te,x as ie,y as jt,z as zt}from"./chunk-ME4ALIS7.js";import{b as ye}from"./chunk-DTYVTTET.js";import{b as At,c as Gt,e as Y,f as X,g as Pt,i as st,k as J,l as Q,o as Z,u as ve,x as ee}from"./chunk-VMI3QWC6.js";import{b as He,e as U,l as $}from"./chunk-F7PVAVLQ.js";import{a as Bt,b as Ce}from"./chunk-DSZOROE6.js";import{a as We}from"./chunk-2BI7WNJP.js";import{A as Nt,h as ze,k as H,p as qe,q as W,s as K,z as kt}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Ac as Vt,Bc as mt,Cc as _e,D as Ae,Dc as Oe,Eb as g,Ec as L,Fc as F,Gc as Mt,Ha as E,Hc as je,Mb as s,Oc as S,Pb as Pe,Pc as y,Qc as ke,Rb as M,Sb as Fe,Sc as _,Ub as Le,Vb as Ve,W as Dt,Wb as o,X as Rt,Xb as r,Y as be,Yb as w,Zb as z,_ as V,_b as q,ac as D,bd as R,c as he,ca as Ft,cd as fe,db as j,eb as Ge,fc as I,gc as c,ia as C,ib as p,jc as Lt,qa as h,ra as b,s as Be,sc as a,tc as x,uc as T,vc as Me,xc as A,yb as N,yc as B,zc as P}from"./chunk-6QJHEOXN.js";import{a as f,b as v,c as xe,e as Tt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=C(Bt),this.authService=C(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/GetGeneralLedgerCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetGeneralLedger":"GetMultiLedger"}`,e)}exportGeneralLedger(e,n={}){let i=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetMultiLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new Nt({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),l=new kt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=f({params:i,headers: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",f({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var oi=()=>({width:"30vw"}),ri=()=>({"1199px":"75vw","575px":"90vw"}),ai=t=>({"ng-dirty ng-invalid":t}),li=t=>["/pages/journal/journal-entry/",t],pi=t=>({"text-success":t}),mi=t=>({"text-danger":t});function si(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),T("(",e.code,")"),p(6),x(e.name)}}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),T("(",e.code,")"),p(6),x(e.name)}}function di(t,m){t&1&&(o(0,"div",37),a(1," Account is required. "),r())}function ui(t,m){if(t&1&&(o(0,"div",38)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function _i(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),w(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(),x(e.value)}}function fi(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 gi(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 xi(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 hi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),a(3,"Accounts"),r(),o(4,"p-select",18),g(5,si,10,2,"ng-template",null,5,_)(7,ci,10,2,"ng-template",null,6,_),r(),g(9,di,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),a(12,"From"),r(),o(13,"div",20),w(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),g(20,ui,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),a(24,"Contact Type"),r(),o(25,"div",25),Le(26,_i,5,4,"div",26,Fe),r()(),g(28,fi,4,1,"div",16)(29,gi,4,1,"div",16)(30,xi,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),w(37,"p-radiobutton",28),o(38,"label",29),a(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),w(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",F(14,ai,((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 bi(t,m){if(t&1&&g(0,hi,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 Si(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),a(2,"Return to Accounts"),r(),g(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function vi(t,m){t&1&&w(0,"div",52)}function yi(t,m){t&1&&(o(0,"tr")(1,"th",53),a(2,"Outlet"),r(),o(3,"th",54),a(4,"No."),r(),o(5,"th",55),a(6,"Date"),r(),o(7,"th",56),a(8,"Contact / Note"),r(),o(9,"th",57),a(10,"Debit"),r(),o(11,"th",57),a(12,"Credit"),r(),o(13,"th",58),a(14,"Balance"),r()())}function Ei(t,m){if(t&1&&(o(0,"div",16),w(1,"div",66),o(2,"span",67),a(3),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function Ii(t,m){if(t&1&&(o(0,"div",16),w(1,"span",66)(2,"div",66),o(3,"span",68),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function wi(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.debitAmount)," ")}}function Ti(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.creditAmount)," ")}}function Di(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.balance)," ")}}function Ri(t,m){if(t&1&&(o(0,"tr")(1,"td",59),a(2),r(),o(3,"td",59)(4,"a",60),a(5),r()(),o(6,"td",59)(7,"span",61),S(8,"date"),a(9),S(10,"date"),r()(),o(11,"td",59)(12,"div",16)(13,"a",62),a(14),r(),g(15,Ei,4,2,"div",16)(16,Ii,5,3,"div",16),r()(),o(17,"td",63),g(18,wi,3,3,"ng-container",64),r(),o(19,"td",63),g(20,Ti,3,3,"ng-container",64),r(),o(21,"td",65),g(22,Di,3,3,"ng-container",64),r()()),t&2){let e=m.$implicit,n=c(3);p(2),x(e.outletName),p(2),s("routerLink",F(19,li,e.id)),p(),x(e.number),p(2),s("pTooltip",ke(8,13,e.date,"dd MMM y")),p(2),T(" ",ke(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ge),p(),x(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",F(21,pi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",F(23,mi,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Fi(t,m){if(t&1&&(o(0,"tr"),w(1,"td",69),o(2,"td",70),a(3,"Total"),r(),o(4,"td",71),a(5),S(6,"number"),r(),o(7,"td",72),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c(3);p(5),T(" ",y(6,2,e.debitSubTotal())," "),p(3),T(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",73)(2,"span"),a(3,"No records found."),r()()())}function Vi(t,m){if(t&1){let e=D();o(0,"button",74),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 Mi(t,m){if(t&1&&a(0),t&2){let e=c(3);T(" ",e.count()," ")}}function ki(t,m){if(t&1){let e=D();o(0,"p-button",75),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Ni(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),g(2,vi,1,0,"ng-template",null,7,_)(4,yi,15,0,"ng-template",null,8,_)(6,Ri,23,25,"ng-template",null,9,_)(8,Fi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),a(14),g(15,Vi,1,0,"button",50)(16,Mi,1,1),a(17," entries "),r(),o(18,"div",33),g(19,ki,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Me(" 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 Bi(t,m){if(t&1&&g(0,Ni,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Ai(t,m){if(t&1&&(o(0,"div",76)(1,"div",77),w(2,"div",78),r(),o(3,"div",79)(4,"div",27),w(5,"i",80),o(6,"span",81),a(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(6),Me("Exporting data from ",y(8,3,e.filter().exportPageNumber)," - ",y(9,5,e.filter().exportPageSize),"")}}function Gi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",84),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Ut=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(He),this.roleService=C(oe),this.authService=C(Se),this.fb=C(ve),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(ce),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=ye(this.route.queryParamMap.pipe(Be(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 Ce.IsNotEmpty(u)&&(l=v(f({},l),{accountID:u})),Ce.IsNotEmpty(n)&&Ce.IsNotEmpty(i)&&(l=v(f({},l),{from:n,to:i})),l})),{initialValue:null}),this.loaderMetadata=ye(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?f(f({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),fe(()=>{let e=this.filter();e&&(Ce.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),fe(()=>{let e=this.filter(),n=this.form.value.accountID;!e||Ce.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(l=>e.pageNumber===1?i:v(f({},i),{data:v(f({},i.data),{data:[...l?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return pt(e)}ngOnInit(){this.route.queryParamMap.pipe(Ae(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Gt.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(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let l=this.form.getRawValue(),{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(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;lt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(f({},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 General Ledger",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select 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"],[2,"width","380px"],[2,"width","240px"],[2,"width","150px"],[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"],["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())}),g(1,bi,1,1,"ng-template",null,0,_)(3,Si,4,1,"ng-template",null,1,_)(5,Bi,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)}),g(8,Ai,10,7,"div",13)(9,Gi,1,2,"ng-template",null,3,_)(11,Pi,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),Pe(L(11,oi)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",L(12,ri)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[re,K,ze,H,W,qe,ae,se,me,tt,et,ie,te,Te,qt,pe,le,Re,De,ee,J,Y,X,Q,Z,ue,de,Ee,Ue,at,rt,ne,$,U,nt,it,zt,jt,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var Oi={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},ht=Ye(Ze(Oi),Xe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),Qe(t=>{let m=C(G),e=C(ce),n={updateFilter(i){O(t,l=>v(f({},l),{filter:f(f({},l.filter),i)}))},getLoader:Ie(he(be(()=>m.getIncomeStatementLoader().pipe(we({next:i=>{O(t,l=>v(f({},l),{loader:i,filter:v(f({},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:Ie(he(be(i=>m.getIncomeStatement(i).pipe(Rt(()=>O(t,l=>v(f({},l),{isLoading:!0}))),we({next:l=>{O(t,u=>v(f({},u),{data:l,isLoading:!1}))},error:l=>{console.error(l)}})))))};return n}),Je({onInit:t=>{t.getLoader()}}));var bt=()=>({}),Ct=t=>["/pages/chart-of-account/account/",t],St=()=>["/pages/report/general-ledger"],vt=(t,m,e)=>({id:t,from:m,to:e});function zi(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 qi(t,m){if(t&1&&(o(0,"div",8),g(1,zi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function Hi(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),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(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),S(7,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,1,e.store.totalRevenue()))}}function Ui(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),g(3,Hi,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Ui,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 Yi(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 Xi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(y(9,6,e.amount))}}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,2,e.store.totalCOGS())),p(8),x(y(15,4,e.store.grossProfit()))}}function Qi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function Zi(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),g(3,Yi,7,0,"ng-template",null,3,_)(5,Xi,10,15,"ng-template",null,4,_)(7,Ji,16,6,"ng-template",null,5,_)(9,Qi,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 en(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 tn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(y(9,6,e.amount))}}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,2,e.store.totalExpense())),p(8),x(y(15,4,e.store.profitOrLoss()))}}function on(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function rn(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),g(3,en,7,0,"ng-template",null,3,_)(5,tn,10,15,"ng-template",null,4,_)(7,nn,16,6,"ng-template",null,5,_)(9,on,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 an(t,m){if(t&1&&(Vt(0)(1),o(2,"p-panel")(3,"div",11),g(4,$i,11,1)(5,Zi,11,1)(6,rn,11,1),r()()),t&2){let e,n,i,l,u,d=c();mt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),mt((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:L(5,bt)).length>0?4:-1),p(),M(d.Object.keys((l=(l=d.store.data().data)==null?null:l.cogs)!==null&&l!==void 0?l:L(6,bt)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:L(7,bt)).length>0?6:-1)}}function ln(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),r(),w(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let 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),w(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 $t=(()=>{class t{constructor(){this.dayjsService=C(ce),this.store=C(ht),this.fb=C(ve),this.reportService=C(G),this.roleService=C(oe),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(f({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ne("Cashier Suggestions"),V(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(f(f({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ne("Export Profit & Loss"),V(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([ht])],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())}),g(1,qi,2,1,"ng-template",null,0,_)(3,an,7,8,"ng-template",null,1,_)(5,ln,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:[re,K,H,W,Te,pe,le,ee,J,Y,X,Q,Z,ue,de,ae,se,me,ne,$e,$,U,Re,De,ie,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yt=Tt(Ht());var pn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,yt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Et=Ye(Ze(pn),Xe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),Qe(t=>{let m=C(G),e={updateFilter:n=>{O(t,i=>v(f({},i),{filter:n}))},fetchBalanceSheet:Ie(he(Ae(()=>{let n=t.filter();return Object.entries(n).every(([i,l])=>l!=null&&l!=="")}),be(n=>m.getBalanceSheet(n).pipe(we({next:i=>{O(t,l=>v(f({},l),{data:i}))},error:i=>{console.error(i)}}))),Dt(1))),fetchLoader:Ie(he(be(()=>m.getBalanceSheetLoader().pipe(we({next:n=>{O(t,i=>v(f({},i),{metadata:n,filter:{date:(0,yt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Je(t=>({onInit:()=>{t.fetchLoader()}})));var Yt=Tt(Ht());var It=t=>["/pages/chart-of-account/account/",t],wt=()=>["/pages/report/general-ledger"],mn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function sn(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 cn(t,m){if(t&1&&(o(0,"div",9),g(1,sn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function dn(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 un(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",Mt(11,mn,e.accountID,n.store.filter().date)),p(),x(y(9,6,e.amount))}}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);p(4),T(" ",y(5,1,e.store.totalAsset())," ")}}function fn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function gn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),g(3,dn,7,0,"ng-template",null,3,_)(5,un,10,14,"ng-template",null,4,_)(7,_n,6,3,"ng-template",null,5,_)(9,fn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function xn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function hn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),p(),x(y(9,6,e.counterAmount))}}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);p(4),T(" ",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 Sn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),g(3,xn,7,0,"ng-template",null,3,_)(5,hn,10,13,"ng-template",null,4,_)(7,bn,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 vn(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 yn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),p(),x(y(9,6,e.counterAmount))}}function En(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),S(11,"number"),r()()),t&2){let e=c(3);p(4),T(" ",y(5,2,e.store.totalEquity())," "),p(6),T(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function In(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),g(3,vn,7,0,"ng-template",null,3,_)(5,yn,10,13,"ng-template",null,4,_),a(7," <"),g(8,En,12,6,"ng-template",null,5,_)(10,In,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Tn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),g(2,gn,11,1)(3,Sn,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 Dn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function Rn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),g(5,Dn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),w(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),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=C(Et),this.ReportServiceStore=C(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=C(oe),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Pt({date:new st(new Date),outletID:new st([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Yt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ne("Export Balance Sheet"),V(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([Et])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","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())}),g(1,cn,2,1,"ng-template",null,0,_)(3,Tn,5,4,"ng-template",null,1,_)(5,Rn,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:[re,K,H,W,se,me,ae,ie,te,ee,J,Y,X,Q,Z,ue,de,pe,le,Ee,ne,$e,$,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 Fn=()=>({width:"30vw"}),Ln=()=>({"1199px":"75vw","575px":"90vw"}),Vn=t=>["/pages/journal/journal-entry/",t],Mn=t=>({"text-success":t}),kn=t=>({"text-danger":t}),Nn=t=>({"ng-dirty ng-invalid":t}),Bn=()=>({scrollHeight:"250px"});function An(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 Gn(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),a(2,"Return to Accounts"),r(),g(3,An,1,0,"p-button",26),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function Pn(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),x(e.name),p(3),T(" (",e.chartOfAccountCode,") ")}}function On(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 jn(t,m){if(t&1&&(o(0,"div",38),w(1,"div",43),o(2,"span",44),a(3),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function zn(t,m){if(t&1&&(o(0,"div",38),w(1,"span",43)(2,"div",43),o(3,"span",44),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function qn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.debitAmount)," ")}}function Hn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.creditAmount)," ")}}function Wn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.balance)," ")}}function Kn(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),S(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),a(12),r(),g(13,jn,4,2,"div",38)(14,zn,5,3,"div",38),r()(),o(15,"td",40),g(16,qn,3,3,"ng-container",41),r(),o(17,"td",40),g(18,Hn,3,3,"ng-container",41),r(),o(19,"td",42),g(20,Wn,3,3,"ng-container",41),r()()),t&2){let e=m.$implicit,n=c(4);p(2),x(e.outletName),p(2),s("routerLink",F(15,Vn,e.id)),p(),x(e.number),p(2),x(ke(8,12,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ge),p(),x(e.contactName),p(),M(n.buildReferenceUrl(e)?13:14),p(2),s("ngClass",F(17,Mn,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",F(19,kn,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Un(t,m){if(t&1&&(o(0,"tr"),w(1,"td",45),o(2,"td",46),a(3,"Total"),r(),o(4,"td",47),a(5),S(6,"number"),r(),o(7,"td",48),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c().$index,n=c(3);p(5),T(" ",y(6,2,n.items().data[e].debitTotal)," "),p(3),T(" ",y(9,4,n.items().data[e].creditTotal)," ")}}function $n(t,m){t&1&&(o(0,"tr")(1,"td",49)(2,"span"),a(3,"No records found."),r()()())}function Yn(t,m){if(t&1&&(o(0,"p-table",30),g(1,Pn,7,2,"ng-template",null,5,_)(3,On,15,0,"ng-template",null,6,_)(5,Kn,21,21,"ng-template",null,7,_)(7,Un,11,6,"ng-template",null,4,_)(9,$n,4,0,"ng-template",null,8,_),r()),t&2){let e=m.$implicit;s("value",e.data)}}function Xn(t,m){if(t&1&&(o(0,"div",29),Le(1,Yn,11,1,"p-table",30,Fe),r()),t&2){let e=c(2);p(),Ve(e.items().data)}}function Jn(t,m){if(t&1&&g(0,Xn,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Qn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",65),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",66),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function Zn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",65),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",66),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function eo(t,m){t&1&&(o(0,"div",67),a(1," Account is required. "),r())}function to(t,m){if(t&1&&(o(0,"div",68)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function io(t,m){if(t&1&&(o(0,"div",59)(1,"div",21),w(2,"p-radiobutton",69),o(3,"label",70),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),Lt("for",e.key),p(),x(e.value)}}function no(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Customer"),r(),o(3,"p-autocomplete",71),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 oo(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Supplier"),r(),o(3,"p-autocomplete",72),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 ro(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Customer"),r(),o(3,"p-autocomplete",71),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 ao(t,m){if(t&1){let e=D();o(0,"form",50)(1,"div",38)(2,"label",51),a(3,"Accounts"),r(),o(4,"p-multiselect",52),I("onChange",function(i){h(e);let l=c();return b(l.onAccountChange(i))}),g(5,Qn,10,2,"ng-template",null,9,_)(7,Zn,10,2,"ng-template",null,10,_),r(),g(9,eo,2,0,"div",53),r(),o(10,"div",38)(11,"label",51),a(12,"From"),r(),o(13,"div",54),w(14,"p-datepicker",55)(15,"p-datepicker",56),r()(),o(16,"div",38)(17,"label",51),a(18,"Outlets"),r(),o(19,"p-multiselect",57),g(20,to,3,1,"ng-template",null,10,_),r()(),o(22,"div",38)(23,"label",51),a(24,"Category"),r(),o(25,"p-treeselect",58),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),Le(30,io,5,4,"div",59,Fe),r()(),o(32,"div",38)(33,"label",18),a(34,"Sort order"),r(),o(35,"div",16)(36,"div",59)(37,"div",21),w(38,"p-radiobutton",60),o(39,"label",61),a(40,"Asc"),r()()(),o(41,"div",62)(42,"div",21),w(43,"p-radiobutton",63),o(44,"label",64),a(45,"Desc"),r()()()()(),g(46,no,4,1,"div",38)(47,oo,4,1,"div",38)(48,ro,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",F(22,Nn,((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",L(24,Bn))("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 lo(t,m){if(t&1){let e=D();o(0,"p-button",73),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function po(t,m){if(t&1){let e=D();o(0,"p-button",74),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",75),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var ti=(()=>{class t{buildReferenceUrl(e){return pt(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(He),this.roleService=C(oe),this.authService=C(Se),this.fb=C(ve),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(ce),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=ye(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=ye(this.route.queryParamMap.pipe(Be(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?f(f(f({},e),n??{}),i):null}),this.creditSubTotal=R(()=>0),this.debitSubTotal=R(()=>0),this.initializeForm(),fe(()=>{let e=this.filter();if(e){this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1});let n=Array.isArray(e.listAccountID)?e.listAccountID:[],i=Array.isArray(e.listCategoryID)?e.listCategoryID:[];(n.length>0||i.length>0)&&this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(l=>{this.items.set(l)})}})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),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),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":console.log("contactType value:",l),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(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>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=xe(l,["from","to"]);return v(f({},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.exportMultiLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),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;lt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},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(f({},e),{pageNumber:n+1})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(f({},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,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","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"],[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())}),g(1,Gn,4,1,"ng-template",null,0,_)(3,Jn,1,1,"ng-template",null,1,_)(5,ao,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),w(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),w(19,"i",22),o(20,"span",23),a(21),S(22,"number"),S(23,"number"),r()()()(),g(24,lo,1,2,"ng-template",null,3,_)(26,po,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),Pe(L(17,Fn)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",L(18,Ln)),p(2),s("formGroup",i.form),p(12),Me("Exporting data from ",y(22,13,(l=i.filter())==null?null:l.exportPageNumber)," - ",y(23,15,(l=i.filter())==null?null:l.exportPageSize),"")}},dependencies:[re,K,ze,H,W,qe,ae,se,me,tt,et,ie,te,Te,pe,le,Re,De,ee,J,At,Y,X,Q,Z,ue,de,Ee,Ue,at,Wt,rt,ne,$,U,nt,it,Ke,Ot],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var el=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Ut},{path:"multiple-general-ledger",component:ti},{path:"profit-loss",component:$t},{path:"balance-sheet",component:Jt},{path:"comparative-balance",component:Qt},{path:"trial-balance",component:ei},{path:"cash-flow",component:Zt}]}];export{el as REPORTS_ROUTES};
|
package/chunk-7OP477BS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as V,b as oe}from"./chunk-ZQWFATZY.js";import"./chunk-YPOBALKC.js";import{a as te,b as ie}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as K,b as Q}from"./chunk-DJXQKSLT.js";import{a as ne,b as re}from"./chunk-E7QWESN4.js";import{b as ee}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as $}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as Y,b as Z}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as U,x as X}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{e as G,j as H,w as q}from"./chunk-VMI3QWC6.js";import"./chunk-DSZOROE6.js";import{a as A}from"./chunk-2BI7WNJP.js";import{n as z,s as R}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as j,Eb as L,Ec as F,Ha as b,Mb as u,Oc as T,Pb as S,Pc as P,Sc as M,W as E,Wb as r,Xb as o,Y as B,Yb as C,_ as W,ac as h,fc as f,gc as m,h as J,ia as x,ib as s,qa as l,ra as p,s as y,sa as I,sc as _,ta as N,xc as c,yb as O,yc as g,zc as d}from"./chunk-6QJHEOXN.js";import{a as D}from"./chunk-YQFG5XE2.js";var ae=()=>({height:"calc(100vh - 100px)"});function le(a,v){if(a&1){let t=h();r(0,"div",4)(1,"p-button",5),f("onClick",function(){l(t);let e=m();return p(e.onFormat())}),o(),r(2,"p-button",6),f("onClick",function(){l(t);let e=m();return p(e.openMigrateDialog())}),o()()}}function pe(a,v){if(a&1){let t=h();r(0,"div",7)(1,"div",8)(2,"label",9),_(3,"From"),o(),r(4,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().From,e)||(n.filter().From=e),p(e)}),o()(),r(5,"div",8)(6,"label",9),_(7,"To"),o(),r(8,"p-datepicker",10),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().To,e)||(n.filter().To=e),p(e)}),o()(),r(9,"div",8)(10,"label",9),_(11,"Page Number"),o(),r(12,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageNumber,e)||(n.filter().PageNumber=e),p(e)}),o()(),r(13,"div",8)(14,"label",9),_(15,"Page Size"),o(),r(16,"p-inputnumber",11),d("ngModelChange",function(e){l(t);let n=m();return g(n.filter().PageSize,e)||(n.filter().PageSize=e),p(e)}),o()()()}if(a&2){let t=m();s(4),u("showIcon",!0),c("ngModel",t.filter().From),s(4),u("showIcon",!0),c("ngModel",t.filter().To),s(4),c("ngModel",t.filter().PageNumber),s(4),c("ngModel",t.filter().PageSize)}}function me(a,v){if(a&1&&(r(0,"p-scroll-panel")(1,"p-panel")(2,"div",12),C(3,"app-migration-cards",13),T(4,"async"),I(),r(5,"svg",14),C(6,"path",15),o(),N(),C(7,"app-migration-cards",16),T(8,"async"),o()()()),a&2){let t=m();S(F(12,ae)),s(),S(F(13,ae)),s(2),u("migrationCount",P(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),s(4),u("migrationCount",P(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var We=(()=>{class a{constructor(){this.migrateService=x(V),this.refresh$=new J(void 0),this.toastr=x(A),this.pageTitle="Manual Journal",this.filter=b({From:new Date,To:new Date,PageSize:45e3,PageNumber:1}),this.isFilterDialogOpen=b(!1),this.previousFilter=null}ngOnInit(){let t=this.refresh$.pipe(B(()=>this.migrateService.getManualJournalCount()),E(1));this.countInPOS$=t.pipe(y(i=>Number(i.pos))),this.countInBooks$=t.pipe(y(i=>Number(i.books)))}openMigrateDialog(){this.previousFilter=D({},this.filter()),this.isFilterDialogOpen.set(!0)}onMigrate(){this.migrateService.migrateManualJournal(this.filter()).pipe(W(()=>{this.isFilterDialogOpen.update(t=>!t),this.refresh$.next(),this.previousFilter=null})).subscribe()}onFilterCanceled(){this.previousFilter&&(this.filter.set(this.previousFilter),this.previousFilter=null)}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualJournal().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=O({type:a,selectors:[["app-manual-journal"]],features:[j([V])],decls:7,vars:2,consts:[["actionButton",""],["filters",""],["content",""],[3,"filterConfirmed","isDialogFilterVisibleChange","filterCanceled","pageTitle","isDialogFilterVisible"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate",3,"onClick"],[1,"d-flex","flex-column","row-gap-3"],[1,"d-flex","flex-column"],["for","outlet"],["styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"ngModelChange","showIcon","ngModel"],["inputId","integeronly",3,"ngModelChange","ngModel"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,e){if(i&1){let n=h();r(0,"app-main-panel",3),f("filterConfirmed",function(){return l(n),p(e.onMigrate())}),d("isDialogFilterVisibleChange",function(w){return l(n),g(e.isFilterDialogOpen,w)||(e.isFilterDialogOpen=w),p(w)}),f("filterCanceled",function(){return l(n),p(e.onFilterCanceled())}),L(1,le,3,0,"ng-template",null,0,M)(3,pe,17,6,"ng-template",null,1,M)(5,me,9,14,"ng-template",null,2,M),o()}i&2&&(u("pageTitle",e.pageTitle),c("isDialogFilterVisible",e.isFilterDialogOpen))},dependencies:[$,R,z,ee,X,U,Q,K,Z,Y,oe,ie,te,q,G,H,re,ne],encapsulation:2})}}return a})();export{We as ManualJournalComponent};
|
package/chunk-7WCUKMRG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ue}from"./chunk-F3RSX7TC.js";import{b as be}from"./chunk-B4C3ZPN6.js";import"./chunk-U2VDC52W.js";import{a as Q,b as W}from"./chunk-3VQUNDVT.js";import{d as X,i as xe,j as Ce,k as Y}from"./chunk-F6LZM7H5.js";import"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as he}from"./chunk-BT7Y4ADP.js";import"./chunk-T367AQJ2.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import{b as ge}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as q}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as A,b as j}from"./chunk-AD247LWQ.js";import{b,c as H,d as L,e as G,f as $,g as K}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{o as _e,w as V,x as F}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{x as fe}from"./chunk-VMI3QWC6.js";import{e as z,l as me}from"./chunk-F7PVAVLQ.js";import{a as se}from"./chunk-DSZOROE6.js";import{a as de}from"./chunk-2BI7WNJP.js";import{A as ce,k as le,p as pe,q as D,s as N}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as O,Eb as T,Ec as P,Fc as ie,Mb as g,Oc as S,Pb as I,Pc as U,Qc as re,Sc as _,Wb as o,Xb as i,Y as R,Yb as J,_ as ne,ac as E,bd as v,c as k,ca as ae,eb as oe,fc as y,gc as s,ia as u,ib as m,qa as x,ra as C,s as te,sc as r,tc as f,wc as B,yb as M}from"./chunk-6QJHEOXN.js";import{a as l,b as d}from"./chunk-YQFG5XE2.js";var w=(()=>{class e{constructor(){this.httpService=u(se)}getGenerateCoa(t){let n={params:new ce().set("PageNumber",t.PageNumber).set("PageSize",t.PageSize)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(t={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,t)}getUnbalanceJournal(t){return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal/"+t.PageNumber+"/"+t.PageSize)}updateUnbalanceJournal(t){let a={ListID:t};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",a)}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275prov=ae({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Te={filter:{PageNumber:1,PageSize:20},data:{data:[],count:0}},Z=H(K(Te),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count))})),$(e=>{let p=u(w);return{updateFilter:a=>{b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},getUpdateCOA:Q(k(R(a=>p.getGenerateCoa(a).pipe(W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error(n)}})))))}}),G({onInit(e){e.getUpdateCOA(e.filter)}}));var ke=()=>({height:"calc(100vh - 70px)"}),Re=()=>({"min-width":"50rem"});function Me(e,p){if(e&1){let t=E();o(0,"p-button",7),y("onClick",function(){x(t);let n=s();return C(n.updateCoaBalance())}),i()}}function Ie(e,p){e&1&&(o(0,"tr")(1,"th"),r(2,"Code"),i(),o(3,"th"),r(4,"Name"),i(),o(5,"th"),r(6,"Outlet"),i(),o(7,"th"),r(8,"COA Balance"),i(),o(9,"th"),r(10,"Correct Balance"),i()())}function Je(e,p){if(e&1&&(o(0,"tr")(1,"td"),r(2),i(),o(3,"td")(4,"a",9),r(5),i()(),o(6,"td"),r(7),i(),o(8,"td"),r(9),S(10,"number"),i(),o(11,"td"),r(12),S(13,"number"),i()()),e&2){let t=p.$implicit;m(2),f(t.Code),m(2),g("routerLink","/pages/chart-of-account/account/"+t.ID),m(),f(t.Name),m(2),f(t.OutletName),m(2),f(U(10,6,t.Balance)),m(3),f(U(13,8,t.CorrectBalance))}}function Be(e,p){if(e&1&&(o(0,"div",10)(1,"p",11),r(2),i()()),e&2){let t=s(2);m(2),B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Oe(e,p){e&1&&(o(0,"tr")(1,"td",12)(2,"span"),r(3,"No records found."),i()()())}function De(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",8),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))}),T(2,Ie,11,0,"ng-template",null,2,_)(4,Je,14,10,"ng-template",null,3,_)(6,Be,3,3,"ng-template",null,4,_)(8,Oe,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(8,ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",t.store.data().count)("rows",t.store.filter().PageSize)("value",t.store.data().data)("tableStyle",P(9,Re))}}var ve=(()=>{class e{constructor(){this.store=u(Z),this.coaService=u(w),this.toastrService=u(de)}onPageChange(t){this.store.updateFilter(d(l({},this.store.filter()),{PageNumber:Math.floor(t.first/t.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(he("Update COA Balance"),ne(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-tools-update-coa"]],features:[O([Z])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Me,1,0,"ng-template",null,0,_)(3,De,10,10,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,ge,N,D,F,V,j,A,z],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return e})();var Ne={data:{count:0,data:[]},filter:{PageNumber:1,PageSize:20}},ee=H(K(Ne),L(e=>({first:v(()=>(e.filter().PageNumber-1)*e.filter().PageSize+1),end:v(()=>Math.min(e.filter().PageNumber*e.filter().PageSize,e.data().count)),selectedItems:v(()=>e.data().data.filter(p=>p.checked)),hasCheckedRows:v(()=>e.data().data.some(p=>p.checked))})),$(e=>{let p=u(w);return{updateFilter(a){b(e,n=>d(l({},n),{filter:l(l({},n.filter),a)}))},onRowSelect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!0}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onRowUnselect(a){b(e,n=>{let c=n.data.data.map(h=>h.id===a.id?d(l({},h),{checked:!1}):h);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onHeaderCheckboxToggle(a){b(e,n=>{let c=n.data.data.map(h=>d(l({},h),{checked:a}));return d(l({},n),{data:d(l({},n.data),{data:c})})})},loadData:Q(k(R(a=>p.getUnbalanceJournal(a).pipe(te(n=>d(l({},n),{data:n.data.map(c=>d(l({},c),{checked:!1}))})),W({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}),G(e=>({onInit:()=>{e.loadData(e.filter)}})));var ze=()=>({height:"calc(100vh - 70px)"}),Ve=e=>["/pages/journal/journal-entry",e];function Fe(e,p){if(e&1){let t=E();o(0,"div",8),J(1,"p-button",9),o(2,"p-button",10),y("onClick",function(){x(t);let n=s(2);return C(n.regenerateUnbalanceJournal())}),r(3,"Regenerate"),i()()}}function Ae(e,p){if(e&1&&T(0,Fe,4,0,"div",7),e&2){let t=s();g("ngIf",t.store.hasCheckedRows())}}function je(e,p){e&1&&(o(0,"tr")(1,"th",12),J(2,"p-tableHeaderCheckbox"),i(),o(3,"th"),r(4,"Date"),i(),o(5,"th"),r(6,"Number"),i(),o(7,"th",13),r(8,"Debit SUM"),i(),o(9,"th",13),r(10,"Credit SUM"),i(),o(11,"th",13),r(12,"Difference"),i(),o(13,"th"),r(14,"Reference"),i(),o(15,"th"),r(16,"Outlet"),i()())}function He(e,p){if(e&1&&(o(0,"tr")(1,"td"),J(2,"p-tableCheckbox",14),i(),o(3,"td"),r(4),S(5,"date"),i(),o(6,"td")(7,"a",15),r(8),i()(),o(9,"td",13),r(10),S(11,"number"),i(),o(12,"td",13),r(13),S(14,"number"),i(),o(15,"td",13),r(16),S(17,"number"),i(),o(18,"td")(19,"a",16),r(20),i()(),o(21,"td"),r(22),i()()),e&2){let t=p.$implicit,a=s(2);m(2),g("value",t),m(2),f(re(5,10,t.date,"dd MMM yyyy")),m(3),g("routerLink",ie(19,Ve,t.id)),m(),f(t.number),m(2),f(U(11,13,t.debitSum)),m(3),f(U(14,15,t.creditSum)),m(3),f(U(17,17,t.differences)),m(3),g("href",a.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+t.id,oe),m(),f(t.referenceText),m(2),f(t.outletName)}}function Le(e,p){if(e&1&&r(0),e&2){let t=s(2);B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Ge(e,p){e&1&&(o(0,"tr")(1,"td",17)(2,"span"),r(3,"No records found."),i()()())}function $e(e,p){if(e&1){let t=E();o(0,"p-panel")(1,"p-table",11),y("onPage",function(n){x(t);let c=s();return C(c.onPageChange(n))})("onRowSelect",function(n){x(t);let c=s();return C(c.onRowSelect(n))})("onRowUnselect",function(n){x(t);let c=s();return C(c.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){x(t);let c=s();return C(c.onHeaderCheckboxToggle(n))}),T(2,je,17,0,"ng-template",null,2,_)(4,He,23,21,"ng-template",null,3,_)(6,Le,1,3,"ng-template",null,4,_)(8,Ge,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(P(7,ze)),m(),g("value",t.store.data().data)("lazy",!0)("paginator",!0)("rows",t.store.filter().PageSize)("totalRecords",t.store.data().count)}}var we=(()=>{class e{constructor(){this.store=u(ee),this.toolsService=u(w),this.authService=u(ue)}onPageChange(t){console.log("Page changed:",t);let a=t.first/t.rows;this.store.updateFilter({PageNumber:a+1})}onRowSelect(t){this.store.onRowSelect(t.data)}onRowUnselect(t){if(Array.isArray(t.data)){t.data.forEach(a=>{this.store.onRowUnselect(a)});return}else this.store.onRowUnselect(t.data)}onHeaderCheckboxToggle(t){this.store.onHeaderCheckboxToggle(t.checked)}regenerateUnbalanceJournal(){let a=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(a).subscribe()}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=M({type:e,selectors:[["app-unbalance-journal"]],features:[O([ee])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Unbalance Journal",3,"scrollable"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["paginatorStyleClass","d-flex justify-content-end","dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","6"]],template:function(a,n){a&1&&(o(0,"app-main-panel",6),T(1,Ae,1,1,"ng-template",null,0,_)(3,$e,10,8,"ng-template",null,1,_),i()),a&2&&g("scrollable",!0)},dependencies:[q,Y,X,xe,Ce,be,_e,N,le,D,pe,fe,F,V,j,A,me,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Wt=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:ve},{path:"unbalance-journal",component:we}];export{Wt as TOOLS_ROUTES};
|
package/chunk-ACDLAA4B.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as we}from"./chunk-NPXVSAMB.js";import"./chunk-F3RSX7TC.js";import{a as Ce,b as ve,c as Ee,d as he,e as Ie,f as be}from"./chunk-5B5AMMR3.js";import{a as ye,b as Ve,c as Se}from"./chunk-JD3HX7VY.js";import"./chunk-U2VDC52W.js";import{d as _e,f as ue,g as fe,h as xe,k as ge}from"./chunk-F6LZM7H5.js";import"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as R}from"./chunk-BT7Y4ADP.js";import{a as ie}from"./chunk-DJXQKSLT.js";import"./chunk-T367AQJ2.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import{a as ce,b as de}from"./chunk-WXIG4CXY.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{e as pe,f as me,i as se}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as ae,b as le}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as oe,x as re}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{d as ne}from"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{h as X,k as Y,p as Z,q as ee,s as te}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as d,Ec as J,Fc as T,Ha as S,Hc as q,I as N,Mb as m,Oc as E,Pb as A,Pc as I,Qc as G,Rb as h,Sb as F,Sc as c,Ub as P,Vb as D,Wb as n,Xb as i,Y as U,Yb as _,_ as w,ac as v,fc as y,gb as j,gc as s,ia as k,ib as l,m as M,mc as H,nc as L,oc as O,qa as f,ra as x,rc as $,s as B,sc as r,tc as g,uc as C,xc as Q,yb as K,yc as W,zc as z}from"./chunk-6QJHEOXN.js";import{e as Re}from"./chunk-YQFG5XE2.js";var Je=Re(Ve());var ke=["stepper"],Ae=()=>({width:"30vw"}),Fe=()=>({"1199px":"75vw","575px":"100vw"}),Pe=()=>({height:"calc(100vh - 70px)"}),De=t=>({"col-12":t}),Me=(t,p,e)=>({"bg-gradient-danger":t,"bg-gradient-success":p,"bg-gradient-warning":e}),Te=t=>({"state-danger":t});function Be(t,p){if(t&1){let e=v();n(0,"p-button",14),y("click",function(){f(e);let o=s(2);return x(o.onPrevStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===1)}}function Ne(t,p){if(t&1){let e=v();n(0,"p-button",15),y("click",function(){f(e);let o=s(2);return x(o.onNextStep())}),i()}if(t&2){let e=s(2);m("disabled",e.stepActiveIndex()===3||!e.JournalEntryImport())}}function Ue(t,p){if(t&1){let e=v();n(0,"p-button",16),y("click",function(){f(e);let o=s(2);return x(o.onReset())}),i()}}function je(t,p){if(t&1&&d(0,Be,1,1,"p-button",11)(1,Ne,1,1,"p-button",12)(2,Ue,1,0,"p-button",13),t&2){let e=s();m("ngIf",e.stepActiveIndex()>1),l(),m("ngIf",e.stepActiveIndex()<3),l(),m("ngIf",e.stepActiveIndex()===3)}}function Ke(t,p){if(t&1){let e=v();n(0,"POS-uppy",25),y("fileUploaded",function(o){f(e);let u=s(2);return x(u.onFileUploaded(o))})("fileRemoved",function(o){f(e);let u=s(2);return x(u.onFileRemoved(o))}),i(),n(1,"p",26),r(2," Please refer this "),n(3,"a",27),r(4,"article"),i(),r(5," for more information "),i()}if(t&2){let e=s(2);m("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.dashboardProps)("sampleUrl",e.SAMPLE_URL)("subtitle",e.subtitle)}}function He(t,p){t&1&&(n(0,"tr"),_(1,"th",29),n(2,"th",30),r(3," Number "),_(4,"p-sortIcon",31),i(),n(5,"th",32),r(6," Outlet "),_(7,"p-sortIcon",33),i(),n(8,"th",34),r(9," Date "),_(10,"p-sortIcon",35),i(),n(11,"th",36),r(12," Status "),_(13,"p-sortIcon",37),i(),n(14,"th"),r(15,"Message"),i()())}function Le(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Oe(t,p){if(t&1&&(n(0,"div",40),P(1,Le,5,2,"div",41,F),i()),t&2){let e=s(2).$implicit;l(),D(e.issues)}}function $e(t,p){}function Qe(t,p){if(t&1&&d(0,Oe,3,0,"div",40)(1,$e,0,0),t&2){let e=s().$implicit;h(e.issues&&e.issues.length>0?0:1)}}function We(t,p){if(t&1&&(n(0,"tr")(1,"td"),_(2,"p-button",38),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"date"),i(),n(10,"td",39),r(11),i(),n(12,"td",39),d(13,Qe,2,1),i()()),t&2){let e=p.$implicit,a=p.expanded,o=s(4);l(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",a?"fa-solid fa-chevron-down":"fa-solid fa-chevron-right"),l(2),g(e.number),l(2),C(" ",e.outlet," "),l(2),g(G(9,12,e.date,"d MMM y")),l(2),m("ngClass",q(15,Me,e.actionName==="Error",e.actionName==="New",e.actionName==="Update")),l(),C(" ",e.actionName," "),l(),m("ngClass",T(19,Te,o.hasIssue)),l(),h(o.hasIssue?13:-1)}}function ze(t,p){t&1&&(n(0,"tr")(1,"th",45),r(2," Code "),_(3,"p-sortIcon",46),i(),n(4,"th",47),r(5," Name "),_(6,"p-sortIcon",48),i(),n(7,"th",49),r(8," Note "),_(9,"p-sortIcon",50),i(),n(10,"th",51),r(11," Debit "),_(12,"p-sortIcon",52),i(),n(13,"th",53),r(14," Credit "),_(15,"p-sortIcon",54),i(),n(16,"th"),r(17,"Message"),i()())}function qe(t,p){if(t&1&&(n(0,"div",41)(1,"span"),r(2),i(),n(3,"span"),r(4),i()()),t&2){let e=p.$implicit;l(2),g(e.issue),l(2),g(e.solution)}}function Ge(t,p){if(t&1&&(n(0,"div",40),P(1,qe,5,2,"div",41,F),i()),t&2){let e=s().$implicit;l(),D(e.issues)}}function Xe(t,p){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),i(),n(5,"td"),r(6),i(),n(7,"td"),r(8),E(9,"number"),i(),n(10,"td"),r(11),E(12,"number"),i(),n(13,"td",39),d(14,Ge,3,0,"div",40),i()()),t&2){let e=p.$implicit,a=s(5);l(2),g(e.accountCode),l(2),g(e.accountName),l(2),g(e.note),l(2),C(" ",I(9,7,e.debitAmount)," "),l(3),C(" ",I(12,9,e.creditAmount)," "),l(2),m("ngClass",T(11,Te,e.issues&&e.issues.length>0)),l(),h(a.hasIssue?14:-1)}}function Ye(t,p){t&1&&(n(0,"tr")(1,"td",55),r(2," There are no order for this product yet. "),i()())}function Ze(t,p){if(t&1&&(n(0,"tr")(1,"td",42)(2,"div",43)(3,"p-table",44),d(4,ze,18,0,"ng-template",null,3,c)(6,Xe,15,13,"ng-template",null,6,c)(8,Ye,3,0,"ng-template",null,8,c),i()()()()),t&2){let e=p.$implicit;l(3),m("value",e.items)}}function et(t,p){if(t&1&&(n(0,"p-table",28),d(1,He,16,0,"ng-template",null,3,c)(3,We,14,21,"ng-template",null,6,c)(5,Ze,10,1,"ng-template",null,7,c),i()),t&2){let e=s(3);m("scrollable",!0)("scrollHeight","calc(100vh - 160px)")("value",e.JournalEntryImport().dataRow)}}function tt(t,p){if(t&1&&d(0,et,7,3,"p-table",28),t&2){let e=s(2);h(e.JournalEntryImport()?0:-1)}}function nt(t,p){t&1&&(n(0,"h5"),r(1,"Successfully Imported"),i())}function it(t,p){if(t&1&&(n(0,"p-panel")(1,"p-scroll-panel")(2,"div",17)(3,"div",18)(4,"p-stepper",19,5)(6,"p-step-list")(7,"p-step",20)(8,"div",21),_(9,"i",22),n(10,"span"),r(11,"Upload"),i()()(),n(12,"p-step",20)(13,"div",21),_(14,"i",23),n(15,"span"),r(16,"Preview"),i()()(),n(17,"p-step",20)(18,"div",21),_(19,"i",24),n(20,"span"),r(21,"Finish"),i()()()(),n(22,"p-step-panels")(23,"p-step-panel",20),d(24,Ke,6,4,"ng-template",null,1,c),i(),n(26,"p-step-panel",20),d(27,tt,1,1,"ng-template",null,1,c),i(),n(29,"p-step-panel",20),d(30,nt,2,0,"ng-template",null,1,c),i()()()()()()()),t&2){let e=s();l(),A(J(11,Pe)),l(2),m("ngClass",T(12,De,e.stepActiveIndex()===2)),l(),m("linear",!0)("value",e.stepActiveIndex()),l(3),m("value",1),l(5),m("value",2),l(5),m("value",3),l(6),m("value",1),l(3),m("value",2),l(3),m("value",3)}}function ot(t,p){if(t&1){let e=v();n(0,"p-button",56),y("onClick",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i()}t&2&&m("rounded",!0)("text",!0)}function rt(t,p){if(t&1&&(n(0,"div",57)(1,"h4",58),r(2,"Import Summary"),i(),n(3,"p",59),r(4),i()()),t&2){let e=s();l(4),C("(",e.CSVRowCount()," rows ready for import)")}}function at(t,p){t&1&&(n(0,"div",63)(1,"h4",64),r(2,"Journal"),i()())}function lt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Debit"),i()())}function pt(t,p){t&1&&(n(0,"div",65)(1,"h4",64),r(2,"Credit"),i()())}function mt(t,p){if(t&1&&(n(0,"div",60)(1,"div",61)(2,"p-card"),d(3,at,3,0,"ng-template",null,3,c),n(5,"div",60)(6,"div",61)(7,"h5",62),r(8),E(9,"number"),i()()()()(),n(10,"div",61)(11,"p-card"),d(12,lt,3,0,"ng-template",null,3,c),n(14,"div",60)(15,"div",61)(16,"h5",62),r(17),E(18,"number"),i()()()()(),n(19,"div",61)(20,"p-card"),d(21,pt,3,0,"ng-template",null,3,c),n(23,"div",60)(24,"div",61)(25,"h5",62),r(26),E(27,"number"),i()()()()()()),t&2){let e=s(2);l(8),C(" ",I(9,3,e.JournalEntryImport().summary.journal)," "),l(9),C(" ",I(18,5,e.JournalEntryImport().summary.debit)," "),l(9),C(" ",I(27,7,e.JournalEntryImport().summary.credit)," ")}}function st(t,p){if(t&1&&d(0,mt,28,9,"div",60),t&2){let e=s();h(e.JournalEntryImport()?0:-1)}}function ct(t,p){if(t&1){let e=v();n(0,"p-button",66),y("click",function(){f(e);let o=s();return x(o.summaryDialogVisible.set(!1))}),i(),n(1,"p-button",67),y("click",function(){f(e);let o=s();return x(o.onConfirmImport())}),i()}}var jt=(()=>{class t{constructor(){this.service=k(we),this.router=k(ne),this.subtitle="Accepted file format: .csv & max file size: 1MB",this.stepActiveIndex=S(1),this.JournalEntryImport=S(null),this.summaryDialogVisible=S(!1),this.CSVRowCount=S(0),this.dashboardProps={inline:!0,width:580,height:350},this.uppyCore={restrictions:{allowedFileTypes:["text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},this.SAMPLE_URL="https://resc.cloudinary.com/pos/raw/upload/POS/CSV/Journal_DealPOS.csv"}ngAfterViewInit(){console.log("Stepper instance:",this.stepperRef)}onFileUpload(e){console.log("File upload event:",e);let a=new FormData;Array.isArray(e.currentFiles)&&e.currentFiles.forEach(o=>{o instanceof File&&a.append("File",o,o.name)}),console.log("Form data prepared for upload:",a.get("File")),this.service.importPreviewJournal(a).pipe(R("Import Preview"),B(o=>({cacheKey:o.cacheKey})),U(o=>this.service.importConfirmJournal(o)),w(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}onFileRemoved(e){console.log("File removed event:",e),this.JournalEntryImport.set(null),this.CSVRowCount.set(0)}onNextStep(){if(this.stepActiveIndex()<3&&(this.stepActiveIndex.update(e=>e+1),this.stepActiveIndex()===3)){this.stepActiveIndex.update(()=>this.stepActiveIndex()-1),this.summaryDialogVisible.set(!0);return}}onPrevStep(){this.stepActiveIndex()>1&&this.stepActiveIndex.update(e=>e-1)}onFileUploaded(e){let a=new FormData;if("name"in e&&typeof e.name=="string")a.append("File",e,e.name),this.service.importPreviewJournal(a).pipe(R("Import Preview"),w(o=>{this.JournalEntryImport.set(o)})).subscribe(),Je.default.parse(e,{header:!0,skipEmptyLines:!0,complete:o=>{console.log("CSV Parsing Results:",o),this.CSVRowCount.set(o.data.length)},error:o=>{console.error("Error parsing CSV:",o)}});else return}onConfirmImport(){if(this.JournalEntryImport()&&this.JournalEntryImport().canProceed){let e={cacheKey:this.JournalEntryImport().cacheKey};this.service.importConfirmJournal(e).pipe(R("Import Confirm"),w(()=>{this.router.navigate(["/pages/journal/journal-entry"]),this.stepActiveIndex.update(a=>a+1),this.summaryDialogVisible.update(a=>!a)}),N(a=>(console.error("Error occurred during import confirmation:",a),this.stepActiveIndex.update(o=>o+1),this.summaryDialogVisible.update(o=>!o),M(null)))).subscribe()}else{console.error("Cannot proceed with import, JournalEntryImport is not set or canProceed is false.");return}}onReset(){this.stepActiveIndex.set(1),this.JournalEntryImport.set(null)}handleKeyboardEvent(e){e.key==="F2"&&this.onConfirmImport()}get hasIssue(){let e=this.JournalEntryImport();return e&&Array.isArray(e.dataRow)?e.dataRow.some(a=>{let o=a.issues&&a.issues.length>0,u=Array.isArray(a.items)&&a.items.some(b=>b.issues&&b.issues.length>0);return o||u}):!1}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=K({type:t,selectors:[["app-journal-entry-import"]],viewQuery:function(a,o){if(a&1&&H(ke,5),a&2){let u;L(u=O())&&(o.stepperRef=u.first)}},hostBindings:function(a,o){a&1&&y("keydown",function(b){return o.handleKeyboardEvent(b)},!1,j)},decls:14,vars:10,consts:[["actionButton",""],["content",""],["closeIconTemplate",""],["header",""],["footer",""],["stepper",""],["body",""],["expandedrow",""],["emptymessage",""],["pageTitle","Manual Journal Import"],["position","center","appendTo","body",3,"visibleChange","modal","visible","breakpoints","draggable","closeIconTemplate","dismissableMask"],["label","Back","severity","secondary","variant","outlined",3,"disabled","click",4,"ngIf"],["label","Next","severity","primary",3,"disabled","click",4,"ngIf"],["label","Finish","severity","primary",3,"click",4,"ngIf"],["label","Back","severity","secondary","variant","outlined",3,"click","disabled"],["label","Next","severity","primary",3,"click","disabled"],["label","Finish","severity","primary",3,"click"],[1,"row","justify-content-center"],[1,"col-6",3,"ngClass"],[3,"linear","value"],[3,"value"],[1,"d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-upload"],[1,"fa-solid","fa-file"],[1,"fa-solid","fa-check"],[3,"fileUploaded","fileRemoved","uppyCoreConfiguration","dashboardPropsConfiguration","sampleUrl","subtitle"],[1,"fst-italic"],["href","#","target","_blank",1,"link","link-primary"],["dataKey","number",3,"scrollable","scrollHeight","value"],[2,"width","5rem"],["pSortableColumn","number"],["field","number"],["pSortableColumn","outlet"],["field","outlet"],["pSortableColumn","date"],["field","date"],["pSortableColumn","inventoryStatus"],["field","inventoryStatus"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[3,"ngClass"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column"],["colspan","8"],[1,"p-4"],["dataKey","accountID",3,"value"],["pSortableColumn","accountCode"],["field","accountCode"],["pSortableColumn","accountName"],["field","accountName"],["pSortableColumn","note"],["field","note"],["pSortableColumn","debitAmount"],["field","debitAmount"],["pSortableColumn","creditAmount"],["field","creditAmount"],["colspan","6"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],[1,"d-flex","gap-2","align-items-baseline"],[1,"fs-4","text-white","m-0"],[1,"m-0","fs-3"],[1,"row"],[1,"col"],[1,"fs-2"],[1,"state-new"],[1,"fs-3","m-0"],[1,"state-unchanged"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(a,o){if(a&1){let u=v();n(0,"app-main-panel",9),d(1,je,3,3,"ng-template",null,0,c)(3,it,32,14,"ng-template",null,1,c),i(),n(5,"p-dialog",10),z("visibleChange",function(V){return f(u),W(o.summaryDialogVisible,V)||(o.summaryDialogVisible=V),x(V)}),d(6,ot,1,2,"ng-template",null,2,c)(8,rt,5,1,"ng-template",null,3,c)(10,st,1,1,"ng-template",null,1,c)(12,ct,2,0,"ng-template",null,4,c),i()}if(a&2){let u=$(7);l(5),A(J(8,Ae)),m("modal",!0),Q("visible",o.summaryDialogVisible),m("breakpoints",J(9,Fe))("draggable",!1)("closeIconTemplate",u)("dismissableMask",!0)}},dependencies:[se,te,X,Y,ee,Z,le,ae,ye,de,ce,be,Ie,Ce,he,Ee,ve,Se,re,oe,ge,_e,ue,xe,fe,me,pe,ie],styles:[".p-datatable-thead>tr>th{background-color:transparent!important;color:#000!important} .p-stepper{display:flex;flex-direction:column;align-items:center} .p-stepper .p-steplist{width:40vw} .p-stepper .p-steppanels{width:100%} .p-card{border-radius:4px} .p-card .p-card-body{padding:.75rem!important} .p-card .p-card-header{display:flex;align-items:center;width:100%} .p-card .p-card-header .state-new{width:inherit;padding:.75rem;vertical-align:middle;background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important} .p-card .p-card-header .state-updated{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .p-card .p-card-header .state-unchanged{width:inherit;padding:.75rem;border-bottom:1px solid #dee2e6} .p-card .p-card-header .state-error{width:inherit;padding:.75rem;background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} pos-uppy div div h4{font-size:16px} pos-uppy div div p{font-size:14px!important} pos-uppy div div hr{margin:0}"],changeDetection:0})}}return t})();export{jt as JournalEntryImportComponent};
|
package/chunk-B3VZ2ZHJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-BG6BR7KI.js";import{a as D,b as H}from"./chunk-3VQUNDVT.js";import{d as Y,i as Z,j as ee,k as te}from"./chunk-F6LZM7H5.js";import"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import"./chunk-T367AQJ2.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as X}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{b as f,c as $,d as q,e as G,f as J,g as Q,h as W}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as K,x as O}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{e as L}from"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{k as j,p as F,s as A}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as B,Eb as E,Mb as h,Oc as v,Qc as M,Sc as _,Wb as r,Xb as l,Y as k,Yb as S,_ as N,ac as R,bd as b,c as P,fc as T,gc as g,ia as x,ib as d,qa as u,ra as C,s as V,sc as p,tc as w,wc as z,yb as U}from"./chunk-6QJHEOXN.js";import{a,b as c}from"./chunk-YQFG5XE2.js";var ne={data:[],count:0,filter:{PageSize:20,PageNumber:1}},I=$(Q(ne),W("Closing Entries Store"),q(t=>({first:b(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:b(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.count())),hasCheckedRows:b(()=>t.data().some(s=>s.checked)),selectedItems:b(()=>t.data().filter(s=>s.checked))})),J(t=>{let s=x(y),e={updateFilter:o=>{f(t,n=>c(a({},n),{filter:a(a({},n.filter),o)}))},onRowSelect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!0}):m);return c(a({},n),{data:i})})},onRowUnselect(o){f(t,n=>{let i=n.data.map(m=>m.id===o.id?c(a({},m),{checked:!1}):m);return c(a({},n),{data:i})})},onHeaderCheckboxToggle(o){f(t,n=>{let i=n.data.map(m=>c(a({},m),{checked:o}));return c(a({},n),{data:i})})},getClosingEntries:D(P(k(o=>s.getClosingEntries(o).pipe(V(n=>n.map(i=>c(a({},i),{checked:!1}))),H({next:n=>{f(t,i=>c(a({},i),{data:n})),e.getClosingEntryCount()},error:n=>{console.error("Error fetching closing entries:",n)}}))))),getClosingEntryCount:D(P(k(()=>s.getClosingEntryCount().pipe(H({next:({count:o})=>{f(t,n=>c(a({},n),{count:o}))},error:o=>{console.error("Error fetching closing entry count:",o)}})))))};return e}),G(t=>({onInit:()=>{t.getClosingEntries(t.filter)}})));function oe(t,s){if(t&1){let e=R();r(0,"p-button",11),T("onClick",function(){u(e);let n=g(2);return C(n.onDeleteClosingEntries())}),l()}}function ie(t,s){if(t&1&&(r(0,"div",7),E(1,oe,1,0,"p-button",8),r(2,"a",9),S(3,"i",10),p(4," Add"),l()()),t&2){let e=g();d(),h("ngIf",e.store.hasCheckedRows())}}function re(t,s){t&1&&(r(0,"tr")(1,"th",13),S(2,"p-tableHeaderCheckbox"),l(),r(3,"th"),p(4,"Period"),l(),r(5,"th"),p(6,"Note"),l(),r(7,"th"),p(8,"Created"),l(),r(9,"th"),p(10,"CreatedBy"),l()())}function ae(t,s){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",14),l(),r(3,"td"),p(4),v(5,"date"),l(),r(6,"td"),p(7),l(),r(8,"td"),p(9),v(10,"date"),l(),r(11,"td"),p(12),l()()),t&2){let e=s.$implicit;d(2),h("value",e),d(2),w(M(5,5,e.period,"d MMM y")),d(3),w(e.note),d(2),w(M(10,8,e.created,"d MMM y")),d(3),w(e.creatorName)}}function le(t,s){if(t&1&&p(0),t&2){let e=g(2);z(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function se(t,s){t&1&&(r(0,"tr")(1,"td",15)(2,"span"),p(3," No journal entries found. "),l()()())}function ce(t,s){if(t&1){let e=R();r(0,"p-table",12),T("onPage",function(n){u(e);let i=g();return C(i.onPageChange(n))})("onRowSelect",function(n){u(e);let i=g();return C(i.onRowSelect(n))})("onRowUnselect",function(n){u(e);let i=g();return C(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){u(e);let i=g();return C(i.onHeaderCheckboxToggle(n))}),E(1,re,11,0,"ng-template",null,2,_)(3,ae,13,11,"ng-template",null,3,_)(5,le,1,3,"ng-template",null,4,_)(7,se,4,0,"ng-template",null,5,_),l()}if(t&2){let e=g();h("value",e.store.data())("paginator",!0)("totalRecords",e.store.count())("lazy",!0)("rows",e.store.filter().PageSize)("scrollHeight","calc(100vh - 142px)")}}var Ve=(()=>{class t{constructor(){this.store=x(I),this.closingEntryService=x(y)}onPageChange(e){let o=e.first/e.rows+1;this.store.updateFilter(c(a({},this.store.filter()),{PageSize:o}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onDeleteClosingEntries(){let e=this.store.selectedItems().map(o=>o.id).join(",");console.log("Deleting closing entries with IDs:",e),this.closingEntryService.deleteClosingEntry(e).pipe(N(()=>{this.store.updateFilter(a({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-closing-page"]],features:[B([I])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Closing Entries List",3,"scrollable"],[1,"d-flex","gap-2"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollHeight"],[2,"width","1rem"],[3,"value"],["colspan","5"]],template:function(o,n){o&1&&(r(0,"app-main-panel",6),E(1,ie,5,1,"ng-template",null,0,_)(3,ce,9,6,"ng-template",null,1,_),l()),o&2&&h("scrollable",!0)},dependencies:[X,A,j,F,te,Y,Z,ee,L,O,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Ve as ClosingPageComponent};
|
package/chunk-BNPR5SPH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-F3RSX7TC.js";import"./chunk-U2VDC52W.js";import{d as n}from"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{ia as e}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var a=(t,m)=>{let o=e(r),i=e(n),p=o.isAuthenticated(),s=!o.isTokenExpired(),u=o.checkAuthKeysExists();return p&&s&&u?(i.navigateByUrl("/pages/dashboard"),!1):!0};var C=[{path:"",canActivate:[a],loadComponent:()=>import("./chunk-FVYL3BQ7.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-OJTHBHGK.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-DDM2KWNX.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-6DTQWLB3.js").then(t=>t.TimeoutComponent)}];export{C as AuthenticationRoutes};
|