dealposbooks 1.9.8-p1 → 1.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/scss/style.scss +1 -1
- package/{chunk-CNLYDNON.js → chunk-2U35WLGR.js} +1 -1
- package/{chunk-H6BPUKCW.js → chunk-33PMTNWY.js} +1 -1
- package/{chunk-XAH4P23E.js → chunk-3XHIVI4R.js} +1 -1
- package/{chunk-L66QS3IX.js → chunk-5CKNZSY2.js} +1 -1
- package/{chunk-OXGCSUUS.js → chunk-6IIHHTGW.js} +1 -1
- package/{chunk-V4IY7RIP.js → chunk-6JMIM647.js} +1 -1
- package/{chunk-27P5HOS3.js → chunk-6KUGZE4D.js} +1 -1
- package/{chunk-5RRPJBLN.js → chunk-7BNTEMFA.js} +1 -1
- package/{chunk-LFVBO7JG.js → chunk-7EIOX5NB.js} +1 -1
- package/{chunk-TLLNQB5C.js → chunk-7EZ4X3EY.js} +2 -2
- package/{chunk-YJ3CWPO4.js → chunk-7F26ZTCS.js} +1 -1
- package/{chunk-6PS3NJ62.js → chunk-7SS54GTW.js} +1 -1
- package/{chunk-35ER6BC7.js → chunk-7Z3LI5KJ.js} +1 -1
- package/{chunk-WWWY3VE7.js → chunk-AAV2CBYL.js} +1 -1
- package/{chunk-DAQCANBV.js → chunk-B63BKC6F.js} +2 -2
- package/{chunk-CEZEYAWZ.js → chunk-B6WHUOA5.js} +1 -1
- package/{chunk-W6LBFCQQ.js → chunk-BHV2HCJY.js} +1 -1
- package/{chunk-LMI4DLB5.js → chunk-BOLQVS6Y.js} +1 -1
- package/{chunk-XYU65DNE.js → chunk-BTDW4G2F.js} +1 -1
- package/{chunk-VJVWTOYU.js → chunk-BVWHK6FQ.js} +1 -1
- package/{chunk-NHEN24Y3.js → chunk-BZKPOL7V.js} +1 -1
- package/{chunk-BOVEGMBL.js → chunk-CEGCR3XO.js} +1 -1
- package/{chunk-PDNXU4MC.js → chunk-CF5CCUC7.js} +1 -1
- package/{chunk-6332DY2I.js → chunk-CLLHHYX6.js} +1 -1
- package/{chunk-4PK4TO7C.js → chunk-CQFTV5NO.js} +1 -1
- package/{chunk-CGUMUBB7.js → chunk-CYY5JJLN.js} +1 -1
- package/chunk-D7VZOVPI.js +130 -0
- package/{chunk-YVGWGEPX.js → chunk-E4IYO245.js} +1 -1
- package/{chunk-Z3SHAW6W.js → chunk-EDULXXOB.js} +1 -1
- package/{chunk-DJAICZNR.js → chunk-EFM3IZ4E.js} +1 -1
- package/{chunk-AZWJMXL6.js → chunk-EUZRP4IL.js} +1 -1
- package/{chunk-SH4ALZVS.js → chunk-F5XF3NTF.js} +1 -1
- package/{chunk-3GHEXAAZ.js → chunk-FMVCTBCQ.js} +1 -1
- package/chunk-G7JKAPFA.js +160 -0
- package/chunk-GMAMEQ3J.js +1 -0
- package/{chunk-CLVUILX2.js → chunk-GNCW5Q2A.js} +1 -1
- package/{chunk-HFUW7PYZ.js → chunk-GQALHR6D.js} +1 -1
- package/{chunk-4V5YFD3N.js → chunk-GW67NFVX.js} +1 -1
- package/{chunk-U4SERSDK.js → chunk-HERTD63G.js} +1 -1
- package/chunk-I4KQVYMH.js +1 -0
- package/{chunk-BX74ZLQG.js → chunk-I7SRN7BD.js} +1 -1
- package/{chunk-R6XNFCQM.js → chunk-IZLAA63M.js} +1 -1
- package/{chunk-UWWFSGE7.js → chunk-J6QKJ5IE.js} +1 -1
- package/{chunk-FTI2QPWV.js → chunk-JBSIAXM5.js} +1 -1
- package/{chunk-2QWAAI3V.js → chunk-JKTB4WTW.js} +1 -1
- package/{chunk-WCXWWANV.js → chunk-JP6RBSB3.js} +3 -3
- package/chunk-JPZJ6KUM.js +1 -0
- package/{chunk-RNOSD5RO.js → chunk-KOLMNCWR.js} +1 -1
- package/{chunk-VDBXI7BY.js → chunk-KYPFNXXK.js} +1 -1
- package/{chunk-MYLHWS7O.js → chunk-KZWUDERE.js} +1 -1
- package/{chunk-J6H5UCJR.js → chunk-LETMLT3U.js} +1 -1
- package/chunk-LNWZEFKE.js +1 -0
- package/chunk-LW5XWJJA.js +1 -0
- package/chunk-M3N34WLW.js +1 -0
- package/{chunk-7ET5CSOO.js → chunk-M4Z3FI3C.js} +1 -1
- package/{chunk-RLR2HFSC.js → chunk-MDH73MG3.js} +1 -1
- package/{chunk-TDMJ2M6W.js → chunk-MFLZ4HZM.js} +1 -1
- package/chunk-MP3KNNAP.js +1 -0
- package/{chunk-77BBQI2T.js → chunk-MWDWM2EU.js} +1 -1
- package/{chunk-46XJU64Z.js → chunk-O3H5V64X.js} +1 -1
- package/{chunk-CZWWMQFD.js → chunk-O4QM64EH.js} +1 -1
- package/chunk-OW2GYBXF.js +7 -0
- package/{chunk-TIX3GAPF.js → chunk-PCSX3PMT.js} +1 -1
- package/{chunk-ZHU3HOWQ.js → chunk-Q4RMIZY5.js} +1 -1
- package/{chunk-JZTK7BS7.js → chunk-QDMJKW6E.js} +1 -1
- package/chunk-QLPEPLQ4.js +1 -0
- package/{chunk-BDJHC5O6.js → chunk-QTHCFSIO.js} +1 -1
- package/{chunk-NR3EHEG3.js → chunk-RDNX4GB3.js} +1 -1
- package/{chunk-VJLO7GNT.js → chunk-RFFPFL5K.js} +1 -1
- package/{chunk-JO3SI6HU.js → chunk-RSBHWSQP.js} +1 -1
- package/{chunk-3RM5CDGW.js → chunk-RSNWAAG7.js} +1 -1
- package/chunk-UD2JTFXA.js +1 -0
- package/{chunk-DXIZC3FM.js → chunk-UGW4WHZE.js} +1 -1
- package/chunk-UQMQ34KD.js +1 -0
- package/{chunk-BPFL7VRT.js → chunk-VAXEGESW.js} +1 -1
- package/chunk-VH4SDRSP.js +129 -0
- package/{chunk-7IPVVF6Y.js → chunk-VLOOUXSK.js} +1 -1
- package/{chunk-KANHSSLO.js → chunk-VWCH5LXN.js} +3 -3
- package/chunk-W223GVMJ.js +1 -0
- package/{chunk-U75O34AW.js → chunk-WJ2UEWWN.js} +1 -1
- package/{chunk-TOYTUB2K.js → chunk-WKDV7R2E.js} +1 -1
- package/{chunk-RSGEQTNJ.js → chunk-WKMCO5GR.js} +1 -1
- package/{chunk-NOZEL54G.js → chunk-WPUAF2DP.js} +1 -1
- package/{chunk-LRI7YFKN.js → chunk-WXJP4ZEP.js} +1 -1
- package/chunk-XKCLERWG.js +1 -0
- package/{chunk-W4KTL6Y6.js → chunk-XSV3RUSY.js} +1 -1
- package/{chunk-SRNYKRLK.js → chunk-Y3JWOPHT.js} +1 -1
- package/{chunk-KHP7E7JG.js → chunk-ZD25QBHW.js} +1 -1
- package/chunk-ZEMTTJBT.js +1 -0
- package/{chunk-RYHNURUZ.js → chunk-ZJXOMTHP.js} +1 -1
- package/{chunk-4MEPU7FI.js → chunk-ZZJ3I6VU.js} +1 -1
- package/index.html +2 -2
- package/main-SDHARJTN.js +1 -0
- package/package.json +1 -1
- package/{styles-XXVTW56A.css → styles-6GJ4BYO3.css} +1 -1
- package/chunk-3OJSEDLY.js +0 -1
- package/chunk-7JGGV5FX.js +0 -1
- package/chunk-7TOJMYLE.js +0 -1
- package/chunk-C3N6HRIE.js +0 -1
- package/chunk-EJCLRSB2.js +0 -1
- package/chunk-I3BTHUK3.js +0 -160
- package/chunk-IL6G454L.js +0 -1
- package/chunk-IY6KCAQ4.js +0 -1
- package/chunk-K4ALA724.js +0 -1
- package/chunk-MPHC4J2R.js +0 -1
- package/chunk-NRULEUE7.js +0 -1
- package/chunk-ONMFMNUN.js +0 -129
- package/chunk-R6NK3ROE.js +0 -1
- package/chunk-RQ52IUQY.js +0 -130
- package/chunk-UNWDCLFZ.js +0 -1
- package/chunk-UUZOSCEV.js +0 -7
- package/chunk-WUPQR4WU.js +0 -1
- package/chunk-X26YDRRO.js +0 -1
- package/main-LKLXHNSP.js +0 -1
package/chunk-MPHC4J2R.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ze,b as et,c as tt,d as nt,e as it,f as ot}from"./chunk-RSGEQTNJ.js";import{a as He,b as Ke,c as Qe}from"./chunk-6PS3NJ62.js";import{a as Xe,b as Ye}from"./chunk-6332DY2I.js";import{a as qe}from"./chunk-RLR2HFSC.js";import{b as We}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as ze,b as Ue}from"./chunk-VJLO7GNT.js";import"./chunk-DJAICZNR.js";import{a as Re,b as Ve,d as je,k as $e}from"./chunk-CEZEYAWZ.js";import{a as Ge,b as Be}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as Le}from"./chunk-C3N6HRIE.js";import{a as ee,b as te}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import{a as Oe,b as ke}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import{a as Pe,b as Je}from"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as De,b as ne}from"./chunk-7IPVVF6Y.js";import{h as M}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as z,b as U}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{n as Z,o as w,w as $,x as L}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{Ia as we,Ma as Me,b as J,c as pe,e as N,f as O,j as Te,l as k,m as X,n as Ne,o as R,v as V,x as Y,y as j}from"./chunk-3GHEXAAZ.js";import{a as Ae}from"./chunk-R6NK3ROE.js";import{a as Fe}from"./chunk-TDMJ2M6W.js";import{C as ye,F as Ie,M as Ee,c as Q,f as be,l as Se,m as T}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as A,Cb as g,Ga as P,Jc as le,Kb as p,Kc as me,L as de,Mc as d,Nb as K,Pb as re,Qb as b,Sb as S,Tb as y,Ub as i,Vb as n,Wb as c,Y as fe,Z as B,_b as h,ba as ge,dc as I,ec as u,g as ue,gb as a,ha as s,mb as _e,pa as v,qa as C,qc as o,rc as E,s as se,sc as ae,vc as ve,wb as F,wc as Ce,xc as he,yc as xe,zc as G}from"./chunk-WCXWWANV.js";import{a as q,b as H}from"./chunk-YQFG5XE2.js";var x=(()=>{class t{#e=s(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)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ct=()=>({height:"calc(100vh - 100px)"}),lt=t=>({"active-state":t}),mt=t=>({"text-white":t});function ht(t,m){if(t&1){let e=h();i(0,"div",5)(1,"a",6),o(2,"Cancel"),n(),i(3,"p-button",7),I("click",function(){v(e);let l=u();return C(l.updateAccountingIntegration())}),n()()}}function xt(t,m){if(t&1&&(i(0,"p-tab",9),o(1),n()),t&2){let e=m.$implicit,r=m.$index;p("value",r),a(),E(e)}}function bt(t,m){if(t&1&&(i(0,"div",42)(1,"h3",43),o(2," End Of Shift "),n()()),t&2){let e=u(4);p("ngClass",A(2,lt,e.form.controls.posIntegration.value.createJournalTriggers===0)),a(),p("ngClass",A(4,mt,e.form.controls.posIntegration.value.createJournalTriggers===0))}}function St(t,m){if(t&1&&(i(0,"div",42)(1,"h3",43),o(2," Every "),n()()),t&2){let e=u(4);p("ngClass",A(2,lt,e.form.controls.posIntegration.value.createJournalTriggers===1)),a(),p("ngClass",A(4,mt,e.form.controls.posIntegration.value.createJournalTriggers===1))}}function yt(t,m){if(t&1&&g(0,bt,3,6,"div",42)(1,St,3,6,"div",42),t&2){let e,r=u().$implicit;re((e=r.key)===0?0:e===1?1:-1)}}function It(t,m){t&1&&(i(0,"h4"),o(1,"Suitable for Cash Sales (Retail & FnB)"),n(),i(2,"p"),o(3," One Journal is generated for all transaction happening within a register open - close period "),n())}function Et(t,m){t&1&&(i(0,"h4"),o(1,"Every"),n(),i(2,"p"),o(3," Suitable for Credit Sales (Wholesale) Journal is generated for each transaction "),n())}function Ft(t,m){if(t&1){let e=h();i(0,"div",14),c(1,"p-radiobutton",40),i(2,"p-card",41),I("click",function(){v(e);let l=u(2);return C(l.changeJournalType())}),g(3,yt,2,1,"ng-template",null,3,d)(5,It,4,0)(6,Et,4,0),n()()}if(t&2){let e,r=m.$implicit;a(),p("inputId",r.value)("value",r.key),a(4),re((e=r.key)===0?5:e===1?6:-1)}}function At(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",44),i(2,"label",45),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Tt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",46),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Nt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",48),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function wt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",49),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Mt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",8)(3,"p-tablist"),S(4,xt,2,2,"p-tab",9,b),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"h4",10),o(9,"Integration with POS"),n(),i(10,"p"),o(11,"Generate Journal"),n(),i(12,"div",11)(13,"div",12)(14,"div",13),S(15,Ft,7,3,"div",14,b),n()()(),c(17,"hr"),i(18,"div",15)(19,"h3",10),o(20,"Journal Generate"),n(),i(21,"p"),o(22,"Configure generate transaction"),n(),i(23,"div",16)(24,"div")(25,"div",17)(26,"label",18),o(27,"Generate EOD Expense Journal"),n(),c(28,"p-toggleswitch",19),n()(),i(29,"div")(30,"div",17)(31,"label",18),o(32,"Generate Outlet Delivery Journal"),n(),c(33,"p-toggleswitch",20),n()(),i(34,"div")(35,"div",17)(36,"label",18),o(37,"Generate Payment Discount Journal On Payment"),n(),c(38,"p-toggleswitch",21),n()()()()(),i(39,"p-tabpanel",22)(40,"div",23)(41,"h3",10),o(42,"Accounting Numbering"),n(),i(43,"p"),o(44,"Configure numbering format and rule for your accounting"),n(),i(45,"div",13)(46,"div",24)(47,"div",25)(48,"div",24)(49,"div",17)(50,"label",26),o(51,"Digit"),n(),c(52,"p-inputnumber",27),n()(),i(53,"div",24)(54,"div",17)(55,"label",28),o(56,"Seed"),n(),c(57,"p-inputnumber",29),n()(),i(58,"div",24)(59,"div",17)(60,"label",30),o(61,"Last Number"),n(),c(62,"p-inputnumber",31),n()(),i(63,"div",24)(64,"div",17)(65,"label",18),o(66,"Format"),n(),c(67,"p-select",32),n()(),i(68,"div",24)(69,"div",17)(70,"label",18),o(71,"Reset Every"),n(),i(72,"div",33),S(73,At,4,4,"div",34,b),n()()()()()()()(),i(75,"p-tabpanel",35)(76,"div",23)(77,"h3",10),o(78,"Report"),n(),i(79,"p"),o(80,"Configure report behavior"),n(),i(81,"div",13)(82,"div",24)(83,"div",25)(84,"div",24)(85,"div",17)(86,"label",18),o(87,"Audit Journal Transaction"),n(),i(88,"div",36),S(89,Tt,4,4,"div",34,b),n()()(),c(91,"div",24),i(92,"div",24)(93,"div",17)(94,"label",18),o(95,"Accounting For Treatment"),n(),i(96,"div",36),S(97,Nt,4,4,"div",34,b),n()()(),c(99,"div",24),i(100,"div",24)(101,"div",17)(102,"label",18),o(103,"Configure Report Access Control in COA"),n(),i(104,"div",36),S(105,wt,4,4,"div",34,b),n()()()()()()()(),i(107,"p-tabpanel",37)(108,"div",23)(109,"h3",10),o(110,"Note"),n(),i(111,"p"),o(112,"Configure show note"),n(),i(113,"div",13)(114,"div",24)(115,"div",25)(116,"div",24)(117,"div",17)(118,"label",18),o(119,"Note Required On Journal"),n(),c(120,"p-toggleswitch",38),n()(),c(121,"div",24),i(122,"div",24)(123,"div",17)(124,"label",18),o(125,"Trial Balance Footer Visible"),n(),c(126,"p-toggleswitch",39),n()(),c(127,"div",24),n()()()()()()()()),t&2){let e,r,l,f,W,D,_=u();K(G(9,Ct)),a(2),p("value",0)("formGroup",_.form),a(2),y(_.tabs()),a(3),p("value",0),a(8),y((e=_.accountingIntegration())==null||e.options==null?null:e.options.journalType),a(24),p("value",1),a(28),p("options",(r=_.accountingIntegration())==null||r.options==null?null:r.options.monthlyResetPeriodFormat),a(6),y((l=_.accountingIntegration())==null||l.options==null?null:l.options.resetPeriods),a(2),p("value",2),a(14),y((f=_.accountingIntegration())==null||f.options==null?null:f.options.auditType),a(8),y((W=_.accountingIntegration())==null||W.options==null?null:W.options.generatePrepaidJournal),a(8),y((D=_.accountingIntegration())==null||D.options==null?null:D.options.entityAccess),a(2),p("value",3)}}var pt=(()=>{class t{constructor(){this.accountingSetupService=s(x),this.fb=s(V).nonNullable,this.tabs=P(["Pos","Numbering","Report","Note"]),this.journalType=P(0),this.accountingIntegration=P(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({posIntegration:this.createPosIntegrationGroup(),number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup(),note:this.createNoteGroup()})}createPosIntegrationGroup(){return this.fb.group({createJournalTriggers:this.fb.control(0)})}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("")})}createNoteGroup(){return this.fb.group({noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}changeJournalType(){let e=this.journalType()===0?1:0;this.journalType.set(e),this.accountingIntegration.update(r=>H(q({},r),{form:H(q({},r.form),{posIntegration:H(q({},r.form.posIntegration),{createJournalTriggers:e})})})),this.form.controls.posIntegration.patchValue({createJournalTriggers:e})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(B(e=>{this.accountingIntegration.set(e);let r=e.form.posIntegration.createJournalTriggers;this.journalType.set(r),this.form.get("posIntegration.createJournalTriggers")?.setValue(r),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["header",""],["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"],[1,"fs-5"],["formGroupName","posIntegration",1,"row"],[1,"col-8"],[1,"row"],[1,"col"],["formGroupName","journalGenerate",1,""],[1,"d-flex","column-gap-5"],[1,"d-flex","flex-column"],["for","",1,"fs-4"],["formControlName","eodExpenseJournal"],["formControlName","transferOrder"],["formControlName","paymentDiscount"],["formGroupName","number",3,"value"],[1,""],[1,"col-6"],[1,"row","row-gap-3"],["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"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-2"],["formGroupName","note",3,"value"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["styleClass","d-none","name","createJournalTriggers","formControlName","createJournalTriggers",3,"inputId","value"],["styleClass","h-100",3,"click"],[1,"d-flex","justify-content-center","inactive-state","text-white","py-2",3,"ngClass"],[1,"m-0",3,"ngClass"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","accountingAuditType","formControlName","accountingAuditType",3,"value","inputId"],[1,"ml-2","m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"],["name","accountingEntityAccess","formControlName","accountingEntityAccess",3,"value","inputId"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,ht,4,0,"ng-template",null,0,d)(3,Mt,128,10,"ng-template",null,1,d),n())},dependencies:[T,Q,ot,it,nt,tt,Ze,et,M,ne,De,Ve,Re,j,N,O,k,R,X,w,ke,Oe,Ue,ze,Ee,Ie,L,$,Je,Pe,te,ee],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 Dt=()=>({height:"calc(100vh - 250px)"}),Gt=()=>[],ct=()=>({});function Bt(t,m){if(t&1){let e=h();i(0,"div")(1,"p-button",6),I("onClick",function(){v(e);let l=u();return C(l.submitForm())}),n()()}}function Pt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Date"),n(),c(3,"p-datePicker",14),n())}function Jt(t,m){t&1&&(i(0,"tr")(1,"th",20),o(2,"Account Name"),n(),i(3,"th",21),o(4,"Debit"),n(),i(5,"th",21),o(6,"Credit"),n()())}function Ot(t,m){if(t&1&&(i(0,"tr",10)(1,"td",20),o(2),n(),i(3,"td"),c(4,"input",22),n(),i(5,"td"),c(6,"input",23),n()()),t&2){let e,r=m.$implicit,l=m.rowIndex,f=u(4);p("formGroupName",l),a(2),ae(" ",(e=f.asFormGroup(r).get("accountName"))==null?null:e.value," "),a(2),p("autoNumeric",G(4,ct)),a(2),p("autoNumeric",G(5,ct))}}function kt(t,m){if(t&1&&(i(0,"div",10)(1,"h4",15),o(2),n(),i(3,"div",16)(4,"p-table",17),g(5,Jt,7,0,"ng-template",18)(6,Ot,7,6,"ng-template",19),n()()()),t&2){let e=m.$implicit,r=m.$index,l=u(3);p("formGroupName",r),a(2),ae(" ",e.get("name").value," "),a(2),p("value",l.getItemsArray(l.asFormGroup(e)).controls)}}function Rt(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"p",24),o(3,"Total"),n()(),i(4,"td",25)(5,"p",24),o(6),le(7,"number"),n()(),i(8,"td",25)(9,"p",24),o(10),le(11,"number"),n()()()),t&2){let e=u(3);a(6),E(me(7,2,e.subtotalDebit)),a(4),E(me(11,4,e.subtotalCredit))}}function Vt(t,m){if(t&1&&(i(0,"p-panel",8),g(1,Pt,4,0,"ng-template",null,2,d),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),S(6,kt,7,3,"div",10,b),n()(),i(8,"p-table",11),g(9,Rt,12,6,"ng-template",null,3,d),n()()),t&2){let e=u(2);p("formGroup",e.formGroups),a(4),K(G(4,Dt)),a(2),y(e.formsArray.controls),a(2),p("value",G(5,Gt))}}function jt(t,m){if(t&1&&g(0,Vt,11,6,"p-panel",7),t&2){let e=u();p("ngIf",e.formGroups)}}var st=(()=>{class t{constructor(){this.destroy$=new ue,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=s(V),this.accSetupService=s(x),this.dayjsService=s(We),this.date=new Date,this.routes=s(ye)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(de(300),fe(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 r=e.map(l=>this.createItemGroup(l));return this.fb.array(r)}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(se(e=>e.data),Le("response"),B(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(l=>l.items&&l.items.length>0).forEach(l=>{this.formsArray.push(this.createFormGroup(l))})})).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(r=>{let l=this.getItemsArray(r),f=l.controls.reduce((D,_)=>{let oe=_.get("debitAmount").value||0;return D+oe},0),W=l.controls.reduce((D,_)=>{let oe=_.get("creditAmount").value||0;return D+oe},0);this.subtotalDebit+=f,this.subtotalCredit+=W})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((r,[l,f])=>(l==="date"?r[l]=f instanceof Date?this.dayjsService.format(f):f:l==="forms"?r.form=f:r[l]=f,r),{});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(r){return new(r||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-acc-opening-balance-form"]],features:[xe([we])],decls:6,vars:0,consts:[["actionButton",""],["content",""],["header",""],["footer",""],["pageTitle","Opening Balance Form"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[3,"value"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],["formControlName","debitAmount",1,"fs-3","form-control",3,"autoNumeric"],["formControlName","creditAmount",1,"fs-3","form-control",3,"autoNumeric"],[1,"fw-semibold","fs-4"],[1,"text-end",2,"width","200px"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,Bt,2,0,"ng-template",null,0,d)(3,jt,1,1,"ng-template",null,1,d),n(),c(5,"p-toast",5))},dependencies:[M,ne,Me,T,be,Se,Be,Ge,$e,je,te,ee,Y,J,N,O,w,Qe,L,$,U,z,qe,j,k,R,X,Ne,Ye,Xe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var dt=t=>({"ng-invalid ng-dirty":t});function Lt(t,m){if(t&1){let e=h();i(0,"p-button",4),I("onClick",function(){v(e);let l=u();return C(l.saveCredentials())}),o(1,"Update"),n()}}function zt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Account"),n(),i(3,"small",14),o(4,"Configure Client ID and Client Secret"),n()())}function Ut(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,zt,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),o(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),o(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=u();a(4),p("formGroup",e.credentialForm),a(5),p("ngClass",A(3,dt,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),a(5),p("ngClass",A(5,dt,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var ft=(()=>{class t{constructor(e){this.fb=e,this.setupService=s(x)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(B(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.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()}static{this.\u0275fac=function(r){return new(r||t)(_e(V))}}static{this.\u0275cmp=F({type:t,selectors:[["app-api-credential"]],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(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Lt,2,0,"ng-template",null,0,d)(3,Ut,15,7,"ng-template",null,1,d),n())},dependencies:[T,Q,j,J,N,O,k,R,w,Z,U,z,M,L,$],encapsulation:2})}}return t})();function Wt(t,m){if(t&1){let e=h();i(0,"button",4),I("click",function(){v(e);let l=u();return C(l.onFormatJournal())}),o(1," Format "),n()}}function qt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),o(3,"Journal Configuration"),n(),i(4,"small",15),o(5," Enter your account information to format journal entries "),n()()())}function Ht(t,m){if(t&1){let e=h();i(0,"div",5)(1,"p-panel"),g(2,qt,6,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),he("ngModelChange",function(l){v(e);let f=u();return Ce(f.subdomain,l)||(f.subdomain=l),C(l)}),n(),i(8,"label",10),o(9,"Subdomain"),n()(),i(10,"small",11),o(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=u();a(7),ve("ngModel",e.subdomain)}}var gt=(()=>{class t{constructor(){this.setupService=s(x),this.subdomain=P(""),this.toastrService=s(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(r){return new(r||t)}}static{this.\u0275cmp=F({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(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Wt,2,0,"ng-template",null,0,d)(3,Ht,12,1,"ng-template",null,1,d),n())},dependencies:[T,Y,J,N,Te,w,Z,M,U,z,Ke,He],encapsulation:2})}}return t})();var _t=()=>s(x).fetchOpeningBalanceFormConfiguration();var Mi=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"accounting-integration",component:pt},{path:"opening-balance-form",component:st,resolve:{data:_t}},{path:"api-crendetial",component:ft},{path:"format-journal",component:gt},{path:"closing-entries",loadComponent:()=>import("./chunk-CGUMUBB7.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-NOZEL54G.js").then(t=>t.ClosingFormComponent)}]}];export{Mi as ACCOUNTING_SETUP_ROUTES};
|
package/chunk-NRULEUE7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function l(t,n,c="application/octet-stream"){let d=new Blob([t],{type:c}),e=window.URL.createObjectURL(d),o=document.createElement("a");o.href=e,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(e)}export{l as a};
|
package/chunk-ONMFMNUN.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import{a as j}from"./chunk-27P5HOS3.js";import{a as P}from"./chunk-G4XX7EU2.js";import{a as Ct,b as bt}from"./chunk-TIX3GAPF.js";import{b as Jn,c as ei}from"./chunk-6PS3NJ62.js";import{a as vt}from"./chunk-RLR2HFSC.js";import{a as Kt,b as qe}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as xt}from"./chunk-H6BPUKCW.js";import{a as Lt}from"./chunk-K4ALA724.js";import{a as Xt,b as ht,c as zn,d as yt}from"./chunk-NR3EHEG3.js";import{a as Rn}from"./chunk-DXIZC3FM.js";import{a as Mn}from"./chunk-XYU65DNE.js";import{b as Pn,c as An}from"./chunk-KANHSSLO.js";import{a as Fn,b as Vn}from"./chunk-ZHU3HOWQ.js";import"./chunk-Z3SHAW6W.js";import{a as Ge,b as xe}from"./chunk-JZTK7BS7.js";import"./chunk-DJAICZNR.js";import{a as vi,b as Ci}from"./chunk-CZWWMQFD.js";import{a as gt,b as _t,d as Ce,i as Tn,j as kn,k as be}from"./chunk-CEZEYAWZ.js";import{a as $e,b as Ue}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as J}from"./chunk-C3N6HRIE.js";import{a as mt,b as pt}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import{a as He,b as Qe}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as Dn,b as ve}from"./chunk-7IPVVF6Y.js";import{a as hn,b as yn,c as Yt,d as Sn,e as dt,f as ut,g as ft,h as ne}from"./chunk-RYHNURUZ.js";import{a as qt,b as je,c as Be}from"./chunk-BX74ZLQG.js";import{a as Ne,b as Le}from"./chunk-CNLYDNON.js";import{a as ct,b as Cn,c as bn,d as xn,e as wn,f as In,g as En}from"./chunk-FTI2QPWV.js";import{d as $t,f as pn}from"./chunk-BDJHC5O6.js";import{a as Gt,b as yi,f as Ee,h as ge,k as Wt,m as Zt,n as _e,o as he,v as vn,w as ie,x as ye}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{A as Je,B as cn,C as Dt,D as dn,E as gi,Ea as oe,Ia as Qt,J as _i,L as Ut,Ma as fn,Na as Oe,Oa as gn,S as hi,Va as _n,aa as Ht,b as Re,c as U,e as Fe,f as Ve,g as fe,i as g,k as mn,l as Pe,m as lt,n as st,na as un,o as Ae,u as jt,v as Bt,y as ze,z as fi}from"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import{a as Me}from"./chunk-TDMJ2M6W.js";import{C as Te,E as ke,F as de,M as ue,a as an,c as De,d as ln,f as te,g as zt,h as Jt,i as sn,k as Ot,l as ce,m as X,n as St}from"./chunk-DAQCANBV.js";import{c as Nt,d as rt,f as Xe,h as at,i as di,k as ui}from"./chunk-F2X3VGZZ.js";import{Aa as Ui,Ab as Z,Ac as N,Bc as nt,Cb as f,Cc as nn,D as kt,Ga as z,I as tt,Ib as Zi,Jb as V,Jc as F,Kb as p,Kc as L,Lb as Yi,Lc as Y,Mc as C,Nb as H,Ob as $,Pb as it,Qb as ae,Sb as le,Tb as se,Ub as r,V as Bi,Vb as o,Vc as on,Wb as d,X as We,Xb as Q,Yb as G,Yc as q,Z as D,Zb as Se,Zc as ot,_b as b,_c as rn,ba as Ze,bb as Hi,c as pi,ca as Mt,cb as Ie,dc as y,ec as c,fb as Qi,g as we,ga as Rt,gb as a,ha as v,ic as ci,jc as me,kc as O,lb as Gi,lc as T,mb as Ye,mc as k,n as et,ob as qi,pa as _,pc as Pt,qa as h,qc as m,ra as re,rc as S,s as ee,sc as I,ta as W,tc as At,u as ji,uc as Xi,va as $i,vc as Ki,wb as R,wc as en,xb as Vt,xc as tn,yb as Wi,yc as pe,za as Ft,zc as M}from"./chunk-WCXWWANV.js";import{a as w,b as E,e as Ke}from"./chunk-YQFG5XE2.js";var On=(()=>{class t extends ge{static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275cmp=R({type:t,selectors:[["EyeIcon"]],features:[Z],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M0.0535499 7.25213C0.208567 7.59162 2.40413 12.4 7 12.4C11.5959 12.4 13.7914 7.59162 13.9465 7.25213C13.9487 7.2471 13.9506 7.24304 13.952 7.24001C13.9837 7.16396 14 7.08239 14 7.00001C14 6.91762 13.9837 6.83605 13.952 6.76001C13.9506 6.75697 13.9487 6.75292 13.9465 6.74788C13.7914 6.4084 11.5959 1.60001 7 1.60001C2.40413 1.60001 0.208567 6.40839 0.0535499 6.74788C0.0512519 6.75292 0.0494023 6.75697 0.048 6.76001C0.0163137 6.83605 0 6.91762 0 7.00001C0 7.08239 0.0163137 7.16396 0.048 7.24001C0.0494023 7.24304 0.0512519 7.2471 0.0535499 7.25213ZM7 11.2C3.664 11.2 1.736 7.92001 1.264 7.00001C1.736 6.08001 3.664 2.80001 7 2.80001C10.336 2.80001 12.264 6.08001 12.736 7.00001C12.264 7.92001 10.336 11.2 7 11.2ZM5.55551 9.16182C5.98308 9.44751 6.48576 9.6 7 9.6C7.68891 9.59789 8.349 9.32328 8.83614 8.83614C9.32328 8.349 9.59789 7.68891 9.59999 7C9.59999 6.48576 9.44751 5.98308 9.16182 5.55551C8.87612 5.12794 8.47006 4.7947 7.99497 4.59791C7.51988 4.40112 6.99711 4.34963 6.49276 4.44995C5.98841 4.55027 5.52513 4.7979 5.16152 5.16152C4.7979 5.52513 4.55027 5.98841 4.44995 6.49276C4.34963 6.99711 4.40112 7.51988 4.59791 7.99497C4.7947 8.47006 5.12794 8.87612 5.55551 9.16182ZM6.2222 5.83594C6.45243 5.6821 6.7231 5.6 7 5.6C7.37065 5.6021 7.72553 5.75027 7.98762 6.01237C8.24972 6.27446 8.39789 6.62934 8.4 7C8.4 7.27689 8.31789 7.54756 8.16405 7.77779C8.01022 8.00802 7.79157 8.18746 7.53575 8.29343C7.27994 8.39939 6.99844 8.42711 6.72687 8.37309C6.4553 8.31908 6.20584 8.18574 6.01005 7.98994C5.81425 7.79415 5.68091 7.54469 5.6269 7.27312C5.57288 7.00155 5.6006 6.72006 5.70656 6.46424C5.81253 6.20842 5.99197 5.98977 6.2222 5.83594Z","fill","currentColor"]],template:function(n,i){n&1&&(re(),r(0,"svg",0),d(1,"path",1),o()),n&2&&($(i.getClassNames()),V("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Nn=(()=>{class t extends ge{pathId;ngOnInit(){this.pathId="url(#"+oe()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275cmp=R({type:t,selectors:[["RefreshIcon"]],features:[Z],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.77051 5.96336C6.84324 5.99355 6.92127 6.00891 7.00002 6.00854C7.07877 6.00891 7.1568 5.99355 7.22953 5.96336C7.30226 5.93317 7.36823 5.88876 7.42357 5.83273L9.82101 3.43529C9.93325 3.32291 9.99629 3.17058 9.99629 3.01175C9.99629 2.85292 9.93325 2.70058 9.82101 2.5882L7.42357 0.190763C7.3687 0.131876 7.30253 0.0846451 7.22901 0.0518865C7.15549 0.019128 7.07612 0.00151319 6.99564 9.32772e-05C6.91517 -0.00132663 6.83523 0.0134773 6.7606 0.0436218C6.68597 0.0737664 6.61817 0.118634 6.56126 0.175548C6.50435 0.232462 6.45948 0.300257 6.42933 0.374888C6.39919 0.449519 6.38439 0.529456 6.38581 0.609933C6.38722 0.690409 6.40484 0.769775 6.4376 0.843296C6.47036 0.916817 6.51759 0.982986 6.57647 1.03786L7.95103 2.41241H6.99998C5.46337 2.41241 3.98969 3.02283 2.90314 4.10938C1.81659 5.19593 1.20618 6.66961 1.20618 8.20622C1.20618 9.74283 1.81659 11.2165 2.90314 12.3031C3.98969 13.3896 5.46337 14 6.99998 14C8.53595 13.9979 10.0084 13.3868 11.0945 12.3007C12.1806 11.2146 12.7917 9.74218 12.7938 8.20622C12.7938 8.04726 12.7306 7.89481 12.6182 7.78241C12.5058 7.67001 12.3534 7.60686 12.1944 7.60686C12.0355 7.60686 11.883 7.67001 11.7706 7.78241C11.6582 7.89481 11.5951 8.04726 11.5951 8.20622C11.5951 9.11504 11.3256 10.0035 10.8207 10.7591C10.3157 11.5148 9.59809 12.1037 8.75845 12.4515C7.9188 12.7993 6.99489 12.8903 6.10353 12.713C5.21217 12.5357 4.3934 12.0981 3.75077 11.4554C3.10813 10.8128 2.67049 9.99404 2.49319 9.10268C2.31589 8.21132 2.40688 7.2874 2.75468 6.44776C3.10247 5.60811 3.69143 4.89046 4.44709 4.38554C5.20275 3.88063 6.09116 3.61113 6.99998 3.61113H7.95098L6.57647 4.98564C6.46423 5.09802 6.40119 5.25035 6.40119 5.40918C6.40119 5.56801 6.46423 5.72035 6.57647 5.83273C6.63181 5.88876 6.69778 5.93317 6.77051 5.96336Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(re(),r(0,"svg",0)(1,"g"),d(2,"path",1),o(),r(3,"defs")(4,"clipPath",2),d(5,"rect",3),o()()()),n&2&&($(i.getClassNames()),V("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),a(),V("clip-path",i.pathId),a(3),p("id",i.pathId))},encapsulation:2})}return t})();var Ln=(()=>{class t extends ge{pathId;ngOnInit(){this.pathId="url(#"+oe()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275cmp=R({type:t,selectors:[["SearchMinusIcon"]],features:[Z],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.0208 12.0411C4.83005 12.0411 3.66604 11.688 2.67596 11.0265C1.68589 10.3649 0.914216 9.42464 0.458534 8.32452C0.00285271 7.22441 -0.116374 6.01388 0.11593 4.84601C0.348235 3.67813 0.921637 2.60537 1.76363 1.76338C2.60562 0.921393 3.67838 0.34799 4.84625 0.115686C6.01412 -0.116618 7.22466 0.00260857 8.32477 0.45829C9.42488 0.913972 10.3652 1.68564 11.0267 2.67572C11.6883 3.66579 12.0414 4.8298 12.0414 6.02056C12.0395 7.41563 11.5542 8.76029 10.6783 9.8305L13.8244 12.9765C13.9367 13.089 13.9997 13.2414 13.9997 13.4003C13.9997 13.5592 13.9367 13.7116 13.8244 13.8241C13.769 13.8801 13.703 13.9245 13.6302 13.9548C13.5575 13.985 13.4794 14.0003 13.4006 14C13.3218 14.0003 13.2437 13.985 13.171 13.9548C13.0982 13.9245 13.0322 13.8801 12.9768 13.8241L9.83082 10.678C8.76059 11.5539 7.4159 12.0393 6.0208 12.0411ZM6.0208 1.20731C5.07199 1.20731 4.14449 1.48867 3.35559 2.0158C2.56669 2.54292 1.95181 3.29215 1.58872 4.16874C1.22562 5.04532 1.13062 6.00989 1.31572 6.94046C1.50083 7.87104 1.95772 8.72583 2.62863 9.39674C3.29954 10.0676 4.15433 10.5245 5.0849 10.7096C6.01548 10.8947 6.98005 10.7997 7.85663 10.4367C8.73322 10.0736 9.48244 9.45868 10.0096 8.66978C10.5367 7.88088 10.8181 6.95337 10.8181 6.00457C10.8181 4.73226 10.3126 3.51206 9.41297 2.6124C8.51331 1.71274 7.29311 1.20731 6.0208 1.20731ZM4.00591 6.60422H8.00362C8.16266 6.60422 8.31518 6.54104 8.42764 6.42859C8.5401 6.31613 8.60328 6.1636 8.60328 6.00456C8.60328 5.84553 8.5401 5.693 8.42764 5.58054C8.31518 5.46809 8.16266 5.40491 8.00362 5.40491H4.00591C3.84687 5.40491 3.69434 5.46809 3.58189 5.58054C3.46943 5.693 3.40625 5.84553 3.40625 6.00456C3.40625 6.1636 3.46943 6.31613 3.58189 6.42859C3.69434 6.54104 3.84687 6.60422 4.00591 6.60422Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(re(),r(0,"svg",0)(1,"g"),d(2,"path",1),o(),r(3,"defs")(4,"clipPath",2),d(5,"rect",3),o()()()),n&2&&($(i.getClassNames()),V("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),a(),V("clip-path",i.pathId),a(3),p("id",i.pathId))},encapsulation:2})}return t})();var jn=(()=>{class t extends ge{pathId;ngOnInit(){this.pathId="url(#"+oe()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275cmp=R({type:t,selectors:[["SearchPlusIcon"]],features:[Z],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.67596 11.0265C3.66604 11.688 4.83005 12.0411 6.0208 12.0411C6.81143 12.0411 7.59432 11.8854 8.32477 11.5828C8.86999 11.357 9.37802 11.0526 9.83311 10.6803L12.9768 13.8241C13.0322 13.8801 13.0982 13.9245 13.171 13.9548C13.2437 13.985 13.3218 14.0003 13.4006 14C13.4794 14.0003 13.5575 13.985 13.6302 13.9548C13.703 13.9245 13.769 13.8801 13.8244 13.8241C13.9367 13.7116 13.9997 13.5592 13.9997 13.4003C13.9997 13.2414 13.9367 13.089 13.8244 12.9765L10.6806 9.8328C11.0529 9.37773 11.3572 8.86972 11.5831 8.32452C11.8856 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0267 2.67572C10.3652 1.68564 9.42488 0.913972 8.32477 0.45829C7.22466 0.00260857 6.01412 -0.116618 4.84625 0.115686C3.67838 0.34799 2.60562 0.921393 1.76363 1.76338C0.921637 2.60537 0.348235 3.67813 0.11593 4.84601C-0.116374 6.01388 0.00285271 7.22441 0.458534 8.32452C0.914216 9.42464 1.68589 10.3649 2.67596 11.0265ZM3.35559 2.0158C4.14449 1.48867 5.07199 1.20731 6.0208 1.20731C7.29311 1.20731 8.51331 1.71274 9.41297 2.6124C10.3126 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5367 7.88088 10.0096 8.66978C9.48244 9.45868 8.73322 10.0736 7.85663 10.4367C6.98005 10.7997 6.01548 10.8947 5.0849 10.7096C4.15433 10.5245 3.29954 10.0676 2.62863 9.39674C1.95772 8.72583 1.50083 7.87104 1.31572 6.94046C1.13062 6.00989 1.22562 5.04532 1.58872 4.16874C1.95181 3.29215 2.56669 2.54292 3.35559 2.0158ZM6.00481 8.60309C5.84641 8.60102 5.69509 8.53718 5.58308 8.42517C5.47107 8.31316 5.40722 8.16183 5.40515 8.00344V6.60422H4.00591C3.84687 6.60422 3.69434 6.54104 3.58189 6.42859C3.46943 6.31613 3.40625 6.1636 3.40625 6.00456C3.40625 5.84553 3.46943 5.693 3.58189 5.58054C3.69434 5.46809 3.84687 5.40491 4.00591 5.40491H5.40515V4.00572C5.40515 3.84668 5.46833 3.69416 5.58079 3.5817C5.69324 3.46924 5.84577 3.40607 6.00481 3.40607C6.16385 3.40607 6.31637 3.46924 6.42883 3.5817C6.54129 3.69416 6.60447 3.84668 6.60447 4.00572V5.40491H8.00362C8.16266 5.40491 8.31518 5.46809 8.42764 5.58054C8.5401 5.693 8.60328 5.84553 8.60328 6.00456C8.60328 6.1636 8.5401 6.31613 8.42764 6.42859C8.31518 6.54104 8.16266 6.60422 8.00362 6.60422H6.60447V8.00344C6.60239 8.16183 6.53855 8.31316 6.42654 8.42517C6.31453 8.53718 6.1632 8.60102 6.00481 8.60309Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(re(),r(0,"svg",0)(1,"g"),d(2,"path",1),o(),r(3,"defs")(4,"clipPath",2),d(5,"rect",3),o()()()),n&2&&($(i.getClassNames()),V("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),a(),V("clip-path",i.pathId),a(3),p("id",i.pathId))},encapsulation:2})}return t})();var Bn=(()=>{class t extends ge{pathId;ngOnInit(){this.pathId="url(#"+oe()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275cmp=R({type:t,selectors:[["UndoIcon"]],features:[Z],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.77042 5.96336C6.84315 5.99355 6.92118 6.00891 6.99993 6.00854C7.07868 6.00891 7.15671 5.99355 7.22944 5.96336C7.30217 5.93317 7.36814 5.88876 7.42348 5.83273C7.53572 5.72035 7.59876 5.56801 7.59876 5.40918C7.59876 5.25035 7.53572 5.09802 7.42348 4.98564L6.04897 3.61113H6.99998C7.9088 3.61113 8.79722 3.88063 9.55288 4.38554C10.3085 4.89046 10.8975 5.60811 11.2453 6.44776C11.5931 7.2874 11.6841 8.21132 11.5068 9.10268C11.3295 9.99404 10.8918 10.8128 10.2492 11.4554C9.60657 12.0981 8.7878 12.5357 7.89644 12.713C7.00508 12.8903 6.08116 12.7993 5.24152 12.4515C4.40188 12.1037 3.68422 11.5148 3.17931 10.7591C2.67439 10.0035 2.4049 9.11504 2.4049 8.20622C2.4049 8.04726 2.34175 7.89481 2.22935 7.78241C2.11695 7.67001 1.9645 7.60686 1.80554 7.60686C1.64658 7.60686 1.49413 7.67001 1.38172 7.78241C1.26932 7.89481 1.20618 8.04726 1.20618 8.20622C1.20829 9.74218 1.81939 11.2146 2.90548 12.3007C3.99157 13.3868 5.46402 13.9979 6.99998 14C8.5366 14 10.0103 13.3896 11.0968 12.3031C12.1834 11.2165 12.7938 9.74283 12.7938 8.20622C12.7938 6.66961 12.1834 5.19593 11.0968 4.10938C10.0103 3.02283 8.5366 2.41241 6.99998 2.41241H6.04892L7.42348 1.03786C7.48236 0.982986 7.5296 0.916817 7.56235 0.843296C7.59511 0.769775 7.61273 0.690409 7.61415 0.609933C7.61557 0.529456 7.60076 0.449519 7.57062 0.374888C7.54047 0.300257 7.49561 0.232462 7.43869 0.175548C7.38178 0.118634 7.31398 0.0737664 7.23935 0.0436218C7.16472 0.0134773 7.08478 -0.00132663 7.00431 9.32772e-05C6.92383 0.00151319 6.84447 0.019128 6.77095 0.0518865C6.69742 0.0846451 6.63126 0.131876 6.57638 0.190763L4.17895 2.5882C4.06671 2.70058 4.00366 2.85292 4.00366 3.01175C4.00366 3.17058 4.06671 3.32291 4.17895 3.43529L6.57638 5.83273C6.63172 5.88876 6.69769 5.93317 6.77042 5.96336Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,i){n&1&&(re(),r(0,"svg",0)(1,"g"),d(2,"path",1),o(),r(3,"defs")(4,"clipPath",2),d(5,"rect",3),o()()()),n&2&&($(i.getClassNames()),V("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),a(),V("clip-path",i.pathId),a(3),p("id",i.pathId))},encapsulation:2})}return t})();var po={filter:{transID:"",bulkID:"",rowCount:20,pageNumber:1,orderByDesc:!1,sortByDate:!1,auditEditor:!1,listOutletID:[],searchAudit:!1,number:"",from:new Date().toISOString(),to:""},data:[],count:0,metadata:{filter:{transID:"",bulkID:"",rowCount:20,pageNumber:1,orderByDesc:!1,sortByDate:!1,auditEditor:!1,listOutletID:[],searchAudit:!1,number:"",from:"",to:""},options:{outlets:[],sortBy:[],orderBy:[]},roles:{hasAccountingClosingEditor:!1,hasAccountingCreate:!1,hasAccountingEditor:!1,hasAccountingDelete:!1}}},bi=Cn(In(po),En("JournalEntryStore"),bn(t=>({first:q(()=>(t.filter().pageNumber-1)*t.filter().rowCount+1),end:q(()=>Math.min(t.filter().pageNumber*t.filter().rowCount,t.count())),selectedItems:q(()=>t.data().filter(l=>l.checked))})),wn(t=>{let l=v(j),e={updateCount(n){ct(t,i=>E(w({},i),{count:n}))},updateFilter(n){ct(t,i=>E(w({},i),{filter:w(w({},i.filter),n),metadata:E(w({},i.metadata),{paginator:!1})}))},loadJournalEntryLoader:vi(pi(We(()=>l.getJournalEntryLoader().pipe(Ci({next:n=>{console.log("response",n),ct(t,i=>E(w({},i),{filter:E(w({},n.filter),{pageNumber:1}),metadata:n})),e.loadJournalEntryData(t.filter),console.log("store",t)},error(n){console.log("error",n)}}))))),loadJournalEntryData:vi(pi(kt(n=>!!n),We(n=>l.getJournalEntryData(n).pipe(ee(i=>E(w({},i),{data:i.data.map(s=>E(w({},s),{checked:!1}))})),ji(i=>l.getJournalEntryCount(n).pipe(ee(s=>({journalEntry:i,count:s})))),Ci({next({journalEntry:i,count:s}){ct(t,u=>E(w({},u),{data:i.data,count:s.count}))},error(i){console.log("error",i)}}),J("getJournalEntryData"))))),updateData:n=>{ct(t,i=>E(w({},i),{data:n}))}};return e}),xn({onInit(t){t.loadJournalEntryLoader()}}));var co=["dt"],uo=["filterRef"],fo=["class","page"],go=()=>({height:"calc(100vh - 70px)"}),_o=t=>[t],ho=t=>({id:t});function yo(t,l){if(t&1){let e=b();r(0,"p-button",16),y("onClick",function(){_(e);let i=c(2);return h(i.onDeleteJournalEntry())}),o()}}function vo(t,l){if(t&1){let e=b();r(0,"div",10),f(1,yo,1,0,"p-button",11),r(2,"p-button-group"),d(3,"p-button",12),r(4,"p-button",13),y("onClick",function(){_(e);let i=c();return h(i.onExportJournalEntry())}),o()(),r(5,"a",14),d(6,"i",15),r(7,"span"),m(8,"Add"),o()()()}if(t&2){let e=c();a(),p("ngIf",e.JournalEntryStore.selectedItems().length>0)}}function Co(t,l){t&1&&(r(0,"tr")(1,"th",18),d(2,"p-tableHeaderCheckbox"),o(),r(3,"th"),m(4,"Outlet"),o(),r(5,"th"),m(6,"Number"),o(),r(7,"th"),m(8,"Date/Name"),o(),r(9,"th"),m(10,"Description"),o(),r(11,"th"),m(12,"Account"),o(),r(13,"th",19),m(14,"Debit"),o(),r(15,"th",19),m(16,"Credit"),o()())}function bo(t,l){if(t&1&&(r(0,"a",22),m(1),o()),t&2){let e=c().$implicit,n=c(2);p("href",n.authService.getTenantExternalURL()+n.getReferenceUrl(e),Ie),a(),S(e.referenceText)}}function xo(t,l){if(t&1&&d(0,"span",23),t&2){let e=c().$implicit;p("innerHTML",e.referenceText,Hi)}}function wo(t,l){if(t&1&&(r(0,"span"),m(1),o()),t&2){let e=c().$implicit;a(),I("(",e.accountCode,")")}}function Io(t,l){if(t&1&&(r(0,"div",30),m(1),o()),t&2){let e=c().$implicit;a(),I(" ",e.note," ")}}function Eo(t,l){if(t&1&&(r(0,"div")(1,"a",26)(2,"span",27),m(3),o(),f(4,wo,2,1,"span",28),o(),f(5,Io,2,1,"div",29),o()),t&2){let e=l.$implicit;a(),p("queryParams",N(5,ho,e.accountID)),a(),p("pTooltip",e.accountName+" ("+e.accountCode+")"),a(),S(e.accountName),a(),p("ngIf",e.accountCode),a(),p("ngIf",e.note)}}function So(t,l){if(t&1&&(r(0,"span"),m(1),F(2,"number"),o()),t&2){let e=l.$implicit;a(),S(L(2,1,e.debitAmount))}}function Do(t,l){if(t&1&&(r(0,"span"),m(1),F(2,"number"),o()),t&2){let e=l.$implicit;a(),S(L(2,1,e.creditAmount))}}function To(t,l){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",20),o(),r(3,"td"),m(4),o(),r(5,"td")(6,"a",21),m(7),o()(),r(8,"td"),m(9),F(10,"date"),o(),r(11,"td"),f(12,bo,2,2,"a",22)(13,xo,1,1,"span",23),o(),r(14,"td")(15,"div",24),le(16,Eo,6,7,"div",null,ae),o()(),r(18,"td")(19,"div",25),le(20,So,3,3,"span",null,ae),o()(),r(22,"td")(23,"div",25),le(24,Do,3,3,"span",null,ae),o()()()),t&2){let e=l.$implicit,n=c(2);a(2),p("value",e),a(2),S(e.outletName),a(2),p("routerLink",N(10,_o,e.id)),a(),S(e.number),a(2),At("",Y(10,7,e.date,"dd MMM y")," / ",e.contactName,""),a(3),it(n.getReferenceUrl(e)?12:13),a(4),se(e.items),a(4),se(e.items),a(4),se(e.items)}}function ko(t,l){if(t&1&&m(0),t&2){let e=c(2);Xi(" Showing ",e.JournalEntryStore.first()," to ",e.JournalEntryStore.end()," of ",e.JournalEntryStore.count()," entries ")}}function Mo(t,l){t&1&&(r(0,"tr")(1,"td",31)(2,"span"),m(3," No journal entries found. "),o()()())}function Ro(t,l){if(t&1){let e=b();r(0,"p-panel")(1,"p-table",17,3),y("onPage",function(i){_(e);let s=c();return h(s.onPageChange(i))})("onRowSelect",function(i){_(e);let s=c();return h(s.onRowSelect(i))})("onRowUnselect",function(i){_(e);let s=c();return h(s.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let s=c();return h(s.onHeaderCheckboxToggle(i))}),f(3,Co,17,0,"ng-template",null,4,C)(5,To,26,12,"ng-template",null,5,C)(7,ko,1,3,"ng-template",null,6,C)(9,Mo,4,0,"ng-template",null,7,C),o()()}if(t&2){let e=c();H(M(10,go)),a(),p("resizableColumns",!0)("value",e.JournalEntryStore.data())("paginator",!0)("totalRecords",e.JournalEntryStore.count())("lazy",!0)("rows",e.JournalEntryStore.filter().rowCount)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")}}function Fo(t,l){if(t&1&&(r(0,"div",41)(1,"div"),m(2),o()()),t&2){let e=l.$implicit;a(2),S(e.name)}}function Vo(t,l){if(t&1&&(r(0,"div",40)(1,"div",42),d(2,"p-radiobutton",43),r(3,"label",44),m(4),o()()()),t&2){let e=l.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),S(e.value)}}function Po(t,l){if(t&1&&(r(0,"div",40)(1,"div",42),d(2,"p-radiobutton",45),r(3,"label",44),m(4),o()()()),t&2){let e=l.$implicit;a(2),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),S(e.value)}}function Ao(t,l){if(t&1&&(r(0,"form",33)(1,"div",24)(2,"label",34),m(3,"Outlet"),o(),r(4,"p-multiselect",35),f(5,Fo,3,1,"ng-template",null,8,C),o()(),r(7,"div",24)(8,"label",34),m(9,"From"),o(),d(10,"p-datepicker",36),o(),r(11,"div",24)(12,"label",34),m(13,"To"),o(),d(14,"p-datepicker",37),o(),r(15,"div",24)(16,"label",34),m(17,"Page Size"),o(),d(18,"input",38),o(),r(19,"div",24)(20,"label",34),m(21,"Order By Date"),o(),r(22,"div",39),le(23,Vo,5,4,"div",40,ae),o()(),r(25,"div",24)(26,"label",34),m(27,"Order By"),o(),r(28,"div",39),le(29,Po,5,4,"div",40,ae),o()()()),t&2){let e,n=c(2);p("formGroup",n.filterForm),a(4),p("virtualScroll",!0)("virtualScrollItemSize",50)("options",n.JournalEntryStore==null||(e=n.JournalEntryStore.metadata())==null||e.options==null?null:e.options.outlets)("showClear",!0),a(6),p("iconDisplay","input")("showIcon",!0),a(4),p("iconDisplay","input")("showIcon",!0),a(9),se(n.JournalEntryStore.metadata().options.sortBy),a(6),se(n.JournalEntryStore.metadata().options.orderBy)}}function zo(t,l){if(t&1&&f(0,Ao,31,9,"form",32),t&2){let e=c();p("ngIf",e.JournalEntryStore.metadata()&&e.filterForm)}}var Jo=[{key:0,value:"Unknown"},{key:1,value:"Sales Order"},{key:2,value:"Purchase Order"},{key:5,value:"OutDelivery"},{key:6,value:"InDelivery"},{key:7,value:"Adjustment"},{key:8,value:"AR Collection"},{key:9,value:"Manufacture"},{key:10,value:"End of Shift"},{key:12,value:"Opening Balance"},{key:13,value:"AP Collection"},{key:14,value:"InTransfer"},{key:15,value:"OutTransfer"},{key:16,value:"Prepaid"}],Un=(()=>{class t{constructor(){this.JournalEntryStore=v(bi),this.authService=v(Lt),this.modalService=v($t),this.journalEntryService=v(j),this.toastr=v(Me),this.fb=v(Bt),this.dayjs=v(qe),this.isDialogFilterVisible=z(!1),ot(()=>{this.JournalEntryStore.filter()&&this.generateFilterForm()})}ngOnInit(){console.log("Journal Entry Page")}onSearch(e){this.JournalEntryStore.updateFilter(E(w({},this.JournalEntryStore.filter()),{number:e}))}onFilterOKEvent(){let e=this.filterForm.getRawValue();this.JournalEntryStore.updateFilter(E(w({},this.JournalEntryStore.filter()),{from:this.dayjs.from(e.from)?this.dayjs.format(e.from):null,to:this.dayjs.from(e.to)?this.dayjs.format(e.from):null,pageNumber:1,rowCount:+e.rowCount,orderByDesc:e.orderByDesc,sortByDate:e.sortByDate,listOutletID:e.listOutletID})),this.isDialogFilterVisible.update(n=>!n)}generateFilterForm(){let e=this.JournalEntryStore.filter();this.filterForm=this.fb.group({from:[e.from?this.dayjs.from(e.from).toDate():null],to:[e.to?this.dayjs.from(e.to).toDate():null],rowCount:[e.rowCount],sortByDate:[e.sortByDate],orderByDesc:[e.orderByDesc],listOutletID:[e.listOutletID]})}onFilterChange(e){console.log("Filter Change",e),this.modalService.open(this.templateRef)}onRowSelect(e){this.updateRowSelection(e.data,!0)}onRowUnselect(e){Array.isArray(e.data)?this.JournalEntryStore.updateData(this.JournalEntryStore.data().map((n,i)=>n.id===e.data[i].id?E(w({},n),{checked:!1}):n)):e.data&&typeof e.data=="object"&&"id"in e.data&&this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(n=>n.id===e.data.id?E(w({},n),{checked:!1}):n))}updateRowSelection(e,n){this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(i=>i.id===e.id?E(w({},i),{checked:n}):i))}onHeaderCheckboxToggle(e){let n=this.JournalEntryStore.data().map(i=>E(w({},i),{checked:e.checked}));this.JournalEntryStore.updateData(n)}onPageChange(e){let n=e.first/e.rows;this.JournalEntryStore.updateFilter(E(w({},this.JournalEntryStore.filter()),{pageNumber:n+1}))}next(){this.JournalEntryStore.updateFilter(E(w({},this.JournalEntryStore.filter()),{pageNumber:this.JournalEntryStore.filter().pageNumber+1}))}prev(){this.JournalEntryStore.filter().pageNumber<=1||this.JournalEntryStore.updateFilter(E(w({},this.JournalEntryStore.filter()),{pageNumber:this.JournalEntryStore.filter().pageNumber-1}))}getJournalEntryCount(){this.journalEntryService.getJournalEntryCount(this.JournalEntryStore.filter()).pipe(D(e=>this.JournalEntryStore.updateCount(e.count))).subscribe()}onDeleteJournalEntry(){if(!confirm("Are you sure you want to delete the selected journal entries?"))return;let i=this.JournalEntryStore.selectedItems().map(s=>s.id);this.journalEntryService.deleteJournalEntry(i).pipe(D(()=>{this.JournalEntryStore.loadJournalEntryData(this.JournalEntryStore.filter())})).subscribe()}onExportJournalEntry(){let e=E(w({},this.JournalEntryStore.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.journalEntryService.getJournalEntryData(e,{responseType:"blob"}).pipe(J("Export Journal Entry"),D(n=>{let i=n.type,s=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(s,{type:i}));let x=`journal-entries.${i.split("/")[1]}`;u.setAttribute("download",x),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}getReferenceUrl(e){let n,i=Jo.map(s=>s.key).filter(s=>![0,12].includes(s));if(console.log("Reference Type ID:",i,e.referenceTypeID),!i.includes(e.referenceTypeID))return null;switch(e.referenceTypeID){case 1:n=`/menu/Orders/Orders/Customer_Invoice/Info?ID=${e.referenceID??e.id}`;break;case 2:n=`/menu/Orders/Orders/Supplier_Bill/Info?ID=${e.referenceID??e.id}`;break;case 5:n=`/menu/Logistics/Archive/Outbound_Logistics/Info?ID=${e.referenceID??e.id}`;break;case 6:n=`/menu/Logistics/Archive/Inbound_Logistics/Info?ID=${e.referenceID??e.id}`;break;case 7:n=`/menu/Adjustment/Adjustment/Archive/Info?ID=${e.referenceID??e.id}`;break;case 8:n=`/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID=${e.referenceID??e.id}`;break;case 9:n=`/menu/Manufacture/Job_Order/Archive/Info?ID=${e.referenceID??e.id}`;break;case 10:n=`/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID=${e.referenceID??e.id}`;break;case 12:n="#";break;case 13:n=`/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID=${e.referenceID??e.id}`;break;case 14:n=`/menu/Logistics/Archive/Transfer_Order/Info?ID=${e.referenceID??e.id}`;break;case 15:n=`/menu/Logistics/Archive/Transfer_Order/Info?ID=${e.referenceID??e.id}`;break;case 16:n=`/menu/Prepaid_Package/Dashboard/Prepaid_History/Info?ID=${e.referenceID??e.id}`;break;default:console.warn("Unknown reference type ID:",e.referenceTypeID),n=null}return n}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-entry",8,"page"]],viewQuery:function(n,i){if(n&1&&(O(co,5),O(uo,7)),n&2){let s;T(s=k())&&(i.table=s.first),T(s=k())&&(i.templateRef=s.first)}},features:[pe([bi])],attrs:fo,decls:7,vars:3,consts:[["actionButton",""],["content",""],["filters",""],["dt",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Manual Journal",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["type","button","routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["columnResizeMode","expand","dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","resizableColumns","value","paginator","totalRecords","lazy","rows","scrollable","scrollHeight"],[2,"width","40px"],[1,"text-end",2,"width","120px"],[3,"value"],[1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[1,"d-flex","flex-column"],[1,"d-flex","flex-column","align-items-end"],["routerLink","/pages/report/general-ledger",1,"link","link-primary","d-flex","gap-2",3,"queryParams"],["tooltipPosition","top",1,"text-truncate",2,"max-width","130px",3,"pTooltip"],[4,"ngIf"],["class","text-secondary fst-italic fst-1",4,"ngIf"],[1,"text-secondary","fst-italic","fst-1"],["colspan","8"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["display","chip","formControlName","listOutletID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["type","text","pInputText","","formControlName","rowCount"],[1,"row"],[1,"d-flex","col-lg-3"],[1,"flex","items-center","gap-2"],[1,"d-flex","align-items-baseline","gap-2"],["name","sortByDate","formControlName","sortByDate",3,"value","inputId"],[1,"",3,"for"],["name","orderByDesc","formControlName","orderByDesc",3,"value","inputId"]],template:function(n,i){if(n&1){let s=b();r(0,"app-main-panel",9),y("search",function(x){return _(s),h(i.onSearch(x))}),tn("isDialogFilterVisibleChange",function(x){return _(s),en(i.isDialogFilterVisible,x)||(i.isDialogFilterVisible=x),h(x)}),y("filterConfirmed",function(){return _(s),h(i.onFilterOKEvent())}),f(1,vo,9,1,"ng-template",null,0,C)(3,Ro,11,11,"ng-template",null,1,C)(5,zo,1,1,"ng-template",null,2,C),o()}n&2&&(p("isSearchableInput",!0)("isFilterable",!0),Ki("isDialogFilterVisible",i.isDialogFilterVisible))},dependencies:[ne,X,te,ce,Ot,Mn,pn,ue,de,be,Ce,Tn,kn,ye,ie,ve,Vn,Fn,Ue,$e,Be,je,ze,mn,Re,Fe,Ve,Pe,Ae,he,_e,_t,gt,Le,Ne,xe,Rn],encapsulation:2,changeDetection:0})}}return t})();var Ti=Ke(Kt());var Si=Ke(Kt()),Hn=t=>(0,Si.default)(t).isSame((0,Si.default)("0001-01-01T00:00:00"));var Di={accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec",DateEditor:"ActDE"}};var ri=(()=>{class t{constructor(){this._roles=[],this.authService=v(Lt),this.assignRolesFromJWT()}parseJWT(e){let i=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(i).split("").map(function(u){return"%"+("00"+u.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(s)}assignRolesFromJWT(){let e=localStorage.getItem("AUTH_POS_TOKEN");if(!e){this.authService.logout();return}try{let n=this.parseJWT(e);if(this.authService.isTokenExpired()){this.authService.logout();return}this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]||[]}catch(n){this._roles=[],console.error("Failed to parse JWT:",n),this.authService.logout()}}isUserHasRole(e){return this._roles.includes(e)}setBulkRole(e){let n={};for(let i in Di[e])n[i]=this.isUserHasRole(Di[e][i]);return n}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Oo=["scrollPanelContainer"],No=["class","page"],Lo=()=>({width:"25rem"}),jo=()=>({width:"100%"}),Bo=()=>({height:"calc(100vh - 140px)"}),$o=()=>({"max-width":"100%","min-width":"50%"}),Uo=()=>({});function Ho(t,l){if(t&1){let e=b();r(0,"div",23)(1,"a",24),m(2,"Cancel"),o(),r(3,"p-button",25),y("onClick",function(){_(e);let i=c();return h(i.onSubmitJournalEntry())}),o()()}}function Qo(t,l){if(t&1&&(r(0,"span",48),m(1),o()),t&2){let e=l.$implicit;a(),I(" ",e.name," ")}}function Go(t,l){if(t&1&&(r(0,"div",23)(1,"div",49)(2,"span",50),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"span",51),m(8),o()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(5),S(e.name)}}function qo(t,l){t&1&&(r(0,"tr")(1,"th",52),m(2,"Account"),o(),r(3,"th",52),m(4,"Note"),o(),r(5,"th",53),m(6," Amount "),o(),d(7,"th",54),o())}function Wo(t,l){if(t&1&&(r(0,"div",23)(1,"div",49)(2,"span",50),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",49)(8,"p",61),F(9,"truncate"),m(10),F(11,"truncate"),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(5),p("pTooltip",Y(9,3,e.name,12)!==e.name?e.name:null),a(2),I(" ",Y(11,6,e.name,12)," ")}}function Zo(t,l){if(t&1&&(r(0,"div",23)(1,"div",49)(2,"span",50),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",49)(8,"span",62),m(9),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(6),S(e.name)}}function Yo(t,l){if(t&1){let e=b();r(0,"div",63)(1,"p-button",64),y("onClick",function(){_(e);let i=c(3);return h(i.addIitemVisible.set(!i.addIitemVisible()))}),o()()}}function Xo(t,l){if(t&1){let e=b();r(0,"tr",55)(1,"td")(2,"p-select",56),f(3,Wo,12,9,"ng-template",null,7,C)(5,Zo,10,2,"ng-template",null,3,C)(7,Yo,2,0,"ng-template",null,6,C),o()(),r(9,"td"),d(10,"textarea",57),o(),r(11,"td"),d(12,"input",58),o(),r(13,"td")(14,"div",59)(15,"p-button",60),y("onClick",function(){let i=_(e).rowIndex,s=c(2);return h(s.removeItem(i))}),o()()()()}if(t&2){let e=l.rowIndex,n=c(2);p("formGroupName",e),a(2),H(M(8,$o)),p("filter",!0)("options",n.journalRecordExpense().options.accounts),a(8),p("autoResize",!0),a(2),p("autoNumeric",M(9,Uo)),a(3),p("text",!0)}}function Ko(t,l){if(t&1){let e=b();r(0,"tr")(1,"td")(2,"div",65)(3,"div",23)(4,"p-button",66),y("onClick",function(){_(e);let i=c(2);return h(i.addItem())}),o()()()(),r(5,"td",67)(6,"span",68),m(7,"Total"),o()(),r(8,"td",69),m(9),F(10,"number"),o(),d(11,"td",70),o()}if(t&2){let e=c(2);a(9),I(" ",L(10,1,e.totalDebitAmount())," ")}}function er(t,l){if(t&1){let e=b();r(0,"p-panel",26)(1,"p-scrollpanel",null,2)(3,"div",27)(4,"div",28)(5,"div",29)(6,"div",30)(7,"div",27)(8,"div",31)(9,"label",32),m(10,"Date"),o()(),d(11,"p-datepicker",33),o()(),r(12,"div",30)(13,"div",27)(14,"div",31)(15,"label",32),m(16,"Outlet"),o()(),r(17,"p-select",34),f(18,Qo,2,1,"ng-template",null,3,C),o()()(),r(20,"div",30)(21,"div",27)(22,"div",31)(23,"label",32),m(24,"Number"),o()(),d(25,"input",35),o()(),r(26,"div",36)(27,"div",27)(28,"div",31)(29,"label",32),m(30,"Account"),o()(),r(31,"p-select",37),f(32,Go,9,2,"ng-template",null,3,C),o()()(),r(34,"div",38)(35,"div",27)(36,"div",31)(37,"label",39),m(38,"Supplier"),o()(),r(39,"p-autocomplete",40),F(40,"async"),y("completeMethod",function(i){_(e);let s=c();return h(s.search(i))}),o()()()()(),r(41,"div",11)(42,"div",29)(43,"div",30)(44,"div",27)(45,"div",41)(46,"label",42),m(47,"Upload"),o()(),r(48,"div",43)(49,"POS-uppy",44),y("fileUploaded",function(i){_(e);let s=c();return h(s.onUpload(i))}),o()()()(),r(50,"div",30)(51,"div",27)(52,"div",41)(53,"label",39),m(54,"Note"),o()(),r(55,"div",45),d(56,"textarea",46),o()()()()()(),d(57,"hr"),r(58,"p-table",47),f(59,qo,8,0,"ng-template",null,4,C)(61,Xo,16,10,"ng-template",null,5,C)(63,Ko,12,3,"ng-template",null,6,C),o()()()}if(t&2){let e=c();p("formGroup",e.form),a(),H(M(15,Bo)),a(16),p("options",e.journalRecordExpense().options.entities)("filter",!0),a(14),p("filter",!0)("options",e.journalRecordExpense().options.paymentAccounts),a(8),p("suggestions",L(40,13,e.supplierSuggestions$)),a(10),p("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard),a(7),p("autoResize",!0),a(2),p("scrollable",!0)("value",e.form.controls.items.controls)}}var Wn=(()=>{class t{constructor(){this.role=v(ri),this.fb=v(Bt),this.journalRecordExpense=z(null),this.activatedRoute=v(Te),this.journalService=v(j),this.toasr=v(Me),this.file=z(null),this.router=v(ke),this.addIitemVisible=z(!1),this.dayjsService=v(qe),this.totalDebitAmount=z(0),this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200}}ngOnInit(){this.initForm(),this.loadJournalForm(),this.initFormAddItemCOA(),this.form.controls.items.valueChanges.pipe(ee(e=>e.reduce((n,i)=>n+i.debitAmount,0)),J("response"),D(e=>{this.totalDebitAmount.set(e)})).subscribe()}loadCategories(){this.categories$||(this.categories$=this.journalService.fetchCategoryOptions().pipe(Bi(1)))}initFormAddItemCOA(){this.formAddItemCOA=this.fb.group({ID:this.fb.control(P.toString()),Name:this.fb.control(""),Code:this.fb.control(""),Note:this.fb.control(""),CategoryID:this.fb.control(""),OutletID:this.fb.control(P.toString()),Balance:this.fb.control(0)})}onaddItemCOA(){if(this.formAddItemCOA.invalid){this.formAddItemCOA.markAllAsTouched();return}let e=Object.entries(this.formAddItemCOA.getRawValue()).reduce((n,[i,s])=>(i==="CategoryID"?n[i]=s.key||s:n[i]=s,n),{});this.journalService.submitChartAccount(e).pipe(We(()=>this.journalService.getJournalRecordExpenseLoader().pipe(D(n=>{this.patchForm(n.form),this.journalRecordExpense.set(n),this.addIitemVisible.update(i=>!i)})))).subscribe()}loadJournalForm(){this.activatedRoute.data.pipe(ee(e=>e.form),D(e=>{this.patchForm(e.form),this.journalRecordExpense.set(e)})).subscribe()}initForm(){this.form=this.fb.group({order:this.buildOrderGroup(this.fb),items:this.fb.array([]),additionalAccountID:this.fb.control(""),file:this.fb.control("")})}buildOrderGroup(e){return e.group({id:e.control(""),number:e.control(""),date:e.control({value:new Date,disabled:!this.role.accounting.DateEditor}),note:e.control(""),entryTypeID:e.control(0),referenceID:e.control(""),referenceTypeID:e.control(0),referenceText:e.control(""),contactID:e.control(null),detailReferenceID:e.control(""),creatorID:e.control(""),created:e.control(""),modifierID:e.control(""),modified:e.control(""),outletID:e.control(""),statusID:e.control(""),contactName:e.control("")})}buildItemGroup(e){return e.group({id:e.control(P.toString()),journalID:e.control(P.toString()),accountID:e.control(""),debitAmount:e.control(0),creditAmount:e.control(0),index:e.control(0),note:e.control("")})}patchForm(e){if(!e)return;this.form.controls.order.patchValue({id:e.order.id,number:e.order.number,date:Hn(e.order.date)?(0,Ti.default)().toDate():(0,Ti.default)(e.order.date).toDate(),note:e.order.note,entryTypeID:e.order.entryTypeID,referenceID:e.order.referenceID,referenceTypeID:e.order.referenceTypeID,referenceText:e.order.referenceText,contactID:this.activatedRoute.snapshot.paramMap.has("id")?{Key:e.order.contactID,Value:e.customerName}:null,detailReferenceID:e.order.detailReferenceID,creatorID:e.order.creatorID,created:e.order.created,modifierID:e.order.modifierID,modified:e.order.modified,outletID:e.order.outletID,statusID:e.order.statusID,contactName:e.order.contactName});let n=this.form.controls.items;n.clear(),e.items.forEach(i=>{let s=this.buildItemGroup(this.fb);s.patchValue(i),n.push(s)}),this.form.patchValue({items:void 0,order:void 0,additionalAccountID:null,file:e.file??""})}openDialogAddItemCOA(){this.addIitemVisible.update(e=>!e)}addItem(){let e=this.form.controls.items,n=this.buildItemGroup(this.fb);e.push(n),setTimeout(()=>{let i=this.scrollPanelContainer.contentViewChild.nativeElement;console.log("Scroll container:",i.scrollHeight),i.scrollTo({top:i.scrollHeight,behavior:"smooth"})},0)}removeItem(e){this.form.controls.items.removeAt(e)}search(e){let n=e.query;this.supplierSuggestions$=this.journalService.getJournalEntrySupplierSuggestions(n).pipe(J("response"))}onUpload(e){e instanceof File&&this.file.set(e)}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue();console.log("cleanedFormValue",e);let n=this.buildFormData(e);this.journalService.submitJournalEntry(n).pipe(J("response"),D(()=>{this.router.navigate(["/pages/journal/journal-entry"])}),tt(i=>et(()=>i)),J("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),n=Object.entries(e).reduce((i,[s,u])=>(s==="items"?i[s]=u.map(x=>E(w({},x),{debitAmount:+x.debitAmount,creditAmount:+x.creditAmount})):s==="order"?i[s]=E(w({},u),{date:this.dayjsService.from(u.date)?this.dayjsService.format(u.date):null,contactID:u.contactID&&typeof u.contactID=="object"?u.contactID.Key:u.contactID||P}):s==="file"?i[s]=u.length>0?u:null:i[s]=u,i),{});return JSON.parse(JSON.stringify(n,(i,s)=>s==="null"?null:s))}buildFormData(e){let n=new FormData;return n.append("Data",JSON.stringify(e)),n.append("File",this.file()),n}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-record-expense",8,"page"]],viewQuery:function(n,i){if(n&1&&O(Oo,5),n&2){let s;T(s=k())&&(i.scrollPanelContainer=s.first)}},attrs:No,decls:27,vars:14,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["item",""],["header",""],["body",""],["footer",""],["selectedItem",""],["pageTitle","Record Expense",3,"hasMainWrapperPadding"],["header","Add New Account",3,"modal","visible","closable"],[1,"row","row-gap-3",3,"formGroup"],[1,"col"],[1,"d-flex","flex-column"],["for","username",1,"font-semibold","w-24"],["formControlName","Name","pInputText","","id","username","autocomplete","off",1,"flex-auto"],["for","email",1,"font-semibold","w-24"],["formControlName","Code","pInputText","","id","email","autocomplete","off",1,"flex-auto"],[1,"col-12"],["for","password",1,"font-semibold","w-24"],["formControlName","CategoryID","containerStyleClass","w-100","appendTo","body","placeholder","Select Item",3,"onFocus","options"],[1,"d-flex","justify-content-end","gap-2"],["label","Cancel","severity","secondary",3,"click"],["label","Save",3,"click"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"col-3","d-flex","align-items-center"],["for","outlet",1,"m-0","fs-3","fw-normal"],["showClear","","size","small","styleClass","w-100","formControlName","date",1,"col-6","p-0"],["showClear","","size","small","inputId","outlet","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an outlet","filterBy","name",1,"col-6","placeholder-spacing",3,"options","filter"],["pSize","small","formControlName","number","type","text","pInputText","",1,"col-6"],[1,"col-12","col-lg-12"],["showClear","","size","small","filterBy","code,name","inputId","outlet","formControlName","additionalAccountID","optionLabel","name","optionValue","id","placeholder","Choose account to pay",1,"col-6","placeholder-spacing",3,"filter","options"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["showClear","","size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions"],[1,"col-3","d-flex"],["for","fileUpload",1,"m-0","fs-3","fw-normal"],[1,"col-9","pl-0"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],[1,"col","pl-0"],["pSize","small","rows","4","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"autoResize"],["showGridlines","","formArrayName","items",3,"scrollable","value"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block",2,"max-width","200px"],[2,"width","30%","min-width","120px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","3%","min-width","30px"],[3,"formGroupName"],["size","small","filterBy","code,name","appendTo","body","formControlName","accountID","optionLabel","name","optionValue","id","styleClass","w-100","placeholder","Select an account","showClear","",3,"filter","options"],["rows","1","pSize","small","pTextarea","","formControlName","note",1,"w-100",3,"autoResize"],["type","text","pSize","small","pInputText","","formControlName","debitAmount",1,"text-end","w-100",3,"autoNumeric"],[1,"d-flex","justify-content-end"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],["tooltipPosition","top",1,"m-0",3,"pTooltip"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"p-3"],["label","Add New","fluid","","text","","severity","secondary","outlined","","size","small","icon","pi pi-plus",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],["severity","secondary","outlined","","icon","fa-light fa-plus","size","small","label","Add new row",3,"onClick"],[1,"text-end"],[2,"vertical-align","middle"],[1,"text-end","footer-total"],["colspan",""]],template:function(n,i){if(n&1){let s=b();r(0,"app-main-panel",8),f(1,Ho,4,0,"ng-template",null,0,C)(3,er,65,16,"ng-template",null,1,C),o(),r(5,"p-dialog",9)(6,"div",10)(7,"div",11)(8,"div",12)(9,"label",13),m(10,"Name"),o(),d(11,"input",14),o()(),r(12,"div",11)(13,"div",12)(14,"label",15),m(15,"Code"),o(),d(16,"input",16),o()(),r(17,"div",17)(18,"div",12)(19,"label",18),m(20,"Category"),o(),r(21,"p-treeselect",19),F(22,"async"),y("onFocus",function(){return _(s),h(i.loadCategories())}),o()()(),r(23,"div",11)(24,"div",20)(25,"p-button",21),y("click",function(){return _(s),h(i.addIitemVisible.set(!i.addIitemVisible()))}),o(),r(26,"p-button",22),y("click",function(){return _(s),h(i.onaddItemCOA())}),o()()()()()}n&2&&(p("hasMainWrapperPadding",!0),a(5),H(M(12,Lo)),p("modal",!0)("visible",i.addIitemVisible())("closable",!1),a(),p("formGroup",i.formAddItemCOA),a(15),H(M(13,jo)),p("options",L(22,10,i.categories$)))},dependencies:[ne,X,sn,ce,ue,de,Le,Ne,Qe,He,Ue,$e,he,_e,ve,be,Ce,ze,Re,Fe,Ve,Pe,Ae,lt,st,vt,xe,Ge,bt,Ct,ht,ye,ie,ut,dt,An,Pn,pt,mt,yt,ft,Be,je],styles:["[_nghost-%COMP%]{display:block}.footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:16px}.placeholder-spacing[_ngcontent-%COMP%] .p-select-label{padding-left:0!important}[_nghost-%COMP%] .p-datatable .p-select{border:none;box-shadow:none}[_nghost-%COMP%] .p-datatable .p-select .p-select-label{padding:0}[_nghost-%COMP%] .p-datatable .p-textarea{border:none;box-shadow:none;padding:0}[_nghost-%COMP%] .p-datatable .p-inputtext{border:none;box-shadow:none;padding-right:0}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:not(:last-child){border-top:1px solid var(--p-datatable-footer-cell-border-color)}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:last-child{border-top:none}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td{border-left:none;border-right:none;border-bottom:none}[_nghost-%COMP%] .p-datatable .p-datatable-thead>tr>th:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;background:transparent!important}[_nghost-%COMP%] .p-datatable .p-datatable-tbody>tr>td:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;padding:0 .25rem!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:first-child{padding:0!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot .p-button .p-button-label{font-size:12px!important}"],changeDetection:0})}}return t})();var tr=["filterRef"],ir=["class","page"];function nr(t,l){t&1&&(r(0,"div",10)(1,"div",5)(2,"h5",11),m(3,"Card title"),o(),r(4,"h6",12),m(5,"Card subtitle"),o(),r(6,"p",13),m(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),o(),r(8,"a",14),m(9,"Card link"),o(),r(10,"a",14),m(11,"Another link"),o()()())}var Zn=(()=>{class t{constructor(){this.modalService=v($t)}onFilterChange(e){console.log("Filter Change",e),this.modalService.open(this.templateRef)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-deposit",8,"page"]],viewQuery:function(n,i){if(n&1&&O(tr,7),n&2){let s;T(s=k())&&(i.templateRef=s.first)}},attrs:ir,decls:44,vars:0,consts:[["filterRef",""],[3,"eventFilterChange"],["ngProjectAs","content",5,["content"]],[1,"container","my-4"],[1,"card"],[1,"card-body"],[1,"table"],["scope","col"],["scope","row"],["colspan","2"],[1,"card",2,"width","18rem"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(n,i){if(n&1){let s=b();r(0,"app-main-panel",1),y("eventFilterChange",function(x){return _(s),h(i.onFilterChange(x))}),Q(1,2),r(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead")(7,"tr")(8,"th",7),m(9,"#"),o(),r(10,"th",7),m(11,"First"),o(),r(12,"th",7),m(13,"Last"),o(),r(14,"th",7),m(15,"Handle"),o()()(),r(16,"tbody")(17,"tr")(18,"th",8),m(19,"1"),o(),r(20,"td"),m(21,"Mark"),o(),r(22,"td"),m(23,"Otto"),o(),r(24,"td"),m(25,"mdo"),o()(),r(26,"tr")(27,"th",8),m(28,"2"),o(),r(29,"td"),m(30,"Jacob"),o(),r(31,"td"),m(32,"Thornton"),o(),r(33,"td"),m(34,"fat"),o()(),r(35,"tr")(36,"th",8),m(37,"3"),o(),r(38,"td",9),m(39,"Larry the Bird"),o(),r(40,"td"),m(41,"twitter"),o()()()()()()(),G(),o(),f(42,nr,12,0,"ng-template",null,0,C)}},dependencies:[ne],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Fi=Ke(Kt());var or=["mask"],rr=["content"],ar=["footer"],lr=["titlebar"],sr=(t,l,e)=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex","justify-content":t,"align-items":l,"pointer-events":e}),mr=t=>({"p-dialog p-component":!0,"p-dialog-maximized":t}),pr=()=>({display:"flex","flex-direction":"column","pointer-events":"auto"}),cr=(t,l)=>({transform:t,transition:l}),dr=t=>({value:"visible",params:t});function ur(t,l){if(t&1){let e=b();r(0,"div",14),y("mousedown",function(i){_(e);let s=c(2);return h(s.initResize(i))}),o()}t&2&&p("ngClass","p-resizable-handle")}function fr(t,l){t&1&&Se(0)}function gr(t,l){t&1&&d(0,"WindowMaximizeIcon")}function _r(t,l){t&1&&d(0,"WindowMinimizeIcon")}function hr(t,l){if(t&1&&(Q(0),f(1,gr,1,0,"WindowMaximizeIcon",11)(2,_r,1,0,"WindowMinimizeIcon",11),G()),t&2){let e=c(5);a(),p("ngIf",!e.maximized&&!e.maximizeIconTemplate),a(),p("ngIf",e.maximized&&!e.minimizeIconTemplate)}}function yr(t,l){}function vr(t,l){t&1&&f(0,yr,0,0,"ng-template")}function Cr(t,l){if(t&1&&(Q(0),f(1,vr,1,0,null,21),G()),t&2){let e=c(5);a(),p("ngTemplateOutlet",e.maximizeIconTemplate)}}function br(t,l){}function xr(t,l){t&1&&f(0,br,0,0,"ng-template")}function wr(t,l){if(t&1&&(Q(0),f(1,xr,1,0,null,21),G()),t&2){let e=c(5);a(),p("ngTemplateOutlet",e.minimizeIconTemplate)}}function Ir(t,l){if(t&1){let e=b();r(0,"p-button",20),y("onClick",function(){_(e);let i=c(4);return h(i.maximize())})("keydown.enter",function(){_(e);let i=c(4);return h(i.maximize())}),f(1,hr,3,2,"ng-container",11)(2,Cr,2,1,"ng-container",11)(3,wr,2,1,"ng-container",11),o()}if(t&2){let e=c(4);p("styleClass","p-dialog-maximize-button")("tabindex",e.maximizable?"0":"-1"),a(),p("ngIf",!e.maximizeIcon),a(),p("ngIf",!e.maximized),a(),p("ngIf",e.maximized)}}function Er(t,l){t&1&&(Q(0),d(1,"TimesIcon"),G())}function Sr(t,l){}function Dr(t,l){t&1&&f(0,Sr,0,0,"ng-template")}function Tr(t,l){if(t&1&&(r(0,"span"),f(1,Dr,1,0,null,21),o()),t&2){let e=c(5);a(),p("ngTemplateOutlet",e.closeIconTemplate)}}function kr(t,l){if(t&1){let e=b();r(0,"p-button",22),y("onClick",function(){_(e);let i=c(4);return h(i.hide())})("keydown.enter",function(){_(e);let i=c(4);return h(i.hide())}),f(1,Er,2,0,"ng-container",11)(2,Tr,2,1,"span",11),o()}if(t&2){let e=c(4);p("styleClass","p-dialog-close-button")("ariaLabel",e.ddconfig.closeAriaLabel||e.defaultCloseAriaLabel),a(),p("ngIf",!e.closeIconTemplate),a(),p("ngIf",e.closeIconTemplate)}}function Mr(t,l){if(t&1&&(Q(0),r(1,"span",16),m(2),o(),r(3,"div",17),f(4,Ir,4,5,"p-button",18)(5,kr,3,4,"p-button",19),o(),G()),t&2){let e=c(3);a(),p("ngClass","p-dialog-title")("id",e.ariaLabelledBy),a(),S(e.ddconfig.header),a(),p("ngClass","p-dialog-header-actions"),a(),p("ngIf",e.ddconfig.maximizable),a(),p("ngIf",e.closable)}}function Rr(t,l){if(t&1){let e=b();r(0,"div",15,3),y("mousedown",function(i){_(e);let s=c(2);return h(s.initDrag(i))}),f(2,fr,1,0,"ng-container",12)(3,Mr,6,6,"ng-container",11),o()}if(t&2){let e=c(2);p("ngClass","p-dialog-header"),a(2),p("ngComponentOutlet",e.headerTemplate),a(),p("ngIf",!e.headerTemplate)}}function Fr(t,l){}function Vr(t,l){t&1&&f(0,Fr,0,0,"ng-template",23)}function Pr(t,l){t&1&&Se(0)}function Ar(t,l){if(t&1&&(Q(0),m(1),G()),t&2){let e=c(3);a(),I(" ",e.ddconfig.footer," ")}}function zr(t,l){t&1&&Se(0)}function Jr(t,l){if(t&1&&(r(0,"div",17,4),f(2,Ar,2,1,"ng-container",11)(3,zr,1,0,"ng-container",12),o()),t&2){let e=c(2);p("ngClass","p-dialog-footer"),a(2),p("ngIf",!e.footerTemplate),a(),p("ngComponentOutlet",e.footerTemplate)}}function Or(t,l){if(t&1){let e=b();r(0,"div",7,1),y("@animation.start",function(i){_(e);let s=c();return h(s.onAnimationStart(i))})("@animation.done",function(i){_(e);let s=c();return h(s.onAnimationEnd(i))}),f(2,ur,1,1,"div",8)(3,Rr,4,3,"div",9),r(4,"div",10,2),f(6,Vr,1,0,null,11)(7,Pr,1,0,"ng-container",12),o(),f(8,Jr,4,3,"div",13),o()}if(t&2){let e=c();H(e.ddconfig.style),$(e.ddconfig.styleClass),Yi("width",e.ddconfig.width)("height",e.ddconfig.height),p("ngClass",N(22,mr,e.maximizable&&e.maximized))("ngStyle",M(24,pr))("@animation",N(28,dr,nt(25,cr,e.transformOptions,e.ddconfig.transitionOptions||"150ms cubic-bezier(0, 0, 0.2, 1)")))("pFocusTrapDisabled",e.ddconfig.focusTrap===!1),V("aria-labelledby",e.ariaLabelledBy)("aria-modal",!0)("id",e.dialogId),a(2),p("ngIf",e.ddconfig.resizable),a(),p("ngIf",e.ddconfig.showHeader!==!1),a(),p("ngClass","p-dialog-content")("ngStyle",e.ddconfig.contentStyle),a(2),p("ngIf",!e.contentTemplate),a(),p("ngComponentOutlet",e.contentTemplate),a(),p("ngIf",e.ddconfig.footer||e.footerTemplate)}}var Yn=(()=>{class t{viewContainerRef;constructor(e){this.viewContainerRef=e}static \u0275fac=function(n){return new(n||t)(Ye(qi))};static \u0275dir=Wi({type:t,selectors:[["","pDynamicDialogContent",""]]})}return t})(),Xn=(()=>{class t extends Sn{name="dialog";static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275prov=Ze({token:t,factory:t.\u0275fac})}return t})();var ai=class{data;inputValues;header;ariaLabelledBy;footer;width;height;closeOnEscape=!1;focusOnShow=!0;focusTrap=!0;baseZIndex;autoZIndex=!1;dismissableMask=!1;rtl=!1;style;contentStyle;styleClass;transitionOptions;closable=!1;showHeader=!1;modal=!1;maskStyleClass;resizable=!1;draggable=!1;keepInViewport=!1;minX;minY;maximizable=!1;maximizeIcon;minimizeIcon;position;closeAriaLabel;appendTo;duplicate=!1;breakpoints;templates},Tt=class{constructor(){}close(l){this._onClose.next(l),setTimeout(()=>{this._onClose.complete()},1e3)}destroy(){this._onDestroy.next(null)}dragStart(l){this._onDragStart.next(l)}dragEnd(l){this._onDragEnd.next(l)}resizeInit(l){this._onResizeInit.next(l)}resizeEnd(l){this._onResizeEnd.next(l)}maximize(l){this._onMaximize.next(l)}_onClose=new we;onClose=this._onClose.asObservable();_onDestroy=new we;onDestroy=this._onDestroy.asObservable();_onDragStart=new we;onDragStart=this._onDragStart.asObservable();_onDragEnd=new we;onDragEnd=this._onDragEnd.asObservable();_onResizeInit=new we;onResizeInit=this._onResizeInit.asObservable();_onResizeEnd=new we;onResizeEnd=this._onResizeEnd.asObservable();_onMaximize=new we;onMaximize=this._onMaximize.asObservable();onChildComponentLoaded=new we},Nr=di([Xe({transform:"{{transform}}",opacity:0}),rt("{{transition}}",Xe({transform:"none",opacity:1}))]),Lr=di([rt("{{transition}}",Xe({transform:"{{transform}}",opacity:0}))]),Kn=(()=>{class t extends Gt{renderer;ddconfig;dialogRef;zone;parentDialog;visible=!0;componentRef;mask;resizing;dragging;maximized;_style={};originalStyle;lastPageX;lastPageY;ariaLabelledBy;id=oe("pn_id_");styleElement;insertionPoint;maskViewChild;contentViewChild;footerViewChild;headerViewChild;childComponentType;inputValues;container;wrapper;documentKeydownListener;documentEscapeListener;maskClickListener;transformOptions="scale(0.7)";documentResizeListener;documentResizeEndListener;documentDragListener;documentDragEndListener;_componentStyle=v(Xn);get minX(){return this.ddconfig.minX?this.ddconfig.minX:0}get minY(){return this.ddconfig.minY?this.ddconfig.minY:0}get keepInViewport(){return this.ddconfig.keepInViewport}get maximizable(){return this.ddconfig.maximizable}get maximizeIcon(){return this.ddconfig.maximizeIcon}get minimizeIcon(){return this.ddconfig.minimizeIcon}get closable(){return this.ddconfig.closable}get style(){return this._style}get position(){return this.ddconfig.position}get defaultCloseAriaLabel(){return this.config.getTranslation(gn.ARIA).close}set style(e){e&&(this._style=w({},e),this.originalStyle=e)}get parent(){let e=Array.from(this.document.getElementsByClassName("p-dialog"));if(e.length>1)return e.pop()}get parentContent(){let e=Array.from(this.document.getElementsByClassName("p-dialog"));if(e.length>0){let n=e[e.length-1].querySelector(".p-dialog-content");if(n)return Array.isArray(n)?n[0]:n}}get header(){return this.ddconfig.header}get data(){return this.ddconfig.data}get breakpoints(){return this.ddconfig.breakpoints}get footerTemplate(){return this.ddconfig?.templates?.footer}get headerTemplate(){return this.ddconfig?.templates?.header}get contentTemplate(){return this.ddconfig?.templates?.content}get minimizeIconTemplate(){return this.ddconfig?.templates?.minimizeicon}get maximizeIconTemplate(){return this.ddconfig?.templates?.maximizeicon}get closeIconTemplate(){return this.ddconfig?.templates?.closeicon}get maskClass(){let n=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(i=>i===this.position);return{"p-dialog-mask":!0,"p-overlay-mask p-overlay-mask-enter":this.ddconfig.modal||this.ddconfig.dismissableMask,[`p-dialog-${n}`]:n}}get dialogId(){return this.attrSelector}zIndexForLayering;constructor(e,n,i,s,u){super(),this.renderer=e,this.ddconfig=n,this.dialogRef=i,this.zone=s,this.parentDialog=u}ngOnInit(){super.ngOnInit(),this.breakpoints&&this.createStyle()}createStyle(){if(St(this.platformId)&&!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let e="";for(let n in this.breakpoints)e+=`
|
|
2
|
-
@media screen and (max-width: ${n}) {
|
|
3
|
-
.p-dialog[id=${this.dialogId}]:not(.p-dialog-maximized) {
|
|
4
|
-
width: ${this.breakpoints[n]} !important;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`;this.renderer.setProperty(this.styleElement,"innerHTML",e),un(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngAfterViewInit(){super.ngAfterViewInit(),this.loadChildComponent(this.childComponentType),this.ariaLabelledBy=this.getAriaLabelledBy(),this.cd.detectChanges()}getAriaLabelledBy(){let{header:e,showHeader:n}=this.ddconfig;return e===null||n===!1?null:oe("pn_id_")+"_header"}loadChildComponent(e){let n=this.insertionPoint?.viewContainerRef;n?.clear(),this.componentRef=n?.createComponent(e),this.inputValues&&Object.entries(this.inputValues).forEach(([i,s])=>{this.componentRef.setInput(i,s)}),this.dialogRef.onChildComponentLoaded.next(this.componentRef.instance)}moveOnTop(){this.ddconfig.autoZIndex!==!1?(Ee.set("modal",this.container,(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal),this.wrapper.style.zIndex=String(parseInt(this.container.style.zIndex,10)-1)):this.zIndexForLayering=Ee.generateZIndex("modal",(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal)}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.wrapper=this.container.parentElement,this.moveOnTop(),this.parent&&this.unbindGlobalListeners(),this.bindGlobalListeners(),this.container?.setAttribute(this.id,""),this.ddconfig.modal!==!1&&this.enableModality(),this.ddconfig.focusOnShow!==!1&&this.focus();break;case"void":this.wrapper&&this.ddconfig.modal!==!1&&Je(this.wrapper,"p-overlay-mask-leave");break}}onAnimationEnd(e){e.toState==="void"&&(this.parentContent&&this.focus(this.parentContent),this.onContainerDestroy(),this.dialogRef.destroy())}onContainerDestroy(){this.unbindGlobalListeners(),this.container&&this.ddconfig.autoZIndex!==!1&&Ee.clear(this.container),this.zIndexForLayering&&Ee.revertZIndex(this.zIndexForLayering),this.ddconfig.modal!==!1&&this.disableModality(),this.container=null}close(){this.visible=!1,this.cd.markForCheck()}hide(){this.dialogRef&&this.dialogRef.close()}enableModality(){this.ddconfig.dismissableMask&&(this.maskClickListener=this.renderer.listen(this.wrapper,"mousedown",e=>{this.wrapper&&this.wrapper.isSameNode(e.target)&&this.hide()})),this.ddconfig.modal!==!1&&Je(this.document.body,"p-overflow-hidden")}disableModality(){this.wrapper&&(this.ddconfig.dismissableMask&&this.unbindMaskClickListener(),this.ddconfig.modal!==!1&&Dt(this.document.body,"p-overflow-hidden"),this.cd.destroyed||this.cd.detectChanges())}focus(e=this.contentViewChild.nativeElement){let n=yi.getFocusableElement(e,"[autofocus]");if(n){this.zone.runOutsideAngular(()=>{setTimeout(()=>n.focus(),5)});return}let i=yi.getFocusableElement(e);i?this.zone.runOutsideAngular(()=>{setTimeout(()=>i.focus(),5)}):this.footerViewChild?this.focus(this.footerViewChild.nativeElement):!i&&this.headerViewChild&&this.focus(this.headerViewChild.nativeElement)}maximize(){this.maximized=!this.maximized,this.maximized?Je(this.document.body,"p-overflow-hidden"):Dt(this.document.body,"p-overflow-hidden"),this.dialogRef.maximize({maximized:this.maximized})}initResize(e){this.ddconfig.resizable&&(this.documentResizeListener||this.bindDocumentResizeListeners(),this.resizing=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,Je(this.document.body,"p-unselectable-text"),this.dialogRef.resizeInit(e))}onResize(e){if(this.resizing){let n=e.pageX-this.lastPageX,i=e.pageY-this.lastPageY,s=_i(this.container),u=Ht(this.container),x=Ht(this.contentViewChild.nativeElement),B=s+n,A=u+i,Et=this.container.style.minWidth,Oi=this.container.style.minHeight,Ni=this.container.getBoundingClientRect(),Li=gi();(!parseInt(this.container.style.top)||!parseInt(this.container.style.left))&&(B+=n,A+=i),(!Et||B>parseInt(Et))&&Ni.left+B<Li.width&&(this._style.width=B+"px",this.container.style.width=this._style.width),(!Oi||A>parseInt(Oi))&&Ni.top+A<Li.height&&(this.contentViewChild.nativeElement.style.height=x+A-u+"px",this._style.height&&(this._style.height=A+"px",this.container.style.height=this._style.height)),this.lastPageX=e.pageX,this.lastPageY=e.pageY}}resizeEnd(e){this.resizing&&(this.resizing=!1,Dt(this.document.body,"p-unselectable-text"),this.dialogRef.resizeEnd(e))}initDrag(e){fi(e.target,"p-dialog-header-icon")||fi(e.target.parentElement,"p-dialog-header-icon")||this.ddconfig.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",Je(this.document.body,"p-unselectable-text"),this.dialogRef.dragStart(e))}onDrag(e){if(this.dragging){let n=_i(this.container),i=Ht(this.container),s=e.pageX-this.lastPageX,u=e.pageY-this.lastPageY,x=this.container.getBoundingClientRect(),B=x.left+s,A=x.top+u,Et=gi();this.container.style.position="fixed",this.keepInViewport?(B>=this.minX&&B+n<Et.width&&(this._style.left=B+"px",this.lastPageX=e.pageX,this.container.style.left=B+"px"),A>=this.minY&&A+i<Et.height&&(this._style.top=A+"px",this.lastPageY=e.pageY,this.container.style.top=A+"px")):(this.lastPageX=e.pageX,this.container.style.left=B+"px",this.lastPageY=e.pageY,this.container.style.top=A+"px")}}endDrag(e){this.dragging&&(this.dragging=!1,Dt(this.document.body,"p-unselectable-text"),this.dialogRef.dragEnd(e),this.cd.detectChanges())}resetPosition(){this.container.style.position="",this.container.style.left="",this.container.style.top="",this.container.style.margin=""}bindDocumentDragListener(){St(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragListener=this.renderer.listen(this.document,"mousemove",this.onDrag.bind(this))})}bindDocumentDragEndListener(){St(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragEndListener=this.renderer.listen(this.document,"mouseup",this.endDrag.bind(this))})}unbindDocumentDragEndListener(){this.documentDragEndListener&&(this.documentDragEndListener(),this.documentDragListener=null)}unbindDocumentDragListener(){this.documentDragListener&&(this.documentDragListener(),this.documentDragListener=null)}bindDocumentResizeListeners(){St(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentResizeListener=this.renderer.listen(this.document,"mousemove",this.onResize.bind(this)),this.documentResizeEndListener=this.renderer.listen(this.document,"mouseup",this.resizeEnd.bind(this))})}unbindDocumentResizeListeners(){this.documentResizeListener&&this.documentResizeEndListener&&(this.documentResizeListener(),this.documentResizeEndListener(),this.documentResizeListener=null,this.documentResizeEndListener=null)}bindGlobalListeners(){this.ddconfig.closeOnEscape!==!1&&this.bindDocumentEscapeListener(),this.ddconfig.resizable&&this.bindDocumentResizeListeners(),this.ddconfig.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener())}unbindGlobalListeners(){this.unbindDocumentEscapeListener(),this.unbindDocumentResizeListeners(),this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener()}bindDocumentEscapeListener(){let e=this.maskViewChild?this.maskViewChild.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(e,"keydown",n=>{if(n.which==27){let i=Ee.getCurrent();(parseInt(this.container.style.zIndex)==i||this.zIndexForLayering==i)&&this.hide()}})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}ngOnDestroy(){this.onContainerDestroy(),this.componentRef&&this.componentRef.destroy(),this.destroyStyle(),super.ngOnDestroy()}static \u0275fac=function(n){return new(n||t)(Ye(Gi),Ye(ai),Ye(Tt),Ye(Ui),Ye(t,12))};static \u0275cmp=R({type:t,selectors:[["p-dynamicDialog"],["p-dynamicdialog"],["p-dynamic-dialog"]],viewQuery:function(n,i){if(n&1&&(O(Yn,5),O(or,5),O(rr,5),O(ar,5),O(lr,5)),n&2){let s;T(s=k())&&(i.insertionPoint=s.first),T(s=k())&&(i.maskViewChild=s.first),T(s=k())&&(i.contentViewChild=s.first),T(s=k())&&(i.footerViewChild=s.first),T(s=k())&&(i.headerViewChild=s.first)}},features:[pe([Xn]),Z],decls:3,vars:9,consts:[["mask",""],["container",""],["content",""],["titlebar",""],["footer",""],[3,"ngStyle","ngClass"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","style","class","pFocusTrapDisabled","width","height",4,"ngIf"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","pFocusTrapDisabled"],["style","z-index: 90;",3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","ngStyle"],[4,"ngIf"],[4,"ngComponentOutlet"],[3,"ngClass",4,"ngIf"],[2,"z-index","90",3,"mousedown","ngClass"],[3,"mousedown","ngClass"],[3,"ngClass","id"],[3,"ngClass"],["rounded","","text","",3,"styleClass","tabindex","onClick","keydown.enter",4,"ngIf"],["rounded","","text","","severity","secondary",3,"styleClass","ariaLabel","onClick","keydown.enter",4,"ngIf"],["rounded","","text","",3,"onClick","keydown.enter","styleClass","tabindex"],[4,"ngTemplateOutlet"],["rounded","","text","","severity","secondary",3,"onClick","keydown.enter","styleClass","ariaLabel"],["pDynamicDialogContent",""]],template:function(n,i){n&1&&(r(0,"div",5,0),f(2,Or,9,30,"div",6),o()),n&2&&($(i.ddconfig.maskStyleClass),p("ngStyle",nn(5,sr,i.position==="left"||i.position==="topleft"||i.position==="bottomleft"?"flex-start":i.position==="right"||i.position==="topright"||i.position==="bottomright"?"flex-end":"center",i.position==="top"||i.position==="topleft"||i.position==="topright"?"flex-start":i.position==="bottom"||i.position==="bottomleft"||i.position==="bottomright"?"flex-end":"center",i.ddconfig.modal?"auto":"none"))("ngClass",i.maskClass),a(2),p("ngIf",i.visible))},dependencies:[X,De,ln,te,Jt,zt,Oe,Yn,hn,yn,qt,ie,Yt],encapsulation:2,data:{animation:[Nt("animation",[at("void => visible",[ui(Nr)]),at("visible => void",[ui(Lr)])])]}})}return t})(),li=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Vt({type:t});static \u0275inj=Mt({imports:[Kn,Oe,Oe]})}return t})(),Ri=class{_parentInjector;_additionalTokens;constructor(l,e){this._parentInjector=l,this._additionalTokens=e}get(l,e,n){let i=this._additionalTokens.get(l);return i||this._parentInjector.get(l,e)}},It=(()=>{class t{appRef;injector;document;dialogComponentRefMap=new Map;constructor(e,n,i){this.appRef=e,this.injector=n,this.document=i}open(e,n){if(!this.duplicationPermission(e,n))return null;let i=this.appendDialogComponentToBody(n,e);return this.dialogComponentRefMap.get(i).instance.childComponentType=e,this.dialogComponentRefMap.get(i).instance.inputValues=n.inputValues,i}getInstance(e){return this.dialogComponentRefMap.get(e).instance}appendDialogComponentToBody(e,n){let i=new WeakMap;i.set(ai,e);let s=new Tt;i.set(Tt,s);let u=s.onClose.subscribe(()=>{this.dialogComponentRefMap.get(s).instance.close()}),x=s.onDestroy.subscribe(()=>{this.removeDialogComponentFromBody(s),x.unsubscribe(),u.unsubscribe()}),B=rn(Kn,{environmentInjector:this.appRef.injector,elementInjector:new Ri(this.injector,i)});this.appRef.attachView(B.hostView);let A=B.hostView.rootNodes[0];return!e.appendTo||e.appendTo==="body"?this.document.body.appendChild(A):Ut(e.appendTo,A),this.dialogComponentRefMap.set(s,B),s}removeDialogComponentFromBody(e){if(!e||!this.dialogComponentRefMap.has(e))return;let n=this.dialogComponentRefMap.get(e);this.appRef.detachView(n.hostView),n.destroy(),n.changeDetectorRef.detectChanges(),this.dialogComponentRefMap.delete(e)}duplicationPermission(e,n){if(n.duplicate)return!0;let i=!0;for(let[s,u]of this.dialogComponentRefMap)if(u.instance.childComponentType===e){i=!1;break}return i}static \u0275fac=function(n){return new(n||t)(Rt(Zi),Rt($i),Rt(an))};static \u0275prov=Ze({token:t,factory:t.\u0275fac})}return t})();var si=()=>[],mi=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-dialog-create-customer-supplier"]],decls:66,vars:8,consts:[[1,"row","row-gap-3"],[1,"col-12"],[1,"form-group","d-flex","flex-column"],["for",""],["appendTo","body","optionLabel","name","placeholder","Select a City",1,"w-full","md:w-56",3,"options"],[1,"col-12","col-lg-4"],["pInputText","","autocomplete","off",1,"w-100"],["rows","1","cols","30","pTextarea",""],[1,"col-12","col-lg-6"]],template:function(n,i){n&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),m(4,"Customer / Supplier"),o(),d(5,"p-select",4),o()(),r(6,"div",5)(7,"div",2)(8,"label",3),m(9,"Title"),o(),d(10,"input",6),o()(),r(11,"div",5)(12,"div",2)(13,"label",3),m(14,"First Name"),o(),d(15,"input",6),o()(),r(16,"div",5)(17,"div",2)(18,"label",3),m(19,"Last Name"),o(),d(20,"input",6),o()(),r(21,"div",5)(22,"div",2)(23,"label",3),m(24,"Mobile"),o(),d(25,"input",6),o()(),r(26,"div",5)(27,"div",2)(28,"label",3),m(29,"Email"),o(),d(30,"input",6),o()(),r(31,"div",5)(32,"div",2)(33,"label",3),m(34,"Identification"),o(),d(35,"input",6),o()(),r(36,"div",1)(37,"div",2)(38,"label",3),m(39,"Birthday"),o(),d(40,"input",6),o()(),r(41,"div",1)(42,"div",2)(43,"label",3),m(44,"Title"),o(),d(45,"textarea",7),o()(),r(46,"div",8)(47,"div",2)(48,"label",3),m(49,"City"),o(),d(50,"p-select",4),o()(),r(51,"div",8)(52,"div",2)(53,"label",3),m(54,"Nationality"),o(),d(55,"p-select",4),o()(),r(56,"div",8)(57,"div",2)(58,"label",3),m(59,"Gender"),o(),d(60,"p-select",4),o()(),r(61,"div",8)(62,"div",2)(63,"label",3),m(64,"Member Code"),o(),d(65,"textarea",7),o()()()),n&2&&(a(5),p("options",M(4,si)),a(45),p("options",M(5,si)),a(5),p("options",M(6,si)),a(5),p("options",M(7,si)))},dependencies:[xe,Ge,he,_e,Jn,Qe,He],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var io=Ke(zn());var Br=["scrollPanelContainer"],$r=["class","page"],Ur=()=>({width:"25rem"}),Hr=()=>[".."],Qr=()=>({height:"calc(100vh - 140px)"}),Gr=t=>({"ng-invalid ng-dirty":t}),eo=()=>({}),to=t=>({"text-danger":t});function qr(t,l){if(t&1){let e=b();r(0,"div",12)(1,"a",13),m(2,"Cancel"),o(),r(3,"p-button",14),y("onClick",function(){_(e);let i=c();return h(i.onSubmitJournalEntry())}),o()()}t&2&&(a(),p("routerLink",M(1,Hr)))}function Wr(t,l){if(t&1&&(r(0,"div",42)(1,"div",43),m(2),o()()),t&2){let e=l.$implicit;a(2),I(" ",e.name," ")}}function Zr(t,l){if(t&1&&(r(0,"div",28),d(1,"p-radiobutton",44),r(2,"label",45),m(3),o()()),t&2){let e=l.$implicit;a(),ci("inputId","contactType-",e.key,""),p("value",e.key),a(),ci("for","contactType-",e.key,""),a(),I(" ",e.value," ")}}function Yr(t,l){if(t&1){let e=b();r(0,"div",34)(1,"div",46),d(2,"i",47),r(3,"div",48)(4,"a",49),m(5),o()(),r(6,"button",50),y("click",function(){_(e);let i=c(3);return h(i.onRemoveFileAttachment())}),o()()()}if(t&2){let e,n=c(3);a(4),p("href",n.form.controls.order==null||(e=n.form.controls.order.get("fileAttachment"))==null?null:e.value,Ie)("title",n.getFileAttachmentName()),a(),I(" ",n.getFileAttachmentName()," ")}}function Xr(t,l){if(t&1){let e=b();r(0,"div",35)(1,"POS-uppy",51),y("fileUploaded",function(i){_(e);let s=c(3);return h(s.onUpload(i))}),o()()}if(t&2){let e=c(3);a(),p("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard)}}function Kr(t,l){t&1&&(r(0,"tr")(1,"th",52),m(2,"Account"),o(),r(3,"th",53),m(4,"Note"),o(),r(5,"th",54),m(6," Debit "),o(),r(7,"th",54),m(8," Credit "),o(),d(9,"th",55),o())}function ea(t,l){if(t&1&&(r(0,"div",12)(1,"div",63)(2,"span",64),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",63)(8,"p",65),F(9,"truncate"),m(10),F(11,"truncate"),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(5),p("pTooltip",Y(9,3,e.name,12)!==e.name?e.name:null),a(2),I(" ",Y(11,6,e.name,12)," ")}}function ta(t,l){if(t&1&&(r(0,"div",12)(1,"div",63)(2,"span",64),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",63)(8,"span",66),m(9),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(6),S(e.name)}}function ia(t,l){if(t&1){let e=b();r(0,"tr",56)(1,"td")(2,"p-select",57),f(3,ea,12,9,"ng-template",null,7,C)(5,ta,10,2,"ng-template",null,4,C),o()(),r(7,"td"),d(8,"textarea",58),o(),r(9,"td"),d(10,"input",59),o(),r(11,"td"),d(12,"input",60),o(),r(13,"td")(14,"div",61)(15,"p-button",62),y("onClick",function(){let i=_(e).rowIndex,s=c(3);return h(s.removeItems(i))}),o()()()()}if(t&2){let e,n=l.rowIndex,i=c(3);p("formGroupName",n),a(2),p("filter",!0)("options",i.journalEntryForm().options.accounts)("virtualScrollItemSize",50)("showClear",(i.form.controls==null||i.form.controls.items==null||i.form.controls.items.controls[n]==null||(e=i.form.controls.items.controls[n].get("accountID"))==null?null:e.value)!==i.guidEmpty),a(8),p("autoNumeric",M(8,eo)),a(2),p("autoNumeric",M(9,eo)),a(3),p("text",!0)}}function na(t,l){if(t&1&&(r(0,"div",73),d(1,"i",74),F(2,"number"),o()),t&2){let e=c(4);a(),p("pTooltip",`The total debit and credit amounts must be equal
|
|
8
|
-
(Difference:${L(2,1,e.subTotalCredit()-e.subTotalDebit())}`)}}function oa(t,l){if(t&1){let e=b();r(0,"tr")(1,"td")(2,"div",67)(3,"div",12)(4,"p-button",68),y("onClick",function(){_(e);let i=c(3);return h(i.addItems())}),o()()()(),r(5,"td",69)(6,"span",70),m(7,"Total"),o()(),r(8,"td",71),m(9),F(10,"number"),o(),r(11,"td",71),m(12),F(13,"number"),o(),r(14,"td",69),f(15,na,3,3,"div",72),o()()}if(t&2){let e=c(3);a(8),p("ngClass",N(9,to,e.subTotalCredit()!==e.subTotalDebit())),a(),I(" ",L(10,5,e.subTotalDebit())," "),a(2),p("ngClass",N(11,to,e.subTotalCredit()!==e.subTotalDebit())),a(),I(" ",L(13,7,e.subTotalCredit())," "),a(3),p("ngIf",e.subTotalCredit()!==e.subTotalDebit())}}function ra(t,l){if(t&1){let e=b();r(0,"div",16)(1,"p-panel")(2,"p-scroll-panel",null,3)(4,"div",17)(5,"div",18)(6,"div",19)(7,"div",20)(8,"div",21)(9,"div",22)(10,"label",23),m(11,"Date"),o()(),d(12,"p-datepicker",24),o()(),r(13,"div",20)(14,"div",21)(15,"div",22)(16,"label",23),m(17,"Outlet"),o()(),r(18,"p-select",25),f(19,Wr,3,1,"ng-template",null,4,C),o()()(),r(21,"div",20)(22,"div",21)(23,"div",22)(24,"label",23),m(25,"Number"),o()(),d(26,"input",26),o()(),r(27,"div",20)(28,"div",21)(29,"div",22)(30,"label",23),m(31,"Contact"),o()(),r(32,"div",27),le(33,Zr,4,6,"div",28,ae),o()()(),r(35,"div",29)(36,"div",21)(37,"div",22)(38,"label",30),m(39),o()(),r(40,"p-autocomplete",31),y("completeMethod",function(i){_(e);let s=c(2);return h(s.searchCustomer(i))}),o()()()()(),r(41,"div",32)(42,"div",19)(43,"div",20)(44,"div",21)(45,"div",22)(46,"label",33),m(47,"Upload"),o()(),f(48,Yr,7,3,"div",34)(49,Xr,2,2,"div",35),o()(),r(50,"div",29)(51,"div",21)(52,"div",36)(53,"label",37),m(54,"Note"),o()(),r(55,"div",38),d(56,"textarea",39),o()()()()()(),d(57,"hr"),r(58,"div",40)(59,"div",32)(60,"p-table",41),f(61,Kr,10,0,"ng-template",null,5,C)(63,ia,16,10,"ng-template",null,6,C)(65,oa,16,13,"ng-template",null,2,C),o()()()()()()}if(t&2){let e,n=c(2);p("formGroup",n.form),a(2),H(M(13,Qr)),a(10),p("showIcon",!0),a(6),p("options",n.outlets())("showClear",!0),a(15),se(n.contactType()),a(6),S(+n.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),a(),p("suggestions",n.customerSuggestions())("placeholder",+n.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),a(8),it(!(n.form.controls.order==null||(e=n.form.controls.order.get("fileAttachment"))==null)&&e.value?48:49),a(8),p("ngClass",N(14,Gr,n.form.controls.order.controls.note.invalid&&(n.form.controls.order.controls.note.dirty||n.form.controls.order.controls.note.touched))),a(4),p("scrollable",!0)("value",n.form.controls.items.controls)}}function aa(t,l){if(t&1&&f(0,ra,67,16,"div",15),t&2){let e=c();p("ngIf",e.journalEntryForm())}}function la(t,l){if(t&1){let e=b();r(0,"p-button",75),y("click",function(){_(e);let i=c();return h(i.uploadDialogVisible.set(!1))}),o(),r(1,"p-button",76),y("click",function(){_(e);let i=c();return h(i.uploadDialogVisible.set(!1))}),o()}t&2&&p("text",!0)}function sa(){return t=>{let l=t.get("debitAmount")?.value,e=t.get("creditAmount")?.value;return l&&e?{bothFilled:!0}:null}}var Vi=(()=>{class t{constructor(){this.role=v(ri),this.fileAttachment=z(new File([],"")),this.activatedRoute=v(Te),this.router=v(ke),this.dayjsService=v(qe),this.journalEntryService=v(j),this.journalEntryForm=z(null),this.customerSuggestions=z([]),this.itemsForm=z([]),this.subTotalDebit=q(()=>this.itemsForm().reduce((e,n)=>e+ +n.debitAmount,0)),this.subTotalCredit=q(()=>this.itemsForm().reduce((e,n)=>e+ +n.creditAmount,0)),this.contactType=z([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=v(It),this.uploadDialogVisible=z(!1),this.guidEmpty=P,this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200},this.outlets=q(()=>this.journalEntryForm()?.options?.outlets||[]),this.toasr=v(Me),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(mi,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalEntryForm()}onToggleUploadDialog(){this.uploadDialogVisible.update(e=>!e)}onUploadDialog(e){io.default.parse(e.currentFiles[0],{complete:n=>{console.log("Parsed result:",n)},error:n=>{console.error("Parsing error:",n)}})}initializeForm(){this.form=new fe({order:new fe({id:new g("",[U.required]),number:new g("",[U.required]),date:new g({value:new Date,disabled:!this.role.accounting.DateEditor},[U.required]),note:new g(""),entryTypeID:new g(1,[U.required]),referenceID:new g(""),referenceTypeID:new g(0,[U.required]),referenceText:new g(""),contactID:new g(null),detailReferenceID:new g(""),creatorID:new g("",[U.required]),created:new g("",[U.required]),modifierID:new g(""),modified:new g(""),outletID:new g(null),statusID:new g(0),contactName:new g(""),contactType:new g(0),fileAttachment:new g(null)}),items:new jt([]),additionalAccountID:new g(""),file:new g(null),customerName:new g("")})}initializeFormEffect(){ot(()=>{let e=this.journalEntryForm();e&&(this.form.patchValue({order:E(w({},e.form.order),{entryTypeID:Number(e.form.order.entryTypeID===0&&1),referenceID:String(e.form.order.referenceID||P),contactID:this.activatedRoute.snapshot.paramMap.get("id")?{Key:e.form.order.contactID,Value:e.form.customerName}:null,detailReferenceID:String(e.form.order.detailReferenceID||P),contactName:String(e.form.order.contactName),date:Fi.default.isDayjs(e.form.order.date)?e.form.order.date.toDate():(0,Fi.default)().toDate(),modifierID:String(e.form.order.modifierID||P),statusID:e.form.order.statusID,modified:String(e.form.order.modified),outletID:e.form.order.outletID,fileAttachment:e.form.order.fileAttachment}),additionalAccountID:e.form.additionalAccountID,customerName:e.form.customerName}),this.updateFormItems(e.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(n=>{this.itemsForm.set(n)}))})}updateFormItems(e){let n=this.form.controls.items;n.clear(),e.forEach(i=>{n.push(new fe({id:new g(i.id),journalID:new g(i.journalID),accountID:new g(i.accountID),debitAmount:new g(i.debitAmount),creditAmount:new g(i.creditAmount),index:new g(i.index),note:new g(i.note)},{validators:sa()}))}),n.controls.forEach(i=>{i.get("debitAmount")?.valueChanges.pipe(D(s=>{s>0&&i.get("creditAmount")?.setValue(0,{emitEvent:!1})})).subscribe(),i.get("creditAmount")?.valueChanges.pipe(D(s=>{s>0&&i.get("debitAmount")?.setValue(0,{emitEvent:!1})})).subscribe()})}loadJournalEntryForm(){this.activatedRoute.data.pipe(ee(e=>e.form),D(e=>this.journalEntryForm.set(e))).subscribe()}searchCustomer(e){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(e.query).pipe(D(n=>this.customerSuggestions.set(n))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(e.query).pipe(D(n=>this.customerSuggestions.set(n))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new fe({id:new g(P.toString()),journalID:new g(P.toString()),accountID:new g(P.toString()),debitAmount:new g(0),creditAmount:new g(0),index:new g(this.form.controls.items.length??0),note:new g("")})),setTimeout(()=>{let e=this.scrollPanelContainer.contentViewChild.nativeElement;console.log("Scroll container:",e.scrollHeight),e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},0)}onSubmitJournalEntry(){if(this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue(),n=this.buildFormData(e);this.journalEntryService.submitJournalEntry(n).pipe(J("response"),D(()=>{this.form.controls.order.controls.date.disable(),this.router.navigate(["/pages/journal/journal-entry"])}),tt(i=>et(()=>i)),J("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),n=Object.entries(e).reduce((i,[s,u])=>(s==="items"?i[s]=u.map(x=>E(w({},x),{debitAmount:+x.debitAmount,creditAmount:+x.creditAmount})):s==="order"?i[s]=E(w({},u),{date:this.dayjsService.from(u.date)?this.dayjsService.format(u.date):null,contactID:u.contactID&&typeof u.contactID=="object"?u.contactID.Key:u.contactID||P}):i[s]=u,i),{});return JSON.parse(JSON.stringify(n,(i,s)=>s==="null"?null:s))}buildFormData(e){let n=new FormData;return n.append("Data",JSON.stringify(e)),n.append("File",this.fileAttachment()),n}onUpload(e){e instanceof Event||e instanceof File&&this.fileAttachment.set(e)}removeItems(e){this.form.controls.items.removeAt(e)}getFileAttachmentName(){return this.journalEntryService.getImageFileName(this.form.controls?.order?.controls?.fileAttachment?.value)||"No file attached"}onRemoveFileAttachment(){this.form.controls.order.controls.fileAttachment.setValue(null),this.toasr.info("File attachment removed successfully","Info")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-entry-form",8,"page"]],viewQuery:function(n,i){if(n&1&&O(Br,5),n&2){let s;T(s=k())&&(i.scrollPanelContainer=s.first)}},features:[pe([It,Qt])],attrs:$r,decls:10,vars:7,consts:[["actionButton",""],["content",""],["footer",""],["scrollPanelContainer",""],["item",""],["header",""],["body",""],["selectedItem",""],[3,"pageTitle","hasMainWrapperPadding"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],["position","bottom-right"],[1,"d-flex","gap-2"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row","gap-4"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"row"],[1,"col-3","d-flex"],["for","outlet",1,"m-0","fs-3","fw-normal"],["styleClass","w-100","size","small","formControlName","date",1,"col-6","p-0",3,"showIcon"],["filter","","filterBy","name","size","small","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"col-6","p-0",3,"options","showClear"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",1,"col-6"],[1,"col-6","d-flex","gap-2","p-0"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions","placeholder"],[1,"col"],["for","uploadFile",1,"m-0","fs-3","fw-normal"],[1,"col-9"],[1,"col-9","pl-0","position-relative"],[1,"col-3"],["for","",1,"mb-0","fs-3","fw-normal"],[1,"col-9","pl-0"],["rows","4","cols","30","pSize","small","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"ngClass"],["formArrayName","items",1,"row","mb-5"],["showGridlines","",3,"scrollable","value"],[1,"flex","items-center","gap-2",2,"height","38x"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],["formControlName","contactType","name","contactType",3,"value","inputId"],[1,"mb-0","d-flex","align-items-center","radiobutton-label",3,"for"],[1,"d-flex","align-items-center","p-2","gap-2","border","rounded","ps-3"],[1,"fa-solid","fa-file"],[1,"flex-grow-1"],["target","_blank",1,"text-truncate","d-block",2,"max-width","300px",3,"href","title"],["pButton","","icon","fa-solid fa-xmark","aria-label","Remove file",1,"p-button-rounded","p-button-text","p-button-sm","flex-shrink-0",3,"click"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],[2,"width","30%","min-width","120px"],[2,"min-width","150px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","3%","min-width","30px"],[3,"formGroupName"],["appendTo","body","size","small","filterBy","code,name","formControlName","accountID","virtualScroll","","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100",3,"filter","options","virtualScrollItemSize","showClear"],["rows","1","cols","30","pTextarea","","formControlName","note","pSize","small",1,"w-100"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","formControlName","creditAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],[1,"d-flex","justify-content-end"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],[1,""],[1,"h-full","align-middle"],["tooltipPosition","top",1,"m-0",3,"pTooltip"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"d-flex","justify-content-between","align-items-center"],["severity","secondary","outlined","","icon","fa-light fa-plus","size","small","label","Add new row",3,"onClick"],[1,"text-end"],[2,"vertical-align","middle"],[1,"text-end","footer-total",3,"ngClass"],["class","d-flex justify-content-center",4,"ngIf"],[1,"d-flex","justify-content-center"],["tooltipPosition","left",1,"fa-solid","fa-circle-info","text-danger",3,"pTooltip"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(n,i){if(n&1){let s=b();r(0,"app-main-panel",8),f(1,qr,4,2,"ng-template",null,0,C)(3,aa,1,1,"ng-template",null,1,C),o(),r(5,"p-dialog",9)(6,"p-fileupload",10),y("onSelect",function(x){return _(s),h(i.onUploadDialog(x))}),o(),f(7,la,2,1,"ng-template",null,2,C),o(),d(9,"p-toast",11)}n&2&&(p("pageTitle",i.activatedRoute.snapshot.params.id?"Edit Journal Form":"Manual Journal Form")("hasMainWrapperPadding",!0),a(5),H(M(6,Ur)),p("modal",!0)("visible",i.uploadDialogVisible()))},dependencies:[ze,Re,Fe,Ve,Pe,Ae,lt,st,ne,X,De,te,ce,Qe,He,Ue,$e,he,_e,bt,Ct,_t,gt,be,Ce,ye,vn,ie,ve,Wt,Zt,xe,Ge,li,ht,Xt,ut,dt,vt,ei,pt,mt,Le,Ne,ue,de,yt,ft,Be,je],styles:[".footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:16px}[_nghost-%COMP%] .p-datatable .p-select{border:none;box-shadow:none}[_nghost-%COMP%] .p-datatable .p-select .p-select-label{padding:0}[_nghost-%COMP%] .p-datatable .p-textarea{border:none;box-shadow:none;padding:0}[_nghost-%COMP%] .p-datatable .p-inputtext{border:none;box-shadow:none;padding-right:0}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:not(:last-child){border-top:1px solid var(--p-datatable-footer-cell-border-color)}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:last-child{border-top:none}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td{border-left:none;border-right:none;border-bottom:none}[_nghost-%COMP%] .p-datatable .p-datatable-thead>tr>th:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;background:transparent!important}[_nghost-%COMP%] .p-datatable .p-datatable-tbody>tr>td:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;padding:0 .25rem!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:first-child{padding:0!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot .p-button .p-button-label{font-size:12px!important}"]})}}return t})();var Pi=t=>{let l=v(j),e=v(xt);return e.show(),console.log("journalEntryResolver",t),l.getJournalEntryForm(t.paramMap.get("id")??"").pipe(J("response"),D(()=>e.hide()))};var ma=["indicator"],pa=["rotaterighticon"],ca=["rotatelefticon"],da=["zoomouticon"],ua=["zoominicon"],fa=["closeicon"],ga=["preview"],_a=["image"],ha=["mask"],ya=["previewButton"],va=["closeButton"],Ca=t=>({errorCallback:t}),ba=(t,l)=>({height:t,width:l}),xa=t=>({"p-image-action p-image-zoom-out-button":!0,"p-disabled":t}),wa=t=>({"p-image-action p-image-zoom-in-button":!0,"p-disabled":t}),Ia=(t,l)=>({showTransitionParams:t,hideTransitionParams:l}),Ea=t=>({value:"visible",params:t}),Sa=(t,l)=>({class:"p-image-original",style:t,previewCallback:l});function Da(t,l){if(t&1){let e=b();Q(0),r(1,"img",9),y("error",function(i){_(e);let s=c();return h(s.imageError(i))}),o(),G()}if(t&2){let e=c();a(),$(e.imageClass),p("ngStyle",e.imageStyle),V("src",e.src,Ie)("srcset",e.srcSet)("sizes",e.sizes)("alt",e.alt)("width",e.width)("height",e.height)("loading",e.loading)}}function Ta(t,l){t&1&&Se(0)}function ka(t,l){t&1&&Se(0)}function Ma(t,l){if(t&1&&(Q(0),f(1,ka,1,0,"ng-container",12),G()),t&2){let e=c(2);a(),p("ngTemplateOutlet",e.indicatorTemplate||e._indicatorTemplate)}}function Ra(t,l){t&1&&d(0,"EyeIcon",13),t&2&&p("styleClass","p-image-preview-icon")}function Fa(t,l){if(t&1){let e=b();r(0,"button",10,0),y("click",function(){_(e);let i=c();return h(i.onImageClick())}),f(2,Ma,2,1,"ng-container",11)(3,Ra,1,1,"ng-template",null,1,C),o()}if(t&2){let e=Pt(4),n=c();p("ngStyle",nt(4,ba,n.height+"px",n.width+"px")),V("aria-label",n.zoomImageAriaLabel),a(2),p("ngIf",n.indicatorTemplate||!n._indicatorTemplate)("ngIfElse",e)}}function Va(t,l){t&1&&d(0,"RefreshIcon")}function Pa(t,l){}function Aa(t,l){t&1&&f(0,Pa,0,0,"ng-template")}function za(t,l){t&1&&d(0,"UndoIcon")}function Ja(t,l){}function Oa(t,l){t&1&&f(0,Ja,0,0,"ng-template")}function Na(t,l){t&1&&d(0,"SearchMinusIcon")}function La(t,l){}function ja(t,l){t&1&&f(0,La,0,0,"ng-template")}function Ba(t,l){t&1&&d(0,"SearchPlusIcon")}function $a(t,l){}function Ua(t,l){t&1&&f(0,$a,0,0,"ng-template")}function Ha(t,l){t&1&&d(0,"TimesIcon")}function Qa(t,l){}function Ga(t,l){t&1&&f(0,Qa,0,0,"ng-template")}function qa(t,l){if(t&1){let e=b();Q(0),r(1,"img",20),y("click",function(){_(e);let i=c(3);return h(i.onPreviewImageClick())}),o(),G()}if(t&2){let e=c(3);a(),p("ngStyle",e.imagePreviewStyle()),V("src",e.previewImageSrc?e.previewImageSrc:e.src,Ie)("srcset",e.previewImageSrcSet)("sizes",e.previewImageSizes)}}function Wa(t,l){t&1&&Se(0)}function Za(t,l){if(t&1){let e=b();r(0,"div"),y("@animation.start",function(i){_(e);let s=c(2);return h(s.onAnimationStart(i))})("@animation.done",function(i){_(e);let s=c(2);return h(s.onAnimationEnd(i))}),f(1,qa,2,4,"ng-container",5)(2,Wa,1,0,"ng-container",6),o()}if(t&2){let e=c(2);p("@animation",N(7,Ea,nt(4,Ia,e.showTransitionOptions,e.hideTransitionOptions))),a(),p("ngIf",!e.previewTemplate&&!e._previewTemplate),a(),p("ngTemplateOutlet",e.previewTemplate||e._previewTemplate)("ngTemplateOutletContext",nt(9,Sa,e.imagePreviewStyle(),e.onPreviewImageClick.bind(e)))}}function Ya(t,l){if(t&1){let e=b();r(0,"div",14,2),y("click",function(){_(e);let i=c();return h(i.onMaskClick())})("keydown",function(i){_(e);let s=c();return h(s.onMaskKeydown(i))}),r(2,"div",15),y("click",function(i){_(e);let s=c();return h(s.handleToolbarClick(i))}),r(3,"button",16),y("click",function(){_(e);let i=c();return h(i.rotateRight())}),f(4,Va,1,0,"RefreshIcon",5)(5,Aa,1,0,null,12),o(),r(6,"button",17),y("click",function(){_(e);let i=c();return h(i.rotateLeft())}),f(7,za,1,0,"UndoIcon",5)(8,Oa,1,0,null,12),o(),r(9,"button",18),y("click",function(){_(e);let i=c();return h(i.zoomOut())}),f(10,Na,1,0,"SearchMinusIcon",5)(11,ja,1,0,null,12),o(),r(12,"button",18),y("click",function(){_(e);let i=c();return h(i.zoomIn())}),f(13,Ba,1,0,"SearchPlusIcon",5)(14,Ua,1,0,null,12),o(),r(15,"button",19,3),y("click",function(){_(e);let i=c();return h(i.closePreview())}),f(17,Ha,1,0,"TimesIcon",5)(18,Ga,1,0,null,12),o()(),f(19,Za,3,12,"div",5),o()}if(t&2){let e=c();V("aria-modal",e.maskVisible),a(3),V("aria-label",e.rightAriaLabel()),a(),p("ngIf",!e.rotateRightIconTemplate&&!e._rotateRightIconTemplate),a(),p("ngTemplateOutlet",e.rotateRightIconTemplate||e._rotateRightIconTemplate),a(),V("aria-label",e.leftAriaLabel()),a(),p("ngIf",!e.rotateLeftIconTemplate&&!e._rotateLeftIconTemplate),a(),p("ngTemplateOutlet",e.rotateLeftIconTemplate||e._rotateLeftIconTemplate),a(),p("ngClass",N(21,xa,e.isZoomOutDisabled))("disabled",e.isZoomOutDisabled),V("aria-label",e.zoomOutAriaLabel()),a(),p("ngIf",!e.zoomOutIconTemplate&&!e._zoomOutIconTemplate),a(),p("ngTemplateOutlet",e.zoomOutIconTemplate||e._zoomOutIconTemplate),a(),p("ngClass",N(23,wa,e.isZoomOutDisabled))("disabled",e.isZoomInDisabled),V("aria-label",e.zoomInAriaLabel()),a(),p("ngIf",!e.zoomInIconTemplate&&!e._zoomInIconTemplate),a(),p("ngTemplateOutlet",e.zoomInIconTemplate||e._zoomInIconTemplate),a(),V("aria-label",e.closeAriaLabel()),a(2),p("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),p("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate),a(),p("ngIf",e.previewVisible)}}var Xa=({dt:t})=>`
|
|
9
|
-
.p-image-mask {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.p-image-preview {
|
|
16
|
-
position: relative;
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
line-height: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.p-image-preview-mask {
|
|
22
|
-
position: absolute;
|
|
23
|
-
inset-inline-start: 0;
|
|
24
|
-
inset-block-start: 0;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
opacity: 0;
|
|
31
|
-
transition: opacity 0.3s;
|
|
32
|
-
border: 0 none;
|
|
33
|
-
padding: 0;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
background: transparent;
|
|
36
|
-
color: ${t("image.preview.mask.color")};
|
|
37
|
-
transition: background ${t("image.transition.duration")};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.p-image-preview:hover > .p-image-preview-mask {
|
|
41
|
-
opacity: 1;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
background: ${t("image.preview.mask.background")};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.p-image-preview-icon {
|
|
47
|
-
font-size: ${t("image.preview.icon.size")};
|
|
48
|
-
width: ${t("image.preview.icon.size")};
|
|
49
|
-
height: ${t("image.preview.icon.size")};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.p-image-toolbar {
|
|
53
|
-
position: absolute;
|
|
54
|
-
inset-block-start: ${t("image.toolbar.position.top")};
|
|
55
|
-
inset-inline-end: ${t("image.toolbar.position.right")};
|
|
56
|
-
inset-inline-start: ${t("image.toolbar.position.left")};
|
|
57
|
-
inset-block-end: ${t("image.toolbar.position.bottom")};
|
|
58
|
-
display: flex;
|
|
59
|
-
z-index: 1;
|
|
60
|
-
padding: ${t("image.toolbar.padding")};
|
|
61
|
-
background: ${t("image.toolbar.background")};
|
|
62
|
-
backdrop-filter: blur(${t("image.toolbar.blur")});
|
|
63
|
-
border-color: ${t("image.toolbar.border.color")};
|
|
64
|
-
border-style: solid;
|
|
65
|
-
border-width: ${t("image.toolbar.border.width")};
|
|
66
|
-
border-radius: ${t("image.toolbar.border.radius")};
|
|
67
|
-
gap: ${t("image.toolbar.gap")};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.p-image-action {
|
|
71
|
-
display: inline-flex;
|
|
72
|
-
justify-content: center;
|
|
73
|
-
align-items: center;
|
|
74
|
-
color: ${t("image.action.color")};
|
|
75
|
-
background: transparent;
|
|
76
|
-
width: ${t("image.action.size")};
|
|
77
|
-
height: ${t("image.action.size")};
|
|
78
|
-
margin: 0;
|
|
79
|
-
padding: 0;
|
|
80
|
-
border: 0 none;
|
|
81
|
-
cursor: pointer;
|
|
82
|
-
user-select: none;
|
|
83
|
-
border-radius: ${t("image.action.border.radius")};
|
|
84
|
-
outline-color: transparent;
|
|
85
|
-
transition: background ${t("image.transition.duration")}, color ${t("image.transition.duration")}, outline-color ${t("image.transition.duration")}, box-shadow ${t("image.transition.duration")};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.p-image-action:hover {
|
|
89
|
-
color: ${t("image.action.hover.color")};
|
|
90
|
-
background: ${t("image.action.hover.background")};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.p-image-action:focus-visible {
|
|
94
|
-
box-shadow: ${t("toolbar.action.focus.ring.shadow")};
|
|
95
|
-
outline: ${t("toolbar.action.focus.ring.width")} ${t("toolbar.action.focus.ring.style")} ${t("toolbar.action.focus.ring.color")};
|
|
96
|
-
outline-offset: ${t("toolbar.action.focus.ring.offset")};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.p-image-action .p-icon {
|
|
100
|
-
font-size: ${t("image.action.icon.size")};
|
|
101
|
-
width: ${t("image.action.icon.size")};
|
|
102
|
-
height: ${t("image.action.icon.size")};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.p-image-action.p-disabled {
|
|
106
|
-
pointer-events: auto;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.p-image-original {
|
|
110
|
-
transition: transform 0.15s;
|
|
111
|
-
max-width: 100vw;
|
|
112
|
-
max-height: 100vh;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.p-image-original-enter-active {
|
|
116
|
-
transition: all 150ms cubic-bezier(0, 0, 0.2, 1);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.p-image-original-leave-active {
|
|
120
|
-
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.p-image-original-enter-from,
|
|
124
|
-
.p-image-original-leave-to {
|
|
125
|
-
opacity: 0;
|
|
126
|
-
transform: scale(0.7);
|
|
127
|
-
}
|
|
128
|
-
`,Ka={root:({props:t})=>["p-image p-component",{"p-image-preview":t.preview}],previewMask:"p-image-preview-mask",previewIcon:"p-image-preview-icon",mask:"p-image-mask p-overlay-mask p-overlay-mask-enter",toolbar:"p-image-toolbar",rotateRightButton:"p-image-action p-image-rotate-right-button",rotateLeftButton:"p-image-action p-image-rotate-left-button",zoomOutButton:({instance:t})=>["p-image-action p-image-zoom-out-button",{"p-disabled":t.isZoomOutDisabled}],zoomInButton:({instance:t})=>["p-image-action p-image-zoom-in-button",{"p-disabled":t.isZoomInDisabled}],closeButton:"p-image-action p-image-close-button",original:"p-image-original"},no=(()=>{class t extends _n{name="image";theme=Xa;classes=Ka;static \u0275fac=(()=>{let e;return function(i){return(e||(e=W(t)))(i||t)}})();static \u0275prov=Ze({token:t,factory:t.\u0275fac})}return t})();var Ai=(()=>{class t extends Gt{imageClass;imageStyle;styleClass;style;src;srcSet;sizes;previewImageSrc;previewImageSrcSet;previewImageSizes;alt;width;height;loading;appendTo;preview=!1;showTransitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";onShow=new Ft;onHide=new Ft;onImageError=new Ft;mask;previewButton;closeButton;indicatorTemplate;rotateRightIconTemplate;rotateLeftIconTemplate;zoomOutIconTemplate;zoomInIconTemplate;closeIconTemplate;previewTemplate;imageTemplate;maskVisible=!1;previewVisible=!1;rotate=0;scale=1;previewClick=!1;container;wrapper;_componentStyle=v(no);get isZoomOutDisabled(){return this.scale-this.zoomSettings.step<=this.zoomSettings.min}get isZoomInDisabled(){return this.scale+this.zoomSettings.step>=this.zoomSettings.max}zoomSettings={default:1,step:.1,max:1.5,min:.5};constructor(){super()}templates;_indicatorTemplate;_rotateRightIconTemplate;_rotateLeftIconTemplate;_zoomOutIconTemplate;_zoomInIconTemplate;_closeIconTemplate;_imageTemplate;_previewTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"indicator":this._indicatorTemplate=e.template;break;case"rotaterighticon":this._rotateRightIconTemplate=e.template;break;case"rotatelefticon":this._rotateLeftIconTemplate=e.template;break;case"zoomouticon":this._zoomOutIconTemplate=e.template;break;case"zoominicon":this._zoomInIconTemplate=e.template;break;case"closeicon":this._closeIconTemplate=e.template;break;case"image":this._imageTemplate=e.template;break;case"preview":this._previewTemplate=e.template;break;default:this._indicatorTemplate=e.template;break}})}onImageClick(){this.preview&&(this.maskVisible=!0,this.previewVisible=!0,cn())}onMaskClick(){this.previewClick||this.closePreview(),this.previewClick=!1}onMaskKeydown(e){switch(e.code){case"Escape":this.onMaskClick(),setTimeout(()=>{hi(this.previewButton.nativeElement)},25),e.preventDefault();break;default:break}}onPreviewImageClick(){this.previewClick=!0}rotateRight(){this.rotate+=90,this.previewClick=!0}rotateLeft(){this.rotate-=90,this.previewClick=!0}zoomIn(){this.scale=this.scale+this.zoomSettings.step,this.previewClick=!0}zoomOut(){this.scale=this.scale-this.zoomSettings.step,this.previewClick=!0}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.wrapper=this.container?.parentElement,this.appendContainer(),this.moveOnTop(),setTimeout(()=>{hi(this.closeButton.nativeElement)},25);break;case"void":Je(this.wrapper,"p-overlay-mask-leave");break}}onAnimationEnd(e){switch(e.toState){case"void":Ee.clear(this.wrapper),this.maskVisible=!1,this.container=null,this.wrapper=null,this.cd.markForCheck(),this.onHide.emit({});break;case"visible":this.onShow.emit({});break}}moveOnTop(){Ee.set("modal",this.wrapper,this.config.zIndex.modal)}appendContainer(){this.appendTo&&(this.appendTo==="body"?this.document.body.appendChild(this.wrapper):Ut(this.appendTo,this.wrapper))}imagePreviewStyle(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}}get zoomImageAriaLabel(){return this.config.translation.aria?this.config.translation.aria.zoomImage:void 0}containerClass(){return{"p-image p-component":!0,"p-image-preview":this.preview}}handleToolbarClick(e){e.stopPropagation()}closePreview(){this.previewVisible=!1,this.rotate=0,this.scale=this.zoomSettings.default,dn()}imageError(e){this.onImageError.emit(e)}rightAriaLabel(){return this.config.translation.aria?this.config.translation.aria.rotateRight:void 0}leftAriaLabel(){return this.config.translation.aria?this.config.translation.aria.rotateLeft:void 0}zoomInAriaLabel(){return this.config.translation.aria?this.config.translation.aria.zoomIn:void 0}zoomOutAriaLabel(){return this.config.translation.aria?this.config.translation.aria.zoomOut:void 0}closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}onKeydownHandler(e){this.previewVisible&&this.closePreview()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=R({type:t,selectors:[["p-image"]],contentQueries:function(n,i,s){if(n&1&&(me(s,ma,4),me(s,pa,4),me(s,ca,4),me(s,da,4),me(s,ua,4),me(s,fa,4),me(s,ga,4),me(s,_a,4),me(s,fn,4)),n&2){let u;T(u=k())&&(i.indicatorTemplate=u.first),T(u=k())&&(i.rotateRightIconTemplate=u.first),T(u=k())&&(i.rotateLeftIconTemplate=u.first),T(u=k())&&(i.zoomOutIconTemplate=u.first),T(u=k())&&(i.zoomInIconTemplate=u.first),T(u=k())&&(i.closeIconTemplate=u.first),T(u=k())&&(i.previewTemplate=u.first),T(u=k())&&(i.imageTemplate=u.first),T(u=k())&&(i.templates=u)}},viewQuery:function(n,i){if(n&1&&(O(ha,5),O(ya,5),O(va,5)),n&2){let s;T(s=k())&&(i.mask=s.first),T(s=k())&&(i.previewButton=s.first),T(s=k())&&(i.closeButton=s.first)}},hostBindings:function(n,i){n&1&&y("keydown.escape",function(u){return i.onKeydownHandler(u)},!1,Qi)},inputs:{imageClass:"imageClass",imageStyle:"imageStyle",styleClass:"styleClass",style:"style",src:"src",srcSet:"srcSet",sizes:"sizes",previewImageSrc:"previewImageSrc",previewImageSrcSet:"previewImageSrcSet",previewImageSizes:"previewImageSizes",alt:"alt",width:"width",height:"height",loading:"loading",appendTo:"appendTo",preview:[2,"preview","preview",on],showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions"},outputs:{onShow:"onShow",onHide:"onHide",onImageError:"onImageError"},features:[pe([no]),Z],decls:5,vars:11,consts:[["previewButton",""],["defaultTemplate",""],["mask",""],["closeButton",""],[3,"ngClass","ngStyle"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["type","button","class","p-image-preview-mask",3,"ngStyle","click",4,"ngIf"],["class","p-image-mask p-overlay-mask p-overlay-mask-enter","role","dialog","pFocusTrap","",3,"click","keydown",4,"ngIf"],[3,"error","ngStyle"],["type","button",1,"p-image-preview-mask",3,"click","ngStyle"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[3,"styleClass"],["role","dialog","pFocusTrap","",1,"p-image-mask","p-overlay-mask","p-overlay-mask-enter",3,"click","keydown"],[1,"p-image-toolbar",3,"click"],["type","button",1,"p-image-action","p-image-rotate-right-button",3,"click"],["type","button",1,"p-image-action","p-image-rotate-left-button",3,"click"],["type","button",3,"click","ngClass","disabled"],["type","button",1,"p-image-action","p-image-close-button",3,"click"],[1,"p-image-original",3,"click","ngStyle"]],template:function(n,i){n&1&&(r(0,"span",4),f(1,Da,2,10,"ng-container",5)(2,Ta,1,0,"ng-container",6)(3,Fa,5,7,"button",7)(4,Ya,20,25,"div",8),o()),n&2&&($(i.styleClass),p("ngClass",i.containerClass())("ngStyle",i.style),a(),p("ngIf",!i.imageTemplate&&!i._imageTemplate),a(),p("ngTemplateOutlet",i.imageTemplate||i._imageTemplate)("ngTemplateOutletContext",N(9,Ca,i.imageError.bind(i))),a(),p("ngIf",i.preview),a(),p("ngIf",i.maskVisible))},dependencies:[X,De,te,Jt,zt,Nn,On,Bn,Ln,jn,qt,Yt,Oe],encapsulation:2,data:{animation:[Nt("animation",[at("void => visible",[Xe({transform:"scale(0.7)",opacity:0}),rt("{{showTransitionParams}}")]),at("visible => void",[rt("{{hideTransitionParams}}",Xe({transform:"scale(0.7)",opacity:0}))])])]},changeDetection:0})}return t})(),oo=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Vt({type:t});static \u0275inj=Mt({imports:[Ai,Oe,Oe]})}return t})();var tl=()=>["edit"],il=()=>["/pages/report/general-ledger"],nl=t=>({id:t});function ol(t,l){if(t&1){let e=b();r(0,"a",7),d(1,"i",8),m(2," Edit "),o(),r(3,"p-button",9),y("onClick",function(){_(e);let i=c();return h(i.onDeleteJournal())}),o()}t&2&&p("routerLink",M(1,tl))}function rl(t,l){if(t&1&&d(0,"p-image",20),t&2){let e=c(4);p("src",e.journalEntryInfo().order.fileAttachment)("preview",!0)}}function al(t,l){if(t&1&&(r(0,"a",21),m(1,"File Attachment"),o()),t&2){let e=c(4);p("href",e.journalEntryInfo().order.fileAttachment,Ie)}}function ll(t,l){if(t&1&&(Q(0),f(1,rl,1,2,"p-image",20)(2,al,2,1,"a",21),G()),t&2){let e=c(3);a(),it(e.isImageExtension()?1:2)}}function sl(t,l){t&1&&(r(0,"span",22),m(1,"No file attached"),o())}function ml(t,l){if(t&1&&(r(0,"div",13)(1,"div",15),m(2,"File Attachment"),o(),r(3,"div",14),f(4,ll,3,1,"ng-container",19)(5,sl,2,0,"ng-template",null,5,C),o()()),t&2){let e=Pt(6),n=c(2);a(4),p("ngIf",n.journalEntryInfo().order.fileAttachment)("ngIfElse",e)}}function pl(t,l){t&1&&(r(0,"tr")(1,"th",23),m(2,"Code"),o(),r(3,"th"),m(4,"Account"),o(),r(5,"th",24),m(6,"Debit"),o(),r(7,"th",24),m(8,"Credit"),o()())}function cl(t,l){if(t&1&&(r(0,"div",28),m(1),o()),t&2){let e=c().$implicit;a(),I(" ",e.note," ")}}function dl(t,l){if(t&1&&(r(0,"tr")(1,"td")(2,"a",25),m(3),o()(),r(4,"td"),m(5),f(6,cl,2,1,"div",26),o(),r(7,"td",27),m(8),F(9,"number"),o(),r(10,"td",27),m(11),F(12,"number"),o()()),t&2){let e=l.$implicit;a(2),p("routerLink",M(11,il))("queryParams",N(12,nl,e.accountID)),a(),S(e.accountCode),a(2),I(" ",e.accountName," "),a(),p("ngIf",e.note),a(2),S(L(9,7,e.debitAmount)),a(3),S(L(12,9,e.creditAmount))}}function ul(t,l){if(t&1&&(r(0,"tr")(1,"td",29),m(2,"Total"),o(),r(3,"td",27),m(4),F(5,"number"),o(),r(6,"td",27),m(7),F(8,"number"),o()()),t&2){let e=c(2);a(4),S(L(5,2,e.totalDebitAmount())),a(3),S(L(8,4,e.totalCreditAmount()))}}function fl(t,l){if(t&1&&(r(0,"div",10)(1,"div",11)(2,"p-card",12)(3,"div",13)(4,"div",14)(5,"div",13)(6,"div",15),m(7,"Date"),o(),r(8,"div",14),m(9),F(10,"date"),o()(),d(11,"hr"),r(12,"div",13)(13,"div",15),m(14,"Number"),o(),r(15,"div",14),m(16),o()(),d(17,"hr"),r(18,"div",13)(19,"div",15),m(20,"Outlet"),o(),r(21,"div",14),m(22),o()(),d(23,"hr"),f(24,ml,7,2,"div",16),o(),r(25,"div",14)(26,"div",13)(27,"div",15),m(28,"Contact"),o(),r(29,"div",14),m(30),o()(),d(31,"hr"),r(32,"div",13)(33,"div",15),m(34,"Note"),o(),r(35,"div",14),m(36),o()(),d(37,"hr"),o()()()(),r(38,"div",14)(39,"p-card")(40,"p-table",17),f(41,pl,9,0,"ng-template",null,2,C)(43,dl,13,14,"ng-template",null,3,C)(45,ul,9,6,"ng-template",null,4,C),o()()(),r(47,"div",11)(48,"p-card")(49,"div",13)(50,"div",14)(51,"span",18),m(52,"Created: "),o(),m(53),F(54,"date"),o()()()()()),t&2){let e,n,i,s,u,x,B,A=c();a(9),I(" ",Y(10,9,(e=A.journalEntryInfo())==null||e.order==null?null:e.order.date,"dd MMM yy")," "),a(7),S((n=A.journalEntryInfo())==null||n.order==null?null:n.order.number),a(6),I(" ",(i=A.journalEntryInfo())==null||i.order==null?null:i.order.outletName," "),a(2),p("ngIf",(s=A.journalEntryInfo())==null||s.order==null?null:s.order.fileAttachment),a(6),I(" ",(u=A.journalEntryInfo())==null||u.order==null?null:u.order.contactName," "),a(6),S((x=A.journalEntryInfo())==null||x.order==null?null:x.order.note),a(4),p("value",(B=A.journalEntryInfo())==null?null:B.items),a(13),At("",Y(54,12,A.journalEntryInfo().order.created,"dd MMM yyyy HH:mm")," - [",A.journalEntryInfo().order.creatorName,"] ")}}var ro=(()=>{class t{constructor(){this.journalEntryService=v(j),this.route=v(Te),this.router=v(ke),this.journalEntryInfo=z(null),this.totalDebitAmount=q(()=>this.journalEntryInfo()?.items?.reduce((n,i)=>n+i.debitAmount,0)||0),this.totalCreditAmount=q(()=>this.journalEntryInfo()?.items?.reduce((n,i)=>n+i.creditAmount,0)||0)}ngOnInit(){this.route.paramMap.pipe(kt(e=>e.has("id")),ee(e=>e.get("id")),We(e=>this.journalEntryService.getJournalEntryInfo(e)),D(e=>this.journalEntryInfo.set(e)),J("response")).subscribe()}onDeleteJournal(){if(!confirm("Are you sure you want to delete this journal entry?"))return;let e=this.route.snapshot.paramMap.get("id");e&&this.journalEntryService.deleteJournalEntry([e]).pipe(D(()=>{this.router.navigate(["/pages/journal/journal-entry"])})).subscribe()}get fileExtension(){let e=this.journalEntryInfo()?.order?.fileAttachment;if(e){let n=e.match(/\.([0-9a-z]+)(?:[?#]|$)/i);return n?n[1].toLowerCase():""}return""}isImageExtension(){let e=this.fileExtension;return["jpg","jpeg","png","gif","bmp","webp"].includes(e)}isPdfExtension(){return this.fileExtension==="pdf"}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-entry-info"]],decls:5,vars:3,consts:[["actionButton",""],["content",""],["header",""],["body",""],["footer",""],["noFile",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"row","row-gap-4"],[1,"col-12"],["header","Details"],[1,"row"],[1,"col"],[1,"col-2"],["class","row",4,"ngIf"],[3,"value"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],["alt","image","width","250",3,"src","preview"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-muted"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"link","link-primary",3,"routerLink","queryParams"],["class","text-warning",4,"ngIf"],[1,"text-end"],[1,"text-warning"],["colspan","2",1,"text-end"]],template:function(n,i){if(n&1&&(r(0,"app-main-panel",6),f(1,ol,4,2,"ng-template",null,0,C)(3,fl,55,15,"ng-template",null,1,C),o()),n&2){let s;p("pageTitle","Journal #"+((s=i.journalEntryInfo())==null||s.order==null?null:s.order.number))("hasMainWrapperPadding",!0)("overflowScroll",!0)}},dependencies:[ne,X,te,ce,Ot,ve,Dn,be,Ce,ue,de,ye,ie,oo,Ai],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ao=t=>{let l=v(j),e=v(xt);return e.show(),console.log("journalEntryResolver",t),l.getJournalRecordExpenseLoader().pipe(J("response"),D(()=>e.hide()))};var Ji=Ke(Kt());var lo=Ke(zn());var gl=["scrollPanelContainer"],_l=()=>({width:"25rem"}),hl=()=>[".."],yl=()=>({height:"calc(100vh - 140px)"}),zi=t=>({"ng-invalid ng-dirty":t}),vl=()=>({});function Cl(t,l){if(t&1){let e=b();r(0,"div",11)(1,"a",12),m(2,"Cancel"),o(),r(3,"p-button",13),y("onClick",function(){_(e);let i=c();return h(i.onSubmitJournalEntry())}),o()()}t&2&&(a(),p("routerLink",M(1,hl)))}function bl(t,l){if(t&1&&(r(0,"div",40)(1,"div",41),m(2),o()()),t&2){let e=l.$implicit;a(2),I(" ",e.name," ")}}function xl(t,l){if(t&1&&(r(0,"div",26),d(1,"p-radiobutton",42),r(2,"label",43),m(3),o()()),t&2){let e=l.$implicit;a(),p("value",e.key),a(2),S(e.value)}}function wl(t,l){if(t&1&&(r(0,"div",11)(1,"div",44)(2,"span",45),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"span",46),m(8),o()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(5),S(e.name)}}function Il(t,l){if(t&1&&(r(0,"div",11)(1,"div",44)(2,"span",45),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",44)(8,"span",47),m(9),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(6),S(e.name)}}function El(t,l){t&1&&(r(0,"tr")(1,"th",48),m(2,"Account"),o(),r(3,"th",48),m(4,"Note"),o(),r(5,"th",49),m(6," Amount "),o(),d(7,"th",50),o())}function Sl(t,l){if(t&1&&(r(0,"div",11)(1,"div",44)(2,"span",45),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",44)(8,"p",57),F(9,"truncate"),m(10),F(11,"truncate"),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(5),p("pTooltip",Y(9,3,e.name,12)!==e.name?e.name:null),a(2),I(" ",Y(11,6,e.name,12)," ")}}function Dl(t,l){if(t&1&&(r(0,"div",11)(1,"div",44)(2,"span",45),m(3),o()(),r(4,"div")(5,"span"),m(6,"-"),o()(),r(7,"div",44)(8,"span",58),m(9),o()()()),t&2){let e=l.$implicit;a(3),I("(",e.code,")"),a(6),S(e.name)}}function Tl(t,l){if(t&1){let e=b();r(0,"tr",51)(1,"td")(2,"p-select",52),f(3,Sl,12,9,"ng-template",null,5,C)(5,Dl,10,2,"ng-template",null,4,C),o()(),r(7,"td"),d(8,"textarea",53),o(),r(9,"td"),d(10,"input",54),o(),r(11,"td")(12,"div",55)(13,"p-button",56),y("onClick",function(){let i=_(e).rowIndex,s=c(3);return h(s.removeItems(i))}),o()()()()}if(t&2){let e,n=l.rowIndex,i=c(3);p("formGroupName",n),a(2),p("options",i.JournalExpenseRecord().options.accounts)("showClear",(i.form.controls==null||i.form.controls.items==null||i.form.controls.items.controls[n]==null||(e=i.form.controls.items.controls[n].get("accountID"))==null?null:e.value)!==i.guidEmpty),a(8),p("autoNumeric",M(5,vl)),a(3),p("text",!0)}}function kl(t,l){if(t&1){let e=b();r(0,"tr")(1,"td")(2,"div",59)(3,"div",11)(4,"p-button",60),y("onClick",function(){_(e);let i=c(3);return h(i.addItems())}),o()()()(),r(5,"td",61)(6,"span",62),m(7,"Total"),o()(),r(8,"td",63),m(9),F(10,"number"),o(),d(11,"td",64),o()}if(t&2){let e=c(3);a(9),I(" ",L(10,1,e.subTotalDebit())," ")}}function Ml(t,l){if(t&1){let e=b();r(0,"div",15)(1,"p-panel")(2,"p-scroll-panel",null,3)(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19)(8,"div",16)(9,"div",20)(10,"label",21),m(11,"Date"),o()(),d(12,"p-datepicker",22),o()(),r(13,"div",19)(14,"div",16)(15,"div",20)(16,"label",21),m(17,"Outlet"),o()(),r(18,"p-select",23),f(19,bl,3,1,"ng-template",null,4,C),o()()(),r(21,"div",19)(22,"div",16)(23,"div",20)(24,"label",21),m(25,"Number"),o()(),d(26,"input",24),o()(),r(27,"div",19)(28,"div",16)(29,"div",20)(30,"label",21),m(31,"Contact"),o()(),r(32,"div",25),le(33,xl,4,2,"div",26,ae),o()()(),r(35,"div",27)(36,"div",16)(37,"div",20)(38,"label",28),m(39),o()(),r(40,"p-autocomplete",29),y("completeMethod",function(i){_(e);let s=c(2);return h(s.searchCustomer(i))}),o()()(),r(41,"div",30)(42,"div",16)(43,"div",20)(44,"label",28),m(45,"Payments"),o()(),r(46,"p-select",31),f(47,wl,9,2,"ng-template",null,5,C)(49,Il,10,2,"ng-template",null,4,C),o()()()()(),r(51,"div",32)(52,"div",18)(53,"div",30)(54,"div",16)(55,"div",33)(56,"label",28),m(57,"Upload"),o()(),r(58,"div",34)(59,"POS-uppy",35),y("fileUploaded",function(i){_(e);let s=c(2);return h(s.onUpload(i))}),o()()()(),r(60,"div",19)(61,"div",16)(62,"div",33)(63,"label",28),m(64,"Note"),o()(),r(65,"div",34),d(66,"textarea",36),o()()()()()(),d(67,"hr"),r(68,"div",37)(69,"div",38)(70,"p-table",39),f(71,El,8,0,"ng-template",null,6,C)(73,Tl,14,6,"ng-template",null,7,C)(75,kl,12,3,"ng-template",null,2,C),o()()()()()()}if(t&2){let e=c(2);p("formGroup",e.form),a(2),H(M(17,yl)),a(10),p("showIcon",!0)("ngClass",N(18,zi,e.form.controls.order.controls.date.invalid&&(e.form.controls.order.controls.date.dirty||e.form.controls.order.controls.date.touched))),a(6),p("options",e.outlets()),a(8),p("ngClass",N(20,zi,e.form.controls.order.controls.number.invalid&&(e.form.controls.order.controls.number.dirty||e.form.controls.order.controls.number.touched))),a(7),se(e.contactType()),a(6),S(+e.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),a(),p("suggestions",e.customerSuggestions())("placeholder",+e.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),a(6),p("options",e.JournalExpenseRecord().options.paymentAccounts),a(13),p("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard),a(7),p("autoResize",!0)("ngClass",N(22,zi,e.form.controls.order.controls.note.invalid&&(e.form.controls.order.controls.note.dirty||e.form.controls.order.controls.note.touched))),a(4),p("scrollable",!0)("value",e.form.controls.items.controls)}}function Rl(t,l){if(t&1&&f(0,Ml,77,24,"div",14),t&2){let e=c();p("ngIf",e.JournalExpenseRecord())}}function Fl(t,l){if(t&1){let e=b();r(0,"p-button",65),y("click",function(){_(e);let i=c();return h(i.uploadDialogVisible.set(!1))}),o(),r(1,"p-button",66),y("click",function(){_(e);let i=c();return h(i.uploadDialogVisible.set(!1))}),o()}t&2&&p("text",!0)}var so=(()=>{class t{constructor(){this.fileAttachment=z(new File([],"")),this.activatedRoute=v(Te),this.virtualScrollOptions={scrollHeight:"240px",itemSize:40,autoSize:!0},this.journalEntryService=v(j),this.JournalExpenseRecord=z(null),this.customerSuggestions=z([]),this.itemsForm=z([]),this.subTotalDebit=q(()=>this.itemsForm().reduce((e,n)=>e+ +n.debitAmount,0)),this.subTotalCredit=q(()=>this.itemsForm().reduce((e,n)=>e+ +n.creditAmount,0)),this.contactType=z([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dayjsService=v(qe),this.dialogService=v(It),this.uploadDialogVisible=z(!1),this.router=v(ke),this.guidEmpty=P.toString(),this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200},this.outlets=q(()=>this.JournalExpenseRecord()?.options?.entities||[]),this.toasr=v(Me),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(mi,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalExpenseRecord()}onToggleUploadDialog(){this.uploadDialogVisible.update(e=>!e)}onUploadDialog(e){console.log(e),lo.default.parse(e.currentFiles[0],{complete:n=>{console.log("Parsed result:",n)},error:n=>{console.error("Parsing error:",n)}})}initializeForm(){this.form=new fe({order:new fe({id:new g("",[U.required]),number:new g("",[U.required]),date:new g({value:new Date,disabled:!0},[U.required]),note:new g(""),entryTypeID:new g(1,[U.required]),referenceID:new g(""),referenceTypeID:new g(0,[U.required]),referenceText:new g(""),contactID:new g(null),detailReferenceID:new g(""),creatorID:new g("",[U.required]),created:new g("",[U.required]),modifierID:new g(""),modified:new g(""),outletID:new g(null),statusID:new g(0),contactName:new g(""),contactType:new g(0),fileAttachment:new g(null)}),items:new jt([]),additionalAccountID:new g(""),file:new g(null),customerName:new g("")})}initializeFormEffect(){ot(()=>{let e=this.JournalExpenseRecord();e&&(this.form.patchValue({order:E(w({},e.form.order),{entryTypeID:Number(e.form.order.entryTypeID===0&&1),referenceID:String(e.form.order.referenceID||P),contactID:this.activatedRoute.snapshot.paramMap.get("id")?{Key:e.form.order.contactID,Value:e.form.customerName}:null,detailReferenceID:String(e.form.order.detailReferenceID||P),contactName:String(e.form.order.contactName),date:Ji.default.isDayjs(e.form.order.date)?e.form.order.date.toDate():(0,Ji.default)().toDate(),modifierID:String(e.form.order.modifierID||P),statusID:+e.form.order.statusID,modified:String(e.form.order.modified),outletID:e.form.order.outletID,fileAttachment:e.form.order.fileAttachment}),additionalAccountID:e.form.additionalAccountID===P?null:e.form.additionalAccountID}),this.updateFormItems(e.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(n=>{this.itemsForm.set(n)}))})}updateFormItems(e){let n=this.form.controls.items;n.clear(),e.forEach(i=>{n.push(new fe({id:new g(i.id),journalID:new g(i.journalID),accountID:new g(i.accountID),debitAmount:new g(i.debitAmount),creditAmount:new g(i.creditAmount),index:new g(i.index),note:new g(i.note)}))})}loadJournalExpenseRecord(){this.activatedRoute.data.pipe(ee(e=>e.form),D(e=>this.JournalExpenseRecord.set(e))).subscribe()}searchCustomer(e){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(e.query).pipe(D(n=>this.customerSuggestions.set(n))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(e.query).pipe(D(n=>this.customerSuggestions.set(n))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new fe({id:new g(P.toString()),journalID:new g(P.toString()),accountID:new g(P.toString()),debitAmount:new g(0),creditAmount:new g(0),index:new g(this.form.controls.items.length??0),note:new g("")})),setTimeout(()=>{let e=this.scrollPanelContainer.contentViewChild.nativeElement;console.log("Scroll container:",e.scrollHeight),e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},0)}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue();console.log("cleanedFormValue",e);let n=this.buildFormData(e);this.journalEntryService.submitJournalEntry(n).pipe(J("response"),D(()=>{this.form.controls.order.controls.date.disable(),this.router.navigate(["/pages/journal/journal-entry"])}),tt(i=>et(()=>i)),J("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),n=Object.entries(e).reduce((i,[s,u])=>(s==="items"?i[s]=u.map(x=>E(w({},x),{debitAmount:+x.debitAmount,creditAmount:+x.creditAmount})):s==="order"?i[s]=E(w({},u),{date:this.dayjsService.from(u.date)?this.dayjsService.format(u.date):null,contactID:u.contactID&&typeof u.contactID=="object"?u.contactID.Key:u.contactID||P}):i[s]=u,i),{});return JSON.parse(JSON.stringify(n,(i,s)=>s==="null"?null:s))}buildFormData(e){let n=new FormData;return n.append("Data",JSON.stringify(e)),n.append("File",this.fileAttachment()),n}onUpload(e){console.log(e),e instanceof File&&this.fileAttachment.set(e)}removeItems(e){this.form.controls.items.removeAt(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=R({type:t,selectors:[["app-journal-receive-money"]],viewQuery:function(n,i){if(n&1&&O(gl,5),n&2){let s;T(s=k())&&(i.scrollPanelContainer=s.first)}},features:[pe([It,Qt])],decls:10,vars:6,consts:[["actionButton",""],["content",""],["footer",""],["scrollPanelContainer",""],["item",""],["selectedItem",""],["header",""],["body",""],["pageTitle",`Receive Money
|
|
129
|
-
`,3,"hasMainWrapperPadding"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],[1,"d-flex","gap-2"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"col-3","d-flex","align-items-center"],["for","outlet",1,"m-0","fs-3","fw-normal"],["styleClass","w-100","size","small","formControlName","date",1,"col-6","p-0",3,"showIcon","ngClass"],["showClear","","filter","","filterBy","code,name","size","small","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"col-6","placeholder-spacing",3,"options"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",1,"col-6",3,"ngClass"],[1,"col-6","d-flex","gap-3","p-0"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["size","small","styleClass","w-100 ","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions","placeholder"],[1,"col-12","col-lg-12"],["showClear","","filter","","filterBy","code,name","size","small","formControlName","additionalAccountID","optionLabel","name","optionValue","id","placeholder","Select Payment",1,"col-6","placeholder-spacing",3,"options"],[1,"col"],[1,"col-3","d-flex"],[1,"col-9","pl-0"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],["rows","4","cols","30","pSize","small","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"autoResize","ngClass"],["formArrayName","items",1,"row"],[1,"col","mb-5"],["showGridlines","",3,"scrollable","value"],[1,"flex","items-center","gap-2",2,"height","38x"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"mb-0","d-flex","align-items-center","radiobutton-label"],[1,""],[1,"h-full","align-middle"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],[1,"d-inline-block","text-truncate",2,"max-width","200px"],[2,"width","30%","min-width","120px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","3%","min-width","30px"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100",3,"options","showClear"],["pSize","small","rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],[1,"d-flex","justify-content-end"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],["tooltipPosition","top",1,"m-0",3,"pTooltip"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"d-flex","justify-content-between","align-items-center"],["severity","secondary","outlined","","icon","fa-light fa-plus","size","small","label","Add new row",3,"onClick"],[1,"text-end"],[2,"vertical-align","middle"],[1,"text-end","footer-total"],["colspan",""],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(n,i){if(n&1){let s=b();r(0,"app-main-panel",8),f(1,Cl,4,2,"ng-template",null,0,C)(3,Rl,1,1,"ng-template",null,1,C),o(),r(5,"p-dialog",9)(6,"p-fileupload",10),y("onSelect",function(x){return _(s),h(i.onUploadDialog(x))}),o(),f(7,Fl,2,1,"ng-template",null,2,C),o(),d(9,"p-toast")}n&2&&(p("hasMainWrapperPadding",!0),a(5),H(M(5,_l)),p("modal",!0)("visible",i.uploadDialogVisible()))},dependencies:[ze,Re,Fe,Ve,Pe,Ae,lt,st,ne,X,De,te,ce,Qe,He,ue,de,Ue,$e,he,_e,bt,Ct,_t,gt,be,Ce,ye,ie,ve,Wt,Zt,xe,Ge,li,ht,Xt,ut,dt,vt,ei,Le,Ne,pt,mt,yt,ft,Be,je],styles:[".footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:16px}.radiobutton-label[_ngcontent-%COMP%]{font-weight:300}.placeholder-spacing[_ngcontent-%COMP%] .p-select-label{padding-left:0!important}[_nghost-%COMP%] .p-datatable .p-select{border:none;box-shadow:none}[_nghost-%COMP%] .p-datatable .p-select .p-select-label{padding:0}[_nghost-%COMP%] .p-datatable .p-textarea{border:none;box-shadow:none;padding:0}[_nghost-%COMP%] .p-datatable .p-inputtext{border:none;box-shadow:none;padding-right:0}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:not(:last-child){border-top:1px solid var(--p-datatable-footer-cell-border-color)}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:last-child{border-top:none}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td{border-left:none;border-right:none;border-bottom:none}[_nghost-%COMP%] .p-datatable .p-datatable-thead>tr>th:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;background:transparent!important}[_nghost-%COMP%] .p-datatable .p-datatable-tbody>tr>td:last-child{border-left:1px solid var(--p-datatable-footer-cell-border-color);border-top:none;border-right:none;border-bottom:none;padding:0 .25rem!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot>tr>td:first-child{padding:0!important}[_nghost-%COMP%] .p-datatable .p-datatable-tfoot .p-button .p-button-label{font-size:12px!important}"],changeDetection:0})}}return t})();var mo=()=>{let t=v(j),l=v(xt);return l.show(),t.getJournalReceiveMoney().pipe(J("response"),D(()=>l.hide()))};var Bd=[{path:"",redirectTo:"journal-entry",pathMatch:"full"},{path:"journal-entry",children:[{path:"",component:Un},{path:"add",component:Vi,resolve:{form:Pi}},{path:"import",loadComponent:()=>import("./chunk-UWWFSGE7.js").then(t=>t.JournalEntryImportComponent)},{path:":id",component:ro},{path:":id/edit",component:Vi,resolve:{form:Pi}}]},{path:"record-expense",component:Wn,resolve:{form:ao}},{path:"receive-money",component:so,resolve:{form:mo}},{path:"journal-deposit",component:Zn}];export{Bd as JOURNAL_ROUTES};
|
package/chunk-R6NK3ROE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as E}from"./chunk-TDMJ2M6W.js";import{u as b,v as f,w as g}from"./chunk-DAQCANBV.js";import{I as a,Z as u,ba as l,ha as c,n as m,r as n,s as p}from"./chunk-WCXWWANV.js";import{a as h,b as d}from"./chunk-YQFG5XE2.js";var w=(()=>{class i{constructor(){this.httpClient=c(g),this.toastr=c(E),this.requestTimeout=3e4}get(e="",t,r={}){return this.httpClient.get(`${e}${t}`,r).pipe(n(this.requestTimeout),a(this.handleError.bind(this)))}post(e="",t,r,o={observe:"response"}){return this.httpClient.post(`${e}${t}`,r,h({},o)).pipe(n(this.requestTimeout),u(this.handleResponse.bind(this)),p(s=>s instanceof b&&Object.prototype.hasOwnProperty.call(o,"observe")&&o.observe==="response"?s.body instanceof Blob?s:s.body:s),a(this.handleError.bind(this)))}put(e="",t,r,o={}){return this.httpClient.put(`${e}${t}`,r,d(h({},o),{observe:"response"})).pipe(n(this.requestTimeout),u(this.handleResponse.bind(this)),p(s=>s.body),a(this.handleError.bind(this)))}delete(e="",t,r={}){return this.httpClient.delete(`${e}${t}`,d(h({},r),{observe:"response"})).pipe(n(this.requestTimeout),u(this.handleResponse.bind(this)),p(o=>o.body),a(this.handleError.bind(this)))}handleResponse(e){if(e.status===200&&e.body){let t=e.body.message;t&&this.toastr.success(t,"Success")}}handleError(e){let t={header:"API Error",message:"An unknown error occurred"};if(e instanceof f)switch(e.status){case 0:t.message="CORS error: Request blocked or server not responding with proper CORS headers",t.header="CORS Error";break;case 504:t.message=e.statusText||"Gateway Timeout",t.header=`API Error: ${e.status}`;break;default:t.header=`API Error: ${e.status}`,t.message=e.error&&(e.error.Message||e.error.message||e.error.error)||e.message}return this.toastr.error(t.message,t.header),m(()=>t)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{w as a};
|