dealposbooks 5.36.2 → 5.36.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/{chunk-O75U5E6H.js → chunk-2G2XJK2K.js} +1 -1
  2. package/{chunk-O3JBRZF4.js → chunk-2JQ3JEJ3.js} +1 -1
  3. package/{chunk-FE4Q3L6W.js → chunk-2RWNWJIJ.js} +1 -1
  4. package/{chunk-WKBCELT6.js → chunk-3ZX2C4CS.js} +2 -2
  5. package/{chunk-3PPJHQQ4.js → chunk-4Q3RSJHE.js} +1 -1
  6. package/{chunk-4OMJSWGH.js → chunk-4ZZS7RNX.js} +1 -1
  7. package/{chunk-WW5ELKKO.js → chunk-5YNFFJYR.js} +1 -1
  8. package/{chunk-MQPAWXQR.js → chunk-7BTYXICA.js} +1 -1
  9. package/{chunk-TB6LDOLG.js → chunk-7DMSRUGW.js} +1 -1
  10. package/{chunk-JTK43IPK.js → chunk-AL2ZC3FX.js} +1 -1
  11. package/{chunk-EM3AQZPZ.js → chunk-AXKMFP7U.js} +1 -1
  12. package/{chunk-6DH5EZBL.js → chunk-BQU2QE7O.js} +4 -4
  13. package/{chunk-GCTX4M5B.js → chunk-C3WPT3H7.js} +1 -1
  14. package/chunk-CPGDR2QI.js +1 -0
  15. package/{chunk-FETWPNGI.js → chunk-DBY5EYPK.js} +1 -1
  16. package/{chunk-EBEP5ZNI.js → chunk-E3LLXUXO.js} +1 -1
  17. package/chunk-EATLNF4I.js +1 -0
  18. package/{chunk-YJ2QEIBF.js → chunk-ECIZYNA4.js} +1 -1
  19. package/{chunk-5U2DQZ3P.js → chunk-EJ3E4VHA.js} +1 -1
  20. package/{chunk-6SQ75ZSO.js → chunk-FAKMCF4Y.js} +1 -1
  21. package/chunk-GPH5BEIK.js +1 -0
  22. package/{chunk-7SXGBB2J.js → chunk-I3NMOMCW.js} +1 -1
  23. package/{chunk-UDNPUUWO.js → chunk-K27Y4V4L.js} +1 -1
  24. package/{chunk-X5PP77DR.js → chunk-KFKB4A5O.js} +1 -1
  25. package/{chunk-GTVRKYLY.js → chunk-KRKMQYJ2.js} +1 -1
  26. package/{chunk-EA47GVMD.js → chunk-KTL3KEN6.js} +1 -1
  27. package/{chunk-EVRPQUZB.js → chunk-KUXDU3TW.js} +1 -1
  28. package/chunk-LJ3UX4FK.js +7 -0
  29. package/chunk-LKKQVF4C.js +1 -0
  30. package/{chunk-LZSGMIGM.js → chunk-OJPJVKM5.js} +1 -1
  31. package/{chunk-VKYNOYJC.js → chunk-OL75RFEO.js} +1 -1
  32. package/{chunk-XZQ3IYQ6.js → chunk-OVHBR6ZK.js} +1 -1
  33. package/chunk-PQJXIO2P.js +1 -0
  34. package/{chunk-5L5UVIIK.js → chunk-PWQCJZ4S.js} +1 -1
  35. package/{chunk-YARD4P64.js → chunk-QOCCHVWD.js} +1 -1
  36. package/{chunk-62S2RZ5N.js → chunk-R3VGWSRA.js} +5 -5
  37. package/{chunk-4AOHMAEQ.js → chunk-SJ2FUSMD.js} +1 -1
  38. package/chunk-SJCVDRU7.js +1 -0
  39. package/{chunk-GI2IGVR7.js → chunk-TJE77JOF.js} +1 -1
  40. package/{chunk-NSHK5C75.js → chunk-TLWO5UJD.js} +1 -1
  41. package/{chunk-6Y7LC5K4.js → chunk-UFRSHXNU.js} +1 -1
  42. package/{chunk-IQQJUFFQ.js → chunk-UM4NAL5M.js} +1 -1
  43. package/chunk-VDZ673ZY.js +1 -0
  44. package/{chunk-JOLNIJ36.js → chunk-WODWFYV4.js} +1 -1
  45. package/{chunk-ASZXOTXP.js → chunk-X74L3UX6.js} +1 -1
  46. package/{chunk-7K7AJJBA.js → chunk-ZDXP6UW4.js} +1 -1
  47. package/{chunk-SNKHWMQW.js → chunk-ZJ7X5V7U.js} +1 -1
  48. package/{chunk-SSZSLP4Z.js → chunk-ZVIU7CUD.js} +1 -1
  49. package/index.html +2 -2
  50. package/{main-RSQGAYLC.js → main-B7PE3RXN.js} +1 -1
  51. package/package.json +1 -1
  52. package/chunk-4BKREZBV.js +0 -1
  53. package/chunk-4O47GML2.js +0 -1
  54. package/chunk-6XZEYZFV.js +0 -1
  55. package/chunk-AYDYX3J4.js +0 -7
  56. package/chunk-LSY7PUC7.js +0 -1
  57. package/chunk-N5RPPHA6.js +0 -1
  58. package/chunk-XGCWDZO7.js +0 -1
  59. package/chunk-XO27WEAF.js +0 -1
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"dealposbooks","version":"5.36.2"}
1
+ {"name":"dealposbooks","version":"5.36.4"}
package/chunk-4BKREZBV.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-YQFG5XE2.js";var t=[{path:"",redirectTo:"tax-account",pathMatch:"full"},{path:"tax-account",loadComponent:()=>import("./chunk-EVRPQUZB.js").then(o=>o.TaxAccountComponent)},{path:"chart-of-account",loadComponent:()=>import("./chunk-TB6LDOLG.js").then(o=>o.ChartOfAccountComponent)},{path:"manual-journal",loadComponent:()=>import("./chunk-UDNPUUWO.js").then(o=>o.ManualJournalComponent)},{path:"payment-account",loadComponent:()=>import("./chunk-O75U5E6H.js").then(o=>o.PaymentAccountComponent)},{path:"writeoff-outlet",loadComponent:()=>import("./chunk-GCTX4M5B.js").then(o=>o.WriteOffOutletComponent)},{path:"expense-account",loadComponent:()=>import("./chunk-6SQ75ZSO.js").then(o=>o.ExpenseAccountComponent)},{path:"coa-configuration",loadComponent:()=>import("./chunk-5L5UVIIK.js").then(o=>o.CoaConfigurationComponent)},{path:"coa-category",loadComponent:()=>import("./chunk-GTVRKYLY.js").then(o=>o.CoaCategoryComponent)},{path:"outlet-account",loadComponent:()=>import("./chunk-5U2DQZ3P.js").then(o=>o.OutletAccountComponent)}];export{t as MIGRATE_ROUTES};
package/chunk-4O47GML2.js DELETED
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-JOLNIJ36.js";import{a as ot}from"./chunk-G4XX7EU2.js";import{a as He,b as Le}from"./chunk-AACWH3EJ.js";import{a as je}from"./chunk-YPBGL37O.js";import{b as N}from"./chunk-SNKHWMQW.js";import{a as ie}from"./chunk-WW5ELKKO.js";import{a as Ae,b as Me}from"./chunk-FLZXCWDU.js";import{a as Pe}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import"./chunk-C2GO6SPF.js";import{a as j,b as z}from"./chunk-O4QM64EH.js";import{d as Re,i as ke,j as Ne,k as Je}from"./chunk-SVXDMOLP.js";import{a as Te,b as Fe}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Be}from"./chunk-XKCLERWG.js";import"./chunk-GDX5XEV3.js";import{a as Ve,b as De}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{g as Ie,h as Ee}from"./chunk-XZQ3IYQ6.js";import{b as ye,c as we}from"./chunk-X22YKT5B.js";import{a as ge,b as he}from"./chunk-JYCUE5HV.js";import{a as y,b as Se,c as Ce,d as xe,e as be,f as ve,g as nt}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as ue,o as de,w as fe,x as _e}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as ne,c as oe,e as re,f as le,k as ae,l as pe,o as me,u as se,x as ce}from"./chunk-G5S5AZA7.js";import"./chunk-Z45NTTES.js";import"./chunk-4AOHMAEQ.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as Q,j as X,k as Y,n as it,p as Z,q as ee,r as te}from"./chunk-OKCHQM5Q.js";import{Ab as H,Ac as F,Cb as g,Ga as R,Jc as w,Kb as s,Kc as P,Lc as V,Mc as b,Ub as l,Vb as o,Wb as C,X as B,Yc as I,Z as G,_b as E,c as J,cb as U,dc as T,ec as _,gb as a,ha as v,pa as h,qa as S,qc as m,rc as x,s as O,sc as k,ta as tt,uc as L,vc as W,wb as A,wc as M,xc as K,yc as q,zc as $}from"./chunk-JP6RBSB3.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var St={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},$e=Se(ve(St),Ce(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>u(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!0}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(d=>d.id===n.id?u(c({},d),{checked:!1}):d);return u(c({},i),{data:u(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(d=>u(c({},d),{checked:n}));return u(c({},i),{data:u(c({},i.data),{data:f})})})},getCustomerInvoice:j(J(O(n=>Object.entries(n).reduce((i,[f,d])=>(d!=null&&(i[f]=d),i),{})),B(n=>p.getJournalInvoice(n).pipe(O(i=>u(c({},i),{data:i.data.map(f=>u(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Be("getCustomerInvoice"),z({next:i=>{y(t,f=>u(c({},f),{data:u(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:j(J(B(()=>p.getJournalInvoiceLoader().pipe(z({next:n=>{y(t,i=>u(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),xe(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var Qe=t=>({"ng-invalid ng-dirty":t}),bt=()=>({});function vt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function yt(t,p){if(t&1&&g(0,vt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function wt(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Customer"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function It(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td")(9,"a",20),m(10),o()(),l(11,"td"),m(12),w(13,"date"),o(),l(14,"td"),m(15),w(16,"date"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),C(21,"p-chip",21),o(),l(22,"td"),C(23,"p-chip",21),o(),l(24,"td"),C(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),x(V(13,14,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),x(P(19,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Et(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Tt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Ft(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,wt,20,0,"ng-template",null,3,b)(4,It,26,22,"ng-template",null,4,b)(6,Et,1,3,"ng-template",null,5,b)(8,Tt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Vt(t,p){if(t&1&&(l(0,"span",36),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Dt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Rt(t,p){if(t&1&&(l(0,"div"),g(1,Dt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Nt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Jt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Bt(t,p){if(t&1&&(l(0,"div"),g(1,Jt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Mt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Vt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),C(19,"p-datepicker",31),g(20,Rt,2,1,"div",32),C(21,"p-datepicker",33),g(22,Nt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Customer"),o(),l(26,"p-autocomplete",34),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchContact(n))}),o()(),l(27,"div",25)(28,"label",26),m(29,"Page Size"),o(),C(30,"input",35),g(31,Bt,2,1,"div",32),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(5),s("iconDisplay","input")("showIcon",!0)("ngClass",F(17,Qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",F(21,Qe,e.isInvalid("pageSize")))("autoNumeric",$(23,bt)),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Pe{constructor(){super(...arguments),this.store=v($e),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(ie),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.customerSuggestions=R([]),this.fb=v(se)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:d,customerID:ze,pageNumber:Oe,rowCount:Ge,pageSize:Ue,export:We,exportPageNumber:Ke,exportRowCount:qe}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(d)?this.dayjsService.from(d).toDate():null),customerID:this.fb.control(ze),pageNumber:this.fb.control(Oe),rowCount:this.fb.control(Ge),pageSize:this.fb.control(Ue,[oe.required]),export:this.fb.control(We),exportPageNumber:this.fb.control(Ke),exportRowCount:this.fb.control(qe)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Be("Customer Suggestions"),G(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(G(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=ot);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=tt(t)))(n||t)}})()}static{this.\u0275cmp=A({type:t,selectors:[["app-customer-invoice"]],features:[q([$e]),H],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","lazy","paginator","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"ngClass","autoNumeric"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,yt,1,1,"ng-template",null,0,b)(3,Ft,10,5,"ng-template",null,1,b)(5,Mt,32,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Je,Re,ke,Ne,te,Q,X,Y,ee,Z,Me,Ae,he,ge,_e,fe,De,Ve,Fe,Te,de,ue,Le,He,ce,ae,ne,re,le,pe,me,we,ye,Ie,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Pt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4},skipRequestFirst:!0},Xe=Se(nt("JournalSupplierBillStore"),ve(Pt),Ce(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>u(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!0}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?u(c({},f),{checked:!1}):f);return u(c({},n),{data:u(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>u(c({},f),{checked:r}));return u(c({},n),{data:u(c({},n.data),{data:i})})})},getGJSupplierBillLoader:j(J(B(()=>p.getGJSupplierBillLoader().pipe(z({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>u(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:j(J(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(O(n=>u(c({},n),{data:n.data.map(i=>u(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),z({next:n=>{y(t,i=>u(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),xe(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Ye=t=>({"ng-invalid ng-dirty":t}),jt=()=>({});function zt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function Ot(t,p){if(t&1&&g(0,zt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Gt(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Outlet"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),C(19,"th",18),o())}function Ut(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),C(20,"p-chip",21),o(),l(21,"td"),C(22,"p-chip",21),o(),l(23,"td"),C(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),x(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(e.customer),a(2),x(V(12,13,e.date,"d MMM y hh:mm")),a(3),x(e.due?V(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),x(P(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function At(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ht(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Lt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,Gt,20,0,"ng-template",null,3,b)(4,Ut,25,21,"ng-template",null,4,b)(6,At,1,3,"ng-template",null,5,b)(8,Ht,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function Wt(t,p){if(t&1&&(l(0,"span",36),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function Kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function qt(t,p){if(t&1&&(l(0,"div"),g(1,Kt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function $t(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Qt(t,p){if(t&1&&(l(0,"div"),g(1,$t,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Xt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function Yt(t,p){if(t&1&&(l(0,"div"),g(1,Xt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Zt(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Outlet"),o(),l(4,"p-select",27),g(5,Wt,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),C(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),C(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),C(19,"p-datepicker",31),g(20,qt,2,1,"div",32),C(21,"p-datepicker",33),g(22,Qt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Supplier"),o(),l(26,"p-autocomplete",34),w(27,"async"),T("completeMethod",function(n){h(e);let i=_();return S(i.onSearchSupplier(n))}),o()(),l(28,"div",25)(29,"label",26),m(30,"Page Size"),o(),C(31,"input",35),g(32,Yt,2,1,"div",32),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(5),s("iconDisplay","input")("showIcon",!0)("ngClass",F(19,Ye,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(21,Ye,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",P(27,17,e.supplierSuggestions$)),a(5),s("autoNumeric",$(23,jt))("ngClass",F(24,Ye,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var gt=(()=>{class t extends Pe{constructor(){super(),this.generateJournalService=v(D),this.store=v(Xe),this.authService=v(ie),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(se),this.dayjsService=v(N)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Be("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:d,supplierID:ze,pageNumber:Oe,rowCount:Ge,pageSize:Ue,export:We,exportPageNumber:Ke,exportRowCount:qe}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(d),supplierID:this.fb.control(ze),pageNumber:this.fb.control(Oe),rowCount:this.fb.control(Ge),pageSize:this.fb.control(Ue,[oe.required]),export:this.fb.control(We),exportPageNumber:this.fb.control(Ke),exportRowCount:this.fb.control(qe)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(G(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([Xe]),H],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,Ot,1,1,"ng-template",null,0,b)(3,Lt,10,5,"ng-template",null,1,b)(5,Zt,33,26,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Je,Re,ke,Ne,te,Q,X,Y,it,ee,Z,Me,Ae,he,ge,_e,fe,De,Ve,Fe,Te,Le,He,ce,ae,ne,re,le,pe,me,de,ue,Ie,we,ye,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ei={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Ze=Se(ve(ei),Ce(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),be(t=>{let p=v(D);return{updateFilter(e){y(t,r=>u(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!0}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?u(c({},i),{checked:!1}):i);return u(c({},r),{data:u(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>u(c({},i),{checked:e}));return u(c({},r),{data:u(c({},r.data),{data:n})})})},getGJShiftLoader:j(J(B(()=>p.getGJShiftLoader().pipe(z(e=>y(t,r=>u(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:j(J(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(z(r=>y(t,n=>u(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),xe(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var et=t=>({"ng-invalid ng-dirty":t}),ti=()=>({});function ii(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){h(e);let n=_(2);return S(n.onGenerateJournal())}),o()}}function ni(t,p){if(t&1&&g(0,ii,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function oi(t,p){t&1&&(l(0,"tr")(1,"th",12),C(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Outlet"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),C(21,"th",18),o())}function ri(t,p){if(t&1&&(l(0,"tr")(1,"td"),C(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),C(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),x(V(8,14,e.open,"dd MMM y hh:mm")),a(3),x(V(11,17,e.close,"dd MMM y hh:mm")),a(3),x(e.cashier),a(2),x(P(16,20,e.salesNTax)),a(3),x(P(19,22,e.totalInvoice)),a(3),x(e.outlet),a(2),x(e.register),a(2),x(P(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function li(t,p){if(t&1&&m(0),t&2){let e=_(2);L(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ai(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function pi(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){h(e);let i=_();return S(i.onPageChange(n))})("onRowSelect",function(n){h(e);let i=_();return S(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return S(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return S(i.onHeaderCheckboxToggle(n))}),g(2,oi,22,0,"ng-template",null,3,b)(4,ri,29,26,"ng-template",null,4,b)(6,li,1,3,"ng-template",null,5,b)(8,ai,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function mi(t,p){if(t&1&&(l(0,"span",32),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",V(2,2,e.name,30)," ")}}function si(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function ci(t,p){if(t&1&&(l(0,"div"),g(1,si,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function ui(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function di(t,p){if(t&1&&(l(0,"div"),g(1,ui,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function fi(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),x(e)}}function _i(t,p){if(t&1&&(l(0,"div"),g(1,fi,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function gi(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Outlet"),o(),l(4,"p-select",26),g(5,mi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),C(11,"p-datepicker",28),g(12,ci,2,1,"div",29),C(13,"p-datepicker",30),g(14,di,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),C(18,"input",31),g(19,_i,2,1,"div",29),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(7),s("iconDisplay","input")("showIcon",!0)("ngClass",F(14,et,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",F(16,et,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("autoNumeric",$(18,ti))("ngClass",F(19,et,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ht=(()=>{class t extends Pe{constructor(){super(),this.generateJournalService=v(D),this.store=v(Ze),this.authService=v(ie),this.isDialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.fb=v(se),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,rowCount:d,pageSize:ze,export:Oe,exportPageNumber:Ge,exportRowCount:Ue}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),rowCount:this.fb.control(d),pageSize:this.fb.control(ze,[oe.required]),export:this.fb.control(Oe),exportPageNumber:this.fb.control(Ge),exportRowCount:this.fb.control(Ue)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(G(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(u(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(u(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-journal-shift"]],features:[q([Ze]),H],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(d){return h(i),M(n.isDialogFilterVisible,d)||(n.isDialogFilterVisible=d),S(d)})("isInitDialogFilterVisibleChange",function(d){return h(i),M(n.isInitDialogFilterVisible,d)||(n.isInitDialogFilterVisible=d),S(d)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(d){return h(i),S(n.onSearch(d))}),g(1,ni,1,1,"ng-template",null,0,b)(3,pi,10,5,"ng-template",null,1,b)(5,gi,20,21,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ee,Je,Re,ke,Ne,te,Q,X,Y,ee,Z,Me,he,ge,_e,fe,ce,ae,ne,re,le,pe,me,De,Ve,Fe,Te,Ie,we,ye,de,ue,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Co=[{path:"invoice",component:_t},{path:"supplier-bill",component:gt},{path:"shift",component:ht},{path:"join-invoice",loadComponent:()=>import("./chunk-XO27WEAF.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-6XZEYZFV.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-LSY7PUC7.js").then(t=>t.AdjustmentJournalComponent)}];export{Co as generateJournalRoutes};
package/chunk-6XZEYZFV.js DELETED
@@ -1 +0,0 @@
1
- import{a as F}from"./chunk-JOLNIJ36.js";import{a as Be,b as Oe}from"./chunk-AACWH3EJ.js";import{a as je}from"./chunk-YPBGL37O.js";import{b as D}from"./chunk-SNKHWMQW.js";import{a as re}from"./chunk-WW5ELKKO.js";import"./chunk-FLZXCWDU.js";import{a as ze}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import"./chunk-C2GO6SPF.js";import{a as z,b as j}from"./chunk-O4QM64EH.js";import{d as Ne,i as ke,j as Pe,k as Me}from"./chunk-SVXDMOLP.js";import{a as De,b as Fe}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import"./chunk-GDX5XEV3.js";import{a as Je,b as Re}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{g as Ve,h as Ae}from"./chunk-XZQ3IYQ6.js";import{b as Te,c as Ee}from"./chunk-X22YKT5B.js";import{a as Ce,b as Se}from"./chunk-JYCUE5HV.js";import{a as v,b as be,c as we,d as ve,e as ye,f as Ie}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as ae,c as le,e as pe,f as me,k as se,l as ce,o as ue,u as de,x as fe}from"./chunk-G5S5AZA7.js";import"./chunk-Z45NTTES.js";import"./chunk-4AOHMAEQ.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as Z,j as ee,k as te,n as ie,p as ne,r as oe}from"./chunk-OKCHQM5Q.js";import{Ab as K,Ac as V,Cb as x,Ga as k,Jc as T,Kb as c,Kc as Y,Lc as A,Mc as w,Ub as r,Vb as o,Wb as S,X as N,Yc as E,Z as H,_b as y,bb as U,c as J,cb as L,dc as I,ec as _,gb as l,ha as C,pa as g,qa as h,qc as s,rc as b,s as R,sc as P,uc as W,vc as $,wb as G,wc as M,xc as q,yc as Q,zc as X}from"./chunk-JP6RBSB3.js";import{a as u,b as f}from"./chunk-YQFG5XE2.js";var $e={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}}},B=be(Ie($e),we(t=>({first:E(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:E(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:E(()=>t.data().data.some(a=>a.checked)),checkedAPCollection:E(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),ye(t=>{let a=C(F),e=C(D);return{updateFilter(n){v(t,i=>f(u({},i),{filter:u(u({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!0}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onRowUnselect(n){v(t,i=>{let d=i.data.data.map(m=>m.id===n.id?f(u({},m),{checked:!1}):m);return f(u({},i),{data:f(u({},i.data),{data:d})})})},onHeaderCheckboxToggle(n){v(t,i=>{let d=i.data.data.map(m=>f(u({},m),{checked:n}));return f(u({},i),{data:f(u({},i.data),{data:d})})})},getAPLoader:z(J(N(()=>a.getAPJournalLoader().pipe(j({next:n=>{v(t,i=>f(u({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:z(J(R(n=>Object.entries(n).reduce((i,[d,m])=>(m!=null&&(i[d]=m),i),{})),N(n=>a.getAPJournal(n).pipe(R(i=>f(u({},i),{data:i.data.map(d=>f(u({},d),{due:e.from(d.due)?e.from(d.due).format():null,checked:!1}))})),j({next:i=>{v(t,d=>f(u({},d),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t}),qe=()=>({});function Qe(t,a){if(t&1){let e=y();r(0,"p-button",10),I("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function Xe(t,a){if(t&1&&x(0,Qe,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Ye(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function Ze(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),T(12,"date"),o(),r(13,"td"),s(14),T(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,L),l(),P(" ",e.number," "),l(2),b(e.customer),l(2),b(A(12,12,e.date,"d MMM y")),l(3),b(e.due?A(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,U),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function et(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function tt(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function it(t,a){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",11),I("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,Ye,18,0,"ng-template",null,3,w)(4,Ze,22,18,"ng-template",null,4,w)(6,et,1,3,"ng-template",null,5,w)(8,tt,4,0,"ng-template",null,6,w),o()()}if(t&2){let e=_();l(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function nt(t,a){if(t&1&&(r(0,"span",34),s(1),T(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),P(" ",A(2,2,e.name,30)," ")}}function ot(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function rt(t,a){if(t&1&&(r(0,"div"),x(1,ot,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function at(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function lt(t,a){if(t&1&&(r(0,"div"),x(1,at,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function pt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function mt(t,a){if(t&1&&(r(0,"div"),x(1,pt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function st(t,a){if(t&1){let e=y();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),x(5,nt,3,5,"ng-template",null,7,w),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),S(11,"p-datepicker",29),x(12,rt,2,1,"div",30),S(13,"p-datepicker",31),x(14,lt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Supplier"),o(),r(18,"p-autocomplete",32),T(19,"async"),I("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),S(23,"input",33),x(24,mt,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(7),c("iconDisplay","input")("showIcon",!0)("ngClass",V(17,O,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(19,O,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",Y(19,15,e.supplierSuggestions$)),l(5),c("autoNumeric",X(21,qe))("ngClass",V(22,O,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var Zt=(()=>{class t extends ze{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(re),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(de),this.dayjsService=C(D)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:d,supplierID:m,pageNumber:He,rowCount:Ue,pageSize:Le,export:Ge,exportPageNumber:Ke,exportRowCount:We}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(d),supplierID:this.fb.control(m),pageNumber:this.fb.control(He),rowCount:this.fb.control(Ue),pageSize:this.fb.control(Le,[le.required]),export:this.fb.control(Ge),exportPageNumber:this.fb.control(Ke),exportRowCount:this.fb.control(We)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(u({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(u({},this.store.filter()),{pageNumber:p+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(H(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ap-journal"]],features:[Q([B]),K],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AP Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=y();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),I("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,Xe,1,1,"ng-template",null,0,w)(3,it,10,5,"ng-template",null,1,w)(5,st,25,24,"ng-template",null,2,w),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ae,Me,Ne,ke,Pe,oe,Z,ee,te,ie,ne,xe,he,Se,Ce,fe,se,ae,pe,me,ce,ue,Re,Je,Fe,De,ge,_e,Oe,Be,Ee,Te,Ve,je],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Zt as ApJournalComponent};
package/chunk-AYDYX3J4.js DELETED
@@ -1,7 +0,0 @@
1
- import{a as kt}from"./chunk-SMZ363LC.js";import{a as Ee,b as Ie}from"./chunk-AACWH3EJ.js";import{a as Lt,b as se}from"./chunk-SNKHWMQW.js";import{a as he}from"./chunk-WW5ELKKO.js";import{b as Mt,c as nt,d as ot}from"./chunk-5XDCBC5Q.js";import{a as pe,b as me}from"./chunk-YYVQS5LF.js";import"./chunk-FLZXCWDU.js";import{b as it}from"./chunk-Q23KXB3T.js";import"./chunk-DHW7UHFT.js";import{a as te}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as Se,b as ve}from"./chunk-O4QM64EH.js";import{a as Ze,b as et,d as ae,k as le}from"./chunk-SVXDMOLP.js";import{a as oe,b as re}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as tt}from"./chunk-6Y7LC5K4.js";import{a as Fe}from"./chunk-XKCLERWG.js";import{b as Ce}from"./chunk-H57SDRPH.js";import"./chunk-GDX5XEV3.js";import{a as Vt,b as ye}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import{d as He}from"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as ne}from"./chunk-4CDAAU6Z.js";import{e as Je,f as Qe,h as ie}from"./chunk-XZQ3IYQ6.js";import"./chunk-X22YKT5B.js";import{a as Ue,b as ee}from"./chunk-JYCUE5HV.js";import{a as P,b as We,c as Ke,d as Ye,e as $e,f as Xe}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as ze,o as qe,w as Q,x as Z}from"./chunk-5FSMHZSY.js";import{b as be}from"./chunk-A5HAJEPC.js";import{b as je,e as W,f as K,g as Ft,i as rt,k as Y,l as $,o as X,u as xe,x as J}from"./chunk-G5S5AZA7.js";import{b as Pe,e as H,l as U}from"./chunk-Z45NTTES.js";import{a as Dt}from"./chunk-4AOHMAEQ.js";import{a as Oe}from"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as Ae,k as j,p as Ge,q as z,r as q,x as Rt,y as Tt}from"./chunk-OKCHQM5Q.js";import{Ac as F,Bc as wt,Cb as b,D as Me,Ga as E,Jc as S,Kb as s,Kc as v,Lc as Be,Mc as d,Nb as Le,Pb as L,Qb as we,Sb as Re,Tb as Te,Ub as o,V as yt,Vb as r,W as Et,Wb as w,X as _e,Yc as T,Z as M,Zc as ge,_b as R,ba as It,bb as O,c as ue,cb as fe,dc as I,ec as c,gb as l,ha as C,hc as ke,pa as h,qa as x,qc as a,rc as f,s as Ve,sc as D,tc as De,vc as B,wb as k,wc as N,xc as G,yc as Ne,zc as V}from"./chunk-JP6RBSB3.js";import{a as g,b as y,c as de,e as vt}from"./chunk-YQFG5XE2.js";var A=(()=>{class t{constructor(){this.httpService=C(Dt),this.authService=C(he)}fetchGeneralLedgerLoader(e="single"){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`)}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetSingleCount",e)}fetchGeneralLedgerReport(e,i="single"){return this.httpService.post(void 0,`api/GeneralLedger/${i==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,i={}){let n=g({responseType:"blob"},i);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,n)}getCustomerSuggestions(e){let i={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:i})}getSupplierSuggestions(e){let i={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:i})}getCashierSuggestions(e){let i={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:i})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,i={}){let n=new Tt({fromObject:Object.fromEntries(Object.entries(e).map(([_,Ut])=>[_,String(Ut)]))}),p=new Rt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=g({params:n,headers:p},i);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,i={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=It({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=()=>({width:"30vw"}),Xt=()=>({"1199px":"75vw","575px":"90vw"}),Jt=t=>["/pages/journal/journal-entry/",t],Qt=t=>({"ng-dirty ng-invalid":t});function Zt(t,m){if(t&1){let e=R();o(0,"p-button",17),I("onClick",function(){h(e);let n=c(2);return x(n.onToggleExportDialog())}),r()}}function ei(t,m){if(t&1&&(o(0,"div",14)(1,"a",15),a(2,"Return to Accounts"),r(),b(3,Zt,1,0,"p-button",16),r()),t&2){let e=c();l(3),s("ngIf",e.roleService.global.export)}}function ti(t,m){if(t&1&&(o(0,"div",14)(1,"span",24)(2,"h2",25),a(3),r()(),o(4,"span",24)(5,"h2",25),a(6),r()()()),t&2){let e=c(3);l(3),f(e.items().data.name),l(3),D(" (",e.items().data.chartOfAccountCode,") ")}}function ii(t,m){t&1&&(o(0,"tr")(1,"th",26),a(2,"Outlet"),r(),o(3,"th",26),a(4,"No."),r(),o(5,"th",26),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",27),a(10,"Debit"),r(),o(11,"th",28),a(12,"Credit"),r(),o(13,"th",28),a(14,"Balance"),r()())}function ni(t,m){if(t&1&&(o(0,"div",31)(1,"a",32),a(2),r(),w(3,"div",34),o(4,"span",35),a(5),r()()),t&2){let e=c().$implicit,i=c(3);l(),s("href",i.authService.getTenantExternalURL()+i.buildReferenceUrl(e),fe),l(),f(e.referenceText),l(),s("innerHTML",e.journalNote,O),l(2),D("",e.note," ")}}function oi(t,m){if(t&1&&(o(0,"div",31),w(1,"span",34)(2,"div",34),o(3,"span",35),a(4),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.referenceText,O),l(),s("innerHTML",e.journalNote,O),l(2),D("",e.note," ")}}function ri(t,m){if(t&1&&(o(0,"tr")(1,"td",29),a(2),r(),o(3,"td",29)(4,"a",30),a(5),r()(),o(6,"td",29),a(7),S(8,"date"),r(),o(9,"td",29)(10,"div",31)(11,"a",32),a(12),r(),b(13,ni,6,4,"div",31)(14,oi,5,3,"div",31),r()(),o(15,"td",33),a(16),S(17,"number"),r(),o(18,"td",33),a(19),S(20,"number"),r(),o(21,"td",33),a(22),S(23,"number"),r()()),t&2){let e=m.$implicit,i=c(3);l(2),f(e.outletName),l(2),s("routerLink",F(19,Jt,e.id)),l(),f(e.number),l(2),f(Be(8,10,e.date,"dd MMM yyyy")),l(4),s("href",i.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,fe),l(),f(e.contactName),l(),L(i.buildReferenceUrl(e)?13:14),l(3),D(" ",v(17,13,e.debitAmount)," "),l(3),D(" ",v(20,15,e.creditAmount)," "),l(3),f(v(23,17,e.balance))}}function ai(t,m){if(t&1&&(o(0,"tr"),w(1,"td",36),o(2,"td",37),a(3,"Total"),r(),o(4,"td",37),a(5),S(6,"number"),r(),o(7,"td",37),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c(3);l(5),f(v(6,2,e.debitSubTotal())),l(3),D(" ",v(9,4,e.creditSubTotal())," ")}}function li(t,m){t&1&&(o(0,"tr")(1,"td",38)(2,"span"),a(3,"No records found."),r()()())}function pi(t,m){if(t&1){let e=R();o(0,"button",39),I("click",function(){h(e);let n=c(3);return x(n.getGLCount())})("keyup.enter",function(){h(e);let n=c(3);return x(n.getGLCount())}),r()}}function mi(t,m){if(t&1&&a(0),t&2){let e=c(3);D(" ",e.count()," ")}}function si(t,m){if(t&1){let e=R();o(0,"div",19)(1,"p-table",20),b(2,ti,7,2,"ng-template",null,5,d)(4,ii,15,0,"ng-template",null,6,d)(6,ri,24,21,"ng-template",null,7,d)(8,ai,11,6,"ng-template",null,4,d)(10,li,4,0,"ng-template",null,8,d),r(),o(12,"div",21)(13,"div"),a(14),b(15,pi,1,0,"button",22)(16,mi,1,1),a(17," entries "),r(),o(18,"div",14)(19,"p-button",23),I("onClick",function(){h(e);let n=c(2);return x(n.onNextPage())}),r()()()()}if(t&2){let e=c(2);l(),s("value",e.items().data.data),l(13),De(" Showing ",e.pagination().first," to ",e.pagination().end," of "),l(),L(e.totalRecords()===-1?15:16),l(4),s("disabled",!e.pagination().hasNext)}}function ci(t,m){if(t&1&&b(0,si,20,5,"div",18),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function di(t,m){if(t&1&&(o(0,"div",14)(1,"div",24)(2,"span",58),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",24)(8,"span",59),a(9),r()()()),t&2){let e=m.$implicit;l(3),D("(",e.code,")"),l(6),f(e.name)}}function ui(t,m){if(t&1&&(o(0,"div",14)(1,"div",24)(2,"span",58),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",24)(8,"span",59),a(9),r()()()),t&2){let e=m.$implicit;l(3),D("(",e.code,")"),l(6),f(e.name)}}function _i(t,m){t&1&&(o(0,"div",60),a(1," Account is required. "),r())}function fi(t,m){if(t&1&&(o(0,"div",61)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),f(e.value)}}function gi(t,m){if(t&1&&(o(0,"div",51)(1,"div",52),w(2,"p-radiobutton",62),o(3,"label",63),a(4),r()()()),t&2){let e=m.$implicit;l(2),s("value",e.key)("inputId",e.key),l(),ke("for",e.key),l(),f(e.value)}}function hi(t,m){if(t&1){let e=R();o(0,"div",31)(1,"label",42),a(2,"Customer"),r(),o(3,"p-autocomplete",64),I("completeMethod",function(n){h(e);let p=c(3);return x(p.searchCustomer(n))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function xi(t,m){if(t&1){let e=R();o(0,"div",31)(1,"label",42),a(2,"Supplier"),r(),o(3,"p-autocomplete",65),I("completeMethod",function(n){h(e);let p=c(3);return x(p.searchSupplier(n))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.supplierSuggestions())}}function bi(t,m){if(t&1){let e=R();o(0,"div",31)(1,"label",42),a(2,"Customer"),r(),o(3,"p-autocomplete",64),I("completeMethod",function(n){h(e);let p=c(3);return x(p.searchCustomer(n))}),r()()}if(t&2){let e=c(3);l(3),s("suggestions",e.customerSuggestions())}}function Ci(t,m){if(t&1){let e=R();o(0,"form",41)(1,"div",31)(2,"label",42),a(3,"Accounts"),r(),o(4,"p-select",43),I("onChange",function(n){h(e);let p=c(2);return x(p.onAccountChange(n))}),b(5,di,10,2,"ng-template",null,9,d)(7,ui,10,2,"ng-template",null,10,d),r(),b(9,_i,2,0,"div",44),r(),o(10,"div",31)(11,"label",42),a(12,"From"),r(),o(13,"div",45),w(14,"p-datepicker",46)(15,"p-datepicker",47),r()(),o(16,"div",31)(17,"label",42),a(18,"Outlets"),r(),o(19,"p-multiselect",48),b(20,fi,3,1,"ng-template",null,10,d),r()(),o(22,"div",31)(23,"label",49),a(24,"Contact Type"),r(),o(25,"div",50),Re(26,gi,5,4,"div",51,we),r()(),o(28,"div",31)(29,"label",49),a(30,"Sort order"),r(),o(31,"div",50)(32,"div",51)(33,"div",52),w(34,"p-radiobutton",53),o(35,"label",54),a(36,"Asc"),r()()(),o(37,"div",55)(38,"div",52),w(39,"p-radiobutton",56),o(40,"label",57),a(41,"Desc"),r()()()()(),b(42,hi,4,1,"div",31)(43,xi,4,1,"div",31)(44,bi,4,1,"div",31),r()}if(t&2){let e,i,n,p=c(2);s("formGroup",p.form),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.accounts)("ngClass",F(16,Qt,((e=p.form.get("accountID"))==null?null:e.invalid)&&(((e=p.form.get("accountID"))==null?null:e.touched)||((e=p.form.get("accountID"))==null?null:e.dirty)))),l(5),s("ngIf",((i=p.form.get("accountID"))==null?null:i.invalid)&&(((i=p.form.get("accountID"))==null?null:i.touched)||((i=p.form.get("accountID"))==null?null:i.dirty))),l(5),s("iconDisplay","input")("showIcon",!0),l(),s("iconDisplay","input")("showIcon",!0),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.outlets),l(7),Te(p.loaderMetadata().options.contactTypeOptions),l(8),s("value",!0),l(5),s("value",!1),l(3),L((n=p.form.controls.contactType.value)===1?42:n===2?43:44)}}function Si(t,m){if(t&1&&b(0,Ci,45,18,"form",40),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function vi(t,m){if(t&1&&(o(0,"div",66)(1,"div",67)(2,"div",68)(3,"div",50)(4,"div",69)(5,"label",49),a(6,"Page"),r()(),o(7,"div",69),w(8,"input",70),r()()()(),o(9,"div",71)(10,"div",52),w(11,"i",72),o(12,"span",73),a(13),S(14,"number"),S(15,"number"),r()()()()),t&2){let e=c();l(),s("formGroup",e.form),l(12),De("Exporting data from ",v(14,3,e.filter().exportPageNumber)," - ",v(15,5,e.filter().exportRowCount),"")}}function yi(t,m){if(t&1){let e=R();o(0,"p-button",74),I("onClick",function(){h(e);let n=c();return x(n.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Ei(t,m){if(t&1){let e=R();o(0,"p-button",75),I("click",function(){h(e);let n=c();return x(n.onToggleExportDialog())}),r(),o(1,"p-button",76),I("click",function(){h(e);let n=c();return x(n.onExport())}),r()}}var Bt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(M(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(A),this.route=C(Pe),this.roleService=C(te),this.authService=C(he),this.fb=C(xe),this.coaService=C(tt),this.toastr=C(Oe),this.dayjsService=C(se),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=T(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=T(()=>{let e=this.filter(),i=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,n=Math.min(e.pageNumber*e.pageSize,isFinite(i)?i:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?n:0,total:i,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(i)?e.pageNumber*e.pageSize<i:!0}}),this.loaderMetadata=be(this.reportService.fetchGeneralLedgerLoader(),{initialValue:null}),this.baseFilter=T(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=be(this.route.queryParamMap.pipe(Ve(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=T(()=>{let e=this.baseFilter(),i=this.queryFilter(),n=this.localFilter();return e?g(g(g({},e),i??{}),n):null}),this.creditSubTotal=T(()=>(this.items()?.data?.data??[]).reduce((i,n)=>i+(Number(n.creditAmount)||0),0)),this.debitSubTotal=T(()=>(this.items()?.data?.data??[]).reduce((i,n)=>i+(Number(n.debitAmount)||0),0)),this.hasNextPage=T(()=>{let e=this.filter();if(!e)return!1;let i=Math.ceil(e.rowCount/e.pageSize);return e.pageNumber<i}),this.initializeForm(),ge(()=>{let e=this.filter();e&&e.accountID&&(this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1}),this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.items.update(n=>e.pageNumber===1?i:y(g({},i),{data:y(g({},i.data),{data:[...n?.data.data??[],...i.data.data]})}))}))})}buildReferenceUrl(e){return kt(e)}ngOnInit(){this.route.queryParamMap.pipe(Me(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),rowCount:this.fb.control(0),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportRowCount:this.fb.control(0)})}findNodeByKey(e,i){for(let n of e){if(n.key===i)return n;if(n.children){let p=this.findNodeByKey(n.children,i);if(p)return p}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((i,[n,p])=>{switch(n){case"from":break;case"to":i[n]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(p)?i[n]=p.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):i[n]=[];break;case"listOutletID":case"listAccountID":i[n]=Array.isArray(p)?p:[];break;case"pageNumber":case"pageSize":case"rowCount":case"exportPageNumber":case"exportRowCount":i[n]=p!=null?Number(p):0;break;case"sortAscending":case"export":i[n]=!!p;break;case"contactType":i[n]=p!=null?Number(p):null;break;default:i[n]=p}return i},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(i=>this.customerSuggestions.set(i))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(i=>this.supplierSuggestions.set(i))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e)}buildFilterBody(){let p=this.form.getRawValue(),{from:e,to:i}=p,n=de(p,["from","to"]);return y(g({},this.filter()),{pageNumber:n.pageNumber,pageSize:n.pageSize,sortAscending:n.sortAscending,accountID:n.accountID,contactID:n.contactID?.length===0?null:n.contactID,listOutletID:n.listOutletID??[],listAccountID:n.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(i)?this.dayjsService.format(i):null,contactType:n.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(M(i=>this.handleExportResponse(i))).subscribe()}handleExportResponse(e){let i=e.headers,n=i.get("Content-Disposition")??i.get("content-disposition"),p="download.csv";if(n){let _=n.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);_?.[1]&&(p=decodeURIComponent(_[1].replace(/"/g,"")))}let u=e.body;ot(u,p,u.type)}buildExportBody(){let p=this.form.value,{from:e,to:i}=p,n=de(p,["from","to"]);return y(g({},this.filter()),{exportPageNumber:+n.exportPageNumber,pageNumber:n.pageNumber,pageSize:n.pageSize,sortAscending:n.sortAscending,accountID:n.accountID,contactID:n.contactID?.length===0?null:n.contactID,listOutletID:n.listOutletID??[],listAccountID:n.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(i)?this.dayjsService.format(i):null,contactType:n.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let i=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:i+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0})})}onPrevPage(){this.localFilter.update(e=>{let i=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:Math.max(1,i-1)})})}goToPage(e){this.localFilter.update(i=>y(g({},i),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let i=this.totalRecords();if(i===-1||!isFinite(i)){this.toastr.info("Please load total records before going to the last page","Info");return}let n=Math.ceil(i/e.pageSize);if(e.pageNumber>=n){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(p=>y(g({},p),{pageNumber:n}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick","disabled"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(i,n){if(i&1){let p=R();o(0,"app-main-panel",11),G("isDialogFilterVisibleChange",function(_){return h(p),N(n.dialogFilterVisible,_)||(n.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(p),N(n.initDialogVisible,_)||(n.initDialogVisible=_),x(_)}),I("filterConfirmed",function(){return h(p),x(n.onFilterOKEvent())}),b(1,ei,4,1,"ng-template",null,0,d)(3,ci,1,1,"ng-template",null,1,d)(5,Si,1,1,"ng-template",null,2,d),r(),o(7,"p-dialog",12),G("visibleChange",function(_){return h(p),N(n.isDialogExportVisible,_)||(n.isDialogExportVisible=_),x(_)}),b(8,vi,16,7,"div",13)(9,yi,1,2,"ng-template",null,3,d)(11,Ei,2,0,"ng-template",null,4,d),r()}i&2&&(s("pageTitle",n.pageTitle),B("isDialogFilterVisible",n.dialogFilterVisible),s("isFilterable",!0),B("isInitDialogFilterVisible",n.initDialogVisible),s("scrollable",!0),l(7),Le(V(11,$t)),s("modal",!0),B("visible",n.isDialogExportVisible),s("breakpoints",V(12,Xt)),l(),s("ngIf",n.form&&n.filter()))},dependencies:[ie,q,Ae,j,z,Ge,ne,le,ae,Qe,Je,Z,Q,ye,Vt,re,oe,Ie,Ee,J,Y,je,W,K,$,X,me,pe,Ce,He,nt,it,ee,U,H,et,Ze,qe,ze],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var Ii={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},ut=We(Xe(Ii),Ke(t=>{let m={totalCOGS:T(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((i,n)=>i+(n?.amount??0),0):0}),totalRevenue:T(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((i,n)=>i+(n?.amount??0),0):0}),totalExpense:T(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((i,n)=>i+(n?.amount??0),0):0}),grossProfit:T(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:T(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:T(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),$e(t=>{let m=C(A),e=C(se),i={updateFilter(n){P(t,p=>y(g({},p),{filter:g(g({},p.filter),n)}))},getLoader:Se(ue(_e(()=>m.getIncomeStatementLoader().pipe(ve({next:n=>{P(t,p=>y(g({},p),{loader:n,filter:y(g({},p.filter),{from:e.from(n.filter.from).format(),to:e.from(n.filter.to).format()})})),i.getIncomeStatement(t.filter)},error:n=>{console.error(n)}}))))),getIncomeStatement:Se(ue(_e(n=>m.getIncomeStatement(n).pipe(Et(()=>P(t,p=>y(g({},p),{isLoading:!0}))),ve({next:p=>{P(t,u=>y(g({},u),{data:p,isLoading:!1}))},error:p=>{console.error(p)}})))))};return i}),Ye({onInit:t=>{t.getLoader()}}));var _t=()=>({}),ft=t=>["/pages/chart-of-account/account/",t],gt=()=>["/pages/report/general-ledger"],ht=t=>({id:t});function Ri(t,m){if(t&1){let e=R();o(0,"p-button",10),I("onClick",function(){h(e);let n=c(2);return x(n.onExport())}),r()}}function Ti(t,m){if(t&1&&(o(0,"div",8),b(1,Ri,1,0,"p-button",9),r()),t&2){let e=c();l(),s("ngIf",e.roleService.global.export)}}function Di(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),f(e.code),l(2),s("routerLink",F(8,ft,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,gt))("queryParams",F(11,ht,e.accountID)),l(),f(v(9,6,e.amount))}}function Vi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()()),t&2){let e=c(3);l(6),f(v(7,1,e.store.totalRevenue()))}}function Mi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function Li(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),b(3,Di,7,0,"ng-template",null,3,d)(5,Fi,10,13,"ng-template",null,4,d)(7,Vi,8,3,"ng-template",null,5,d)(9,Mi,4,0,"ng-template",null,6,d),r()),t&2){let e,i=c(2);l(2),s("value",(e=i.store.data())==null||e.data==null?null:e.data.revenue)}}function ki(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Ni(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),f(e.code),l(2),s("routerLink",F(8,ft,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,gt))("queryParams",F(11,ht,e.accountID)),l(),f(v(9,6,e.amount))}}function Bi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),f(v(7,2,e.store.totalCOGS())),l(8),f(v(15,4,e.store.grossProfit()))}}function Ai(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function Gi(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),b(3,ki,7,0,"ng-template",null,3,d)(5,Ni,10,13,"ng-template",null,4,d)(7,Bi,16,6,"ng-template",null,5,d)(9,Ai,4,0,"ng-template",null,6,d),r()),t&2){let e,i=c(2);l(2),s("value",(e=i.store.data())==null||e.data==null?null:e.data.cogs)}}function Pi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Oi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),f(e.code),l(2),s("routerLink",F(8,ft,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,gt))("queryParams",F(11,ht,e.accountID)),l(),f(v(9,6,e.amount))}}function ji(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);l(6),f(v(7,2,e.store.totalExpense())),l(8),f(v(15,4,e.store.profitOrLoss()))}}function zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function qi(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),b(3,Pi,7,0,"ng-template",null,3,d)(5,Oi,10,13,"ng-template",null,4,d)(7,ji,16,6,"ng-template",null,5,d)(9,zi,4,0,"ng-template",null,6,d),r()),t&2){let e,i=c(2);l(2),s("value",(e=i.store.data())==null||e.data==null?null:e.data.expense)}}function Hi(t,m){if(t&1&&(o(0,"p-panel")(1,"div",11),b(2,Li,11,1)(3,Gi,11,1)(4,qi,11,1),r()()),t&2){let e,i,n,p=c();l(2),L(p.Object.keys((e=p.store.data().data)!==null&&e!==void 0?e:V(3,_t)).length>0?2:-1),l(),L(p.Object.keys((i=(i=p.store.data().data)==null?null:i.cogs)!==null&&i!==void 0?i:V(4,_t)).length>0?3:-1),l(),L(p.Object.keys((n=(n=p.store.data().data)==null?null:n.expense)!==null&&n!==void 0?n:V(5,_t)).length>0?4:-1)}}function Ui(t,m){if(t&1){let e=R();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),r(),w(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(n){h(e);let p=c();return x(p.onCashierSearch(n))})("onSelect",function(n){h(e);let p=c();return x(p.onCashierSelect(n))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),w(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),l(5),s("iconDisplay","input")("showIcon",!0),l(),s("iconDisplay","input")("showIcon",!0)}}var At=(()=>{class t{constructor(){this.dayjsService=C(se),this.store=C(ut),this.fb=C(xe),this.reportService=C(A),this.roleService=C(te),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ge(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(y(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Fe("Cashier Suggestions"),M(i=>this.cashierSuggestions.set(i))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),i=Object.entries(e).reduce((n,[p,u])=>(p==="from"||p==="to"?u instanceof Date&&(n[p]=this.dayjsService.from(u).format()):n[p]=u||null,n),{});this.store.updateFilter(g(g({},this.store.filter()),i)),this.dialogFilterVisible.update(n=>!n),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Fe("Export Profit & Loss"),M(i=>{let n=i.type,p=[i],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:n}));let _=`profit-and-loss.${n.split("/")[1]}`;u.setAttribute("download",_),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-income-statement"]],features:[Ne([ut])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(i,n){if(i&1){let p=R();o(0,"app-main-panel",7),G("isDialogFilterVisibleChange",function(_){return h(p),N(n.dialogFilterVisible,_)||(n.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(p),N(n.isInitDialogFilterVisible,_)||(n.isInitDialogFilterVisible=_),x(_)}),I("filterConfirmed",function(){return h(p),x(n.onFilterOK())}),b(1,Ti,2,1,"ng-template",null,0,d)(3,Hi,5,6,"ng-template",null,1,d)(5,Ui,15,12,"ng-template",null,2,d),r()}i&2&&(s("isFilterable",!0)("pageTitle",n.store.data().pageTitle),B("isDialogFilterVisible",n.dialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ie,q,j,z,ye,re,oe,J,Y,W,K,$,X,me,pe,ne,le,ae,ee,Ue,U,H,Ie,Ee,Z,Q],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var xt=vt(Lt());var Wi={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,xt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},bt=We(Xe(Wi),Ke(t=>({totalAsset:T(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:T(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:T(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),$e(t=>{let m=C(A),e={updateFilter:i=>{P(t,n=>y(g({},n),{filter:i}))},fetchBalanceSheet:Se(ue(Me(()=>{let i=t.filter();return Object.entries(i).every(([n,p])=>p!=null&&p!=="")}),_e(i=>m.getBalanceSheet(i).pipe(ve({next:n=>{P(t,p=>y(g({},p),{data:n}))},error:n=>{console.error(n)}}))),yt(1))),fetchLoader:Se(ue(_e(()=>m.getBalanceSheetLoader().pipe(ve({next:i=>{P(t,n=>y(g({},n),{metadata:i,filter:{date:(0,xt.default)(i.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:i=>{console.error(i)}})))))};return e}),Ye(t=>({onInit:()=>{t.fetchLoader()}})));var Gt=vt(Lt());var Ct=t=>["/pages/chart-of-account/account/",t],St=()=>["/pages/report/general-ledger"],Ki=(t,m)=>({id:t,to:m}),Pt=t=>({id:t});function Yi(t,m){if(t&1){let e=R();o(0,"p-button",11),I("onClick",function(){h(e);let n=c(2);return x(n.onExport())}),r()}}function $i(t,m){if(t&1&&(o(0,"div",9),b(1,Yi,1,0,"p-button",10),r()),t&2){let e=c();l(),s("ngIf",e.roleService.global.export)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,i=c(3);l(2),f(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,St))("queryParams",wt(11,Ki,e.accountID,i.store.filter().date)),l(),f(v(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),D(" ",v(5,1,e.store.totalAsset())," ")}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function en(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),b(3,Xi,7,0,"ng-template",null,3,d)(5,Ji,10,14,"ng-template",null,4,d)(7,Qi,6,3,"ng-template",null,5,d)(9,Zi,4,0,"ng-template",null,6,d),r()),t&2){let e=c(2);l(2),s("value",e.store.data().asset)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),f(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,St))("queryParams",F(11,Pt,e.accountID)),l(),f(v(9,6,e.counterAmount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);l(4),D(" ",v(5,1,e.store.totalLiability())," ")}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function an(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),b(3,tn,7,0,"ng-template",null,3,d)(5,nn,10,13,"ng-template",null,4,d)(7,on,6,3,"ng-template",null,5,d)(9,rn,4,0,"ng-template",null,6,d),r()),t&2){let e=c(2);l(2),s("value",e.store.data().liability)}}function ln(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function pn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;l(2),f(e.code),l(2),s("routerLink",F(8,Ct,e.accountID)),l(),f(e.name),l(2),s("routerLink",V(10,St))("queryParams",F(11,Pt,e.accountID)),l(),f(v(9,6,e.counterAmount))}}function mn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),S(11,"number"),r()()),t&2){let e=c(3);l(4),D(" ",v(5,2,e.store.totalEquity())," "),l(6),D(" ",v(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function sn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function cn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),b(3,ln,7,0,"ng-template",null,3,d)(5,pn,10,13,"ng-template",null,4,d),a(7," <"),b(8,mn,12,6,"ng-template",null,5,d)(10,sn,4,0,"ng-template",null,6,d),r()),t&2){let e=c(2);l(2),s("value",e.store.data().equity)}}function dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),b(2,en,11,1)(3,an,11,1)(4,cn,12,1),r()()),t&2){let e=c();s("showHeader",!1),l(2),L(e.Object.keys(e.store.data().asset).length>0?2:-1),l(),L(e.Object.keys(e.store.data().liability).length>0?3:-1),l(),L(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function un(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),f(e.value)}}function _n(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),b(5,un,3,1,"ng-template",null,7,d),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),w(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),s("iconDisplay","input")("showIcon",!0)}}var Ot=(()=>{class t{constructor(){this.store=C(bt),this.ReportServiceStore=C(A),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=C(te),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Ft({date:new rt(new Date),outletID:new rt([])})}onFilterOKEvent(){let{date:e,outletID:i}=this.filterForm.value;this.store.updateFilter({date:(0,Gt.default)(e).format("YYYY-MM-DD"),listOutletParam:i}),this.dialogFilterVisible.update(n=>!n)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Fe("Export Balance Sheet"),M(i=>{let n=i.type,p=[i],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(p,{type:n}));let _=`balance-sheet.${n.split("/")[1]}`;u.setAttribute("download",_),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-balance-sheet"]],features:[Ne([bt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(i,n){if(i&1){let p=R();o(0,"app-main-panel",8),G("isDialogFilterVisibleChange",function(_){return h(p),N(n.dialogFilterVisible,_)||(n.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(p),N(n.isInitDialogFilterVisible,_)||(n.isInitDialogFilterVisible=_),x(_)}),I("filterConfirmed",function(){return h(p),x(n.onFilterOKEvent())}),b(1,$i,2,1,"ng-template",null,0,d)(3,dn,5,4,"ng-template",null,1,d)(5,_n,11,7,"ng-template",null,2,d),r()}i&2&&(s("pageTitle",n.store.data().pageTitle)("isFilterable",!0),B("isDialogFilterVisible",n.dialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ie,q,j,z,le,ae,ne,Z,Q,J,Y,W,K,$,X,me,pe,re,oe,Ce,ee,Ue,U,H],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var jt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(i,n){i&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
2
- ,
3
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var zt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(i,n){i&1&&(o(0,"p"),a(1,"report-cash-flow works!"),r(),a(2,`
4
- ,
5
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var qt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(i,n){i&1&&(o(0,"p"),a(1,"report-trial-balance works!"),r(),a(2,`
6
- ,
7
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var fn=()=>({width:"30vw"}),gn=()=>({"1199px":"75vw","575px":"90vw"}),hn=t=>["/pages/journal/journal-entry/",t],xn=t=>({"ng-dirty ng-invalid":t}),bn=()=>({scrollHeight:"250px"});function Cn(t,m){if(t&1){let e=R();o(0,"p-button",27),I("onClick",function(){h(e);let n=c(2);return x(n.onToggleExportDialog())}),r()}}function Sn(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),a(2,"Return to Accounts"),r(),b(3,Cn,1,0,"p-button",26),r()),t&2){let e=c();l(3),s("ngIf",e.roleService.global.export)}}function vn(t,m){if(t&1&&(o(0,"div",24)(1,"span",31)(2,"h2",32),a(3),r()(),o(4,"span",31)(5,"h2",32),a(6),r()()()),t&2){let e=c().$implicit;l(3),f(e.name),l(3),D(" (",e.chartOfAccountCode,") ")}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",33),a(2,"Outlet"),r(),o(3,"th",33),a(4,"No."),r(),o(5,"th",33),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",34),a(10,"Debit"),r(),o(11,"th",35),a(12,"Credit"),r(),o(13,"th",35),a(14,"Balance"),r()())}function En(t,m){if(t&1&&(o(0,"div",38)(1,"a",39),a(2),r(),w(3,"div",41),o(4,"span",42),a(5),r()()),t&2){let e=c().$implicit,i=c(4);l(),s("href",i.authService.getTenantExternalURL()+i.buildReferenceUrl(e),fe),l(),f(e.referenceText),l(),s("innerHTML",e.journalNote,O),l(2),D("",e.note," ")}}function In(t,m){if(t&1&&(o(0,"div",38),w(1,"span",41)(2,"div",41),o(3,"span",42),a(4),r()()),t&2){let e=c().$implicit;l(),s("innerHTML",e.referenceText,O),l(),s("innerHTML",e.journalNote,O),l(2),D("",e.note," ")}}function wn(t,m){if(t&1&&(o(0,"tr")(1,"td",36),a(2),r(),o(3,"td",36)(4,"a",37),a(5),r()(),o(6,"td",36),a(7),S(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),a(12),r(),b(13,En,6,4,"div",38)(14,In,5,3,"div",38),r()(),o(15,"td",40),a(16),S(17,"number"),r(),o(18,"td",40),a(19),S(20,"number"),r(),o(21,"td",40),a(22),S(23,"number"),r()()),t&2){let e=m.$implicit,i=c(4);l(2),f(e.outletName),l(2),s("routerLink",F(19,hn,e.id)),l(),f(e.number),l(2),f(Be(8,10,e.date,"dd MMM yyyy")),l(4),s("href",i.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,fe),l(),f(e.contactName),l(),L(i.buildReferenceUrl(e)?13:14),l(3),D(" ",v(17,13,e.debitAmount)," "),l(3),D(" ",v(20,15,e.creditAmount)," "),l(3),f(v(23,17,e.balance))}}function Rn(t,m){if(t&1&&(o(0,"tr"),w(1,"td",43),o(2,"td",44),a(3,"Total"),r(),o(4,"td",44),a(5),S(6,"number"),r(),o(7,"td",44),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c().$index,i=c(3);l(5),D(" ",v(6,2,i.items().data[e].debitTotal)," "),l(3),D(" ",v(9,4,i.items().data[e].creditTotal)," ")}}function Tn(t,m){t&1&&(o(0,"tr")(1,"td",45)(2,"span"),a(3,"No records found."),r()()())}function Dn(t,m){if(t&1&&(o(0,"p-table",30),b(1,vn,7,2,"ng-template",null,5,d)(3,yn,15,0,"ng-template",null,6,d)(5,wn,24,21,"ng-template",null,7,d)(7,Rn,11,6,"ng-template",null,4,d)(9,Tn,4,0,"ng-template",null,8,d),r()),t&2){let e=m.$implicit;s("value",e.data)}}function Fn(t,m){if(t&1&&(o(0,"div",29),Re(1,Dn,11,1,"p-table",30,we),r()),t&2){let e=c(2);l(),Te(e.items().data)}}function Vn(t,m){if(t&1&&b(0,Fn,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Mn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",62),a(9),r()()()),t&2){let e=m.$implicit;l(3),D("(",e.code,")"),l(6),f(e.name)}}function Ln(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",62),a(9),r()()()),t&2){let e=m.$implicit;l(3),D("(",e.code,")"),l(6),f(e.name)}}function kn(t,m){t&1&&(o(0,"div",63),a(1," Account is required. "),r())}function Nn(t,m){if(t&1&&(o(0,"div",64)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;l(2),f(e.value)}}function Bn(t,m){if(t&1&&(o(0,"div",55)(1,"div",21),w(2,"p-radiobutton",65),o(3,"label",66),a(4),r()()()),t&2){let e=m.$implicit;l(2),s("value",e.key)("inputId",e.key),l(),ke("for",e.key),l(),f(e.value)}}function An(t,m){if(t&1){let e=R();o(0,"div",38)(1,"label",47),a(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(n){h(e);let p=c(2);return x(p.searchCustomer(n))}),r()()}if(t&2){let e=c(2);l(3),s("suggestions",e.customerSuggestions())}}function Gn(t,m){if(t&1){let e=R();o(0,"div",38)(1,"label",47),a(2,"Supplier"),r(),o(3,"p-autocomplete",68),I("completeMethod",function(n){h(e);let p=c(2);return x(p.searchSupplier(n))}),r()()}if(t&2){let e=c(2);l(3),s("suggestions",e.supplierSuggestions())}}function Pn(t,m){if(t&1){let e=R();o(0,"div",38)(1,"label",47),a(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(n){h(e);let p=c(2);return x(p.searchCustomer(n))}),r()()}if(t&2){let e=c(2);l(3),s("suggestions",e.customerSuggestions())}}function On(t,m){if(t&1){let e=R();o(0,"form",46)(1,"div",38)(2,"label",47),a(3,"Accounts"),r(),o(4,"p-multiselect",48),I("onChange",function(n){h(e);let p=c();return x(p.onAccountChange(n))}),b(5,Mn,10,2,"ng-template",null,9,d)(7,Ln,10,2,"ng-template",null,10,d),r(),b(9,kn,2,0,"div",49),r(),o(10,"div",38)(11,"label",47),a(12,"From"),r(),o(13,"div",50),w(14,"p-datepicker",51)(15,"p-datepicker",52),r()(),o(16,"div",38)(17,"label",47),a(18,"Outlets"),r(),o(19,"p-multiselect",53),b(20,Nn,3,1,"ng-template",null,10,d),r()(),o(22,"div",38)(23,"label",47),a(24,"Category"),r(),o(25,"p-treeselect",54),I("onFocus",function(){h(e);let n=c();return x(n.onCategoryFocus())}),r()(),o(26,"div",38)(27,"label",18),a(28,"Contact Type"),r(),o(29,"div",16),Re(30,Bn,5,4,"div",55,we),r()(),o(32,"div",38)(33,"label",18),a(34,"Sort order"),r(),o(35,"div",16)(36,"div",55)(37,"div",21),w(38,"p-radiobutton",56),o(39,"label",57),a(40,"Asc"),r()()(),o(41,"div",58)(42,"div",21),w(43,"p-radiobutton",59),o(44,"label",60),a(45,"Desc"),r()()()()(),b(46,An,4,1,"div",38)(47,Gn,4,1,"div",38)(48,Pn,4,1,"div",38),r()}if(t&2){let e,i,n,p=c();s("formGroup",p.form),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.accounts)("selectionLimit",5)("ngClass",F(22,xn,((e=p.form.get("listAccountID"))==null?null:e.invalid)&&(((e=p.form.get("listAccountID"))==null?null:e.touched)||((e=p.form.get("listAccountID"))==null?null:e.dirty)))),l(5),s("ngIf",((i=p.form.get("listAccountID"))==null?null:i.invalid)&&(((i=p.form.get("listAccountID"))==null?null:i.touched)||((i=p.form.get("listAccountID"))==null?null:i.dirty))),l(5),s("iconDisplay","input")("showIcon",!0),l(),s("iconDisplay","input")("showIcon",!0),l(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",p.loaderMetadata().options.outlets),l(6),s("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",V(24,bn))("options",p.categoriesOptions()),l(5),Te(p.loaderMetadata().options.contactTypeOptions),l(8),s("value",!0),l(5),s("value",!1),l(3),L((n=p.form.controls.contactType.value)===1?46:n===2?47:48)}}function jn(t,m){if(t&1){let e=R();o(0,"p-button",69),I("onClick",function(){h(e);let n=c();return x(n.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function zn(t,m){if(t&1){let e=R();o(0,"p-button",70),I("click",function(){h(e);let n=c();return x(n.onToggleExportDialog())}),r(),o(1,"p-button",71),I("click",function(){h(e);let n=c();return x(n.onExport())}),r()}}var Ht=(()=>{class t{buildReferenceUrl(e){return this.buildReferenceUrl(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(M(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(A),this.route=C(Pe),this.roleService=C(te),this.authService=C(he),this.fb=C(xe),this.coaService=C(tt),this.toastr=C(Oe),this.dayjsService=C(se),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=T(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=T(()=>{let e=this.filter(),i=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,n=Math.min(e.pageNumber*e.pageSize,isFinite(i)?i:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?n:0,total:i,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(i)?e.pageNumber*e.pageSize<i:!0}}),this.loaderMetadata=be(this.reportService.fetchGeneralLedgerLoader("multiple"),{initialValue:null}),this.baseFilter=T(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=be(this.route.queryParamMap.pipe(Ve(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=T(()=>{let e=this.baseFilter(),i=this.queryFilter(),n=this.localFilter();return e?g(g(g({},e),i??{}),n):null}),this.creditSubTotal=T(()=>0),this.debitSubTotal=T(()=>0),this.hasNextPage=T(()=>{let e=this.filter();if(!e)return!1;let i=Math.ceil(e.rowCount/e.pageSize);return e.pageNumber<i}),this.initializeForm(),ge(()=>{let e=this.filter();e&&(e.listAccountID.length>0||e.listCategoryID.length>0)&&(this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1}),this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(i=>{this.items.set(i)}))})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(null),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listCategoryID:this.fb.control([]),listAccountID:this.fb.control([]),rowCount:this.fb.control(0),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportRowCount:this.fb.control(0)})}findNodeByKey(e,i){for(let n of e){if(n.key===i)return n;if(n.children){let p=this.findNodeByKey(n.children,i);if(p)return p}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((i,[n,p])=>{switch(n){case"from":break;case"to":i[n]=p&&(typeof p=="string"||typeof p=="number"||p instanceof Date)?this.dayjsService.from(p)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(p)?i[n]=p.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):i[n]=[];break;case"listOutletID":case"listAccountID":i[n]=Array.isArray(p)?p:[];break;case"pageNumber":case"pageSize":case"rowCount":case"exportPageNumber":case"exportRowCount":i[n]=p!=null?Number(p):0;break;case"sortAscending":case"export":i[n]=!!p;break;case"contactType":i[n]=p!=null?Number(p):null;break;default:i[n]=p}return i},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}onFormValueChange(){let e=this.form.controls.listAccountID.value,i=this.form.controls.listCategoryID.value;e.length<=0&&i.length<=0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1})):e.length>0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.disable({emitEvent:!1})):i.length>0&&(this.form.controls.listAccountID.disable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1}))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(M(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(M(i=>this.customerSuggestions.set(i))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(M(i=>this.supplierSuggestions.set(i))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at most 5 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e)}buildFilterBody(){let p=this.form.value,{from:e,to:i}=p,n=de(p,["from","to"]);return y(g({},this.filter()),{pageNumber:n.pageNumber,pageSize:n.pageSize,sortAscending:n.sortAscending,accountID:n.accountID,listCategoryID:n.listCategoryID?.map(u=>u.key)??[],contactID:n.contactID?.length===0?null:n.contactID,listOutletID:n.listOutletID??[],listAccountID:n.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(i)?this.dayjsService.format(i):null,contactType:n.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(M(i=>this.handleExportResponse(i))).subscribe()}handleExportResponse(e){let i=e.headers,n=i.get("Content-Disposition")??i.get("content-disposition"),p="download.csv";if(n){let _=n.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);_?.[1]&&(p=decodeURIComponent(_[1].replace(/"/g,"")))}let u=e.body;ot(u,p,u.type)}buildExportBody(){let p=this.form.value,{from:e,to:i}=p,n=de(p,["from","to"]);return y(g({},this.filter()),{exportPageNumber:+n.exportPageNumber,pageNumber:n.pageNumber,pageSize:n.pageSize,sortAscending:n.sortAscending,accountID:n.accountID,listCategoryID:n.listCategoryID?.map(u=>u.key)??[],contactID:n.contactID?.length===0?null:n.contactID,listOutletID:n.listOutletID??[],listAccountID:n.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(i)?this.dayjsService.format(i):null,contactType:n.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let i=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:i+1})})}onPrevPage(){this.localFilter.update(e=>{let i=e.pageNumber??this.baseFilter()?.pageNumber??1;return y(g({},e),{pageNumber:Math.max(1,i-1)})})}goToPage(e){this.localFilter.update(i=>y(g({},i),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let i=this.totalRecords();if(i===-1||!isFinite(i)){this.toastr.info("Please load total records before going to the last page","Info");return}let n=Math.ceil(i/e.pageSize);if(e.pageNumber>=n){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(p=>y(g({},p),{pageNumber:n}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-report-multiple-ledger"]],decls:28,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"row"],[1,"col"],["for",""],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","selectionLimit","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","key","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"col-4"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(i,n){if(i&1){let p=R();o(0,"app-main-panel",11),G("isDialogFilterVisibleChange",function(_){return h(p),N(n.dialogFilterVisible,_)||(n.dialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(p),N(n.initDialogVisible,_)||(n.initDialogVisible=_),x(_)}),I("filterConfirmed",function(){return h(p),x(n.onFilterOKEvent())}),b(1,Sn,4,1,"ng-template",null,0,d)(3,Vn,1,1,"ng-template",null,1,d)(5,On,49,25,"ng-template",null,2,d),r(),o(7,"p-dialog",12),G("visibleChange",function(_){return h(p),N(n.isDialogExportVisible,_)||(n.isDialogExportVisible=_),x(_)}),o(8,"div",13)(9,"div",14)(10,"div",15)(11,"div",16)(12,"div",17)(13,"label",18),a(14,"Page"),r()(),o(15,"div",17),w(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),w(19,"i",22),o(20,"span",23),a(21),S(22,"number"),S(23,"number"),r()()()(),b(24,jn,1,2,"ng-template",null,3,d)(26,zn,2,0,"ng-template",null,4,d),r()}i&2&&(s("pageTitle",n.pageTitle),B("isDialogFilterVisible",n.dialogFilterVisible),s("isFilterable",!0),B("isInitDialogFilterVisible",n.initDialogVisible),s("scrollable",!0),l(7),Le(V(17,fn)),s("modal",!0),B("visible",n.isDialogExportVisible),s("breakpoints",V(18,gn)),l(2),s("formGroup",n.form),l(12),De("Exporting data from ",v(22,13,n.filter().exportPageNumber)," - ",v(23,15,n.filter().exportRowCount),""))},dependencies:[ie,q,Ae,j,z,Ge,ne,le,ae,Qe,Je,Z,Q,ye,re,oe,Ie,Ee,J,Y,je,W,K,$,X,me,pe,Ce,He,nt,Mt,it,ee,U,H,et,Ze,qe,ze],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var Da=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Bt},{path:"multiple-general-ledger",component:Ht},{path:"profit-loss",component:At},{path:"balance-sheet",component:Ot},{path:"comparative-balance",component:jt},{path:"trial-balance",component:qt},{path:"cash-flow",component:zt}]}];export{Da as REPORTS_ROUTES};
package/chunk-LSY7PUC7.js DELETED
@@ -1 +0,0 @@
1
- import{a as A}from"./chunk-JOLNIJ36.js";import{a as ze}from"./chunk-YPBGL37O.js";import{b as Pe}from"./chunk-SNKHWMQW.js";import{a as oe}from"./chunk-WW5ELKKO.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-C2GO6SPF.js";import{a as M,b as P}from"./chunk-O4QM64EH.js";import{d as De,i as ke,j as Ne,k as Re}from"./chunk-SVXDMOLP.js";import{a as Ae,b as Fe}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import"./chunk-GDX5XEV3.js";import{a as Ve,b as Je}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{g as Ee,h as Ie}from"./chunk-XZQ3IYQ6.js";import{b as je,c as Te}from"./chunk-X22YKT5B.js";import{a as xe,b as be}from"./chunk-JYCUE5HV.js";import{a as v,b as Ce,c as Se,d as we,e as ve,f as ye}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as fe,o as _e,w as ge,x as he}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as re,c as ae,e as le,f as me,k as pe,l as se,o as de,u as ue,x as ce}from"./chunk-G5S5AZA7.js";import"./chunk-Z45NTTES.js";import"./chunk-4AOHMAEQ.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as Y,j as Z,k as ee,p as te,q as ie,r as ne}from"./chunk-OKCHQM5Q.js";import{Ab as L,Ac as E,Cb as g,Ga as D,Jc as I,Kb as s,Kc as X,Lc as R,Mc as S,Ub as a,Vb as r,Wb as b,X as J,Yc as y,Z as H,_b as j,bb as B,c as F,cb as G,dc as T,ec as f,gb as m,ha as w,pa as h,qa as x,qc as p,rc as C,s as V,sc as k,uc as W,vc as K,wb as U,wc as N,xc as q,yc as Q,zc as $}from"./chunk-JP6RBSB3.js";import{a as d,b as c}from"./chunk-YQFG5XE2.js";var Ge={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},filter:{number:null,from:null,to:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,outletName:""}},z=Ce(ye(Ge),Se(t=>({first:y(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:y(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:y(()=>t.data().data.some(l=>l.checked)),checkedAdjustment:y(()=>t.data().data.filter(l=>l.checked).map(l=>l.id))})),ve(t=>{let l=w(A);return{updateFilter(n){v(t,i=>c(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!0}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onRowUnselect(n){v(t,i=>{let o=i.data.data.map(u=>u.id===n.id?c(d({},u),{checked:!1}):u);return c(d({},i),{data:c(d({},i.data),{data:o})})})},onHeaderCheckboxToggle(n){v(t,i=>{let o=i.data.data.map(u=>c(d({},u),{checked:n}));return c(d({},i),{data:c(d({},i.data),{data:o})})})},getGJAdjustmentLoader:M(F(J(()=>l.getGJAdjustmentLoader().pipe(P({next:n=>{v(t,i=>c(d({},i),{meta:n}))},error:n=>{console.error("Error fetching adjustment loader:",n)}}))))),getAdjustmentJournal:M(F(V(n=>Object.entries(n).reduce((i,[o,u])=>(u!=null&&(i[o]=u),i),{})),J(n=>l.getAdjustmentJournal(n).pipe(V(i=>c(d({},i),{data:i.data.map(o=>c(d({},o),{checked:!1}))})),P({next:i=>{v(t,o=>c(d({},o),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),we(t=>({onInit:()=>{t.getGJAdjustmentLoader(),t.getAdjustmentJournal(t.filter)}})));var O=t=>({"ng-invalid ng-dirty":t}),Ue=()=>({});function Le(t,l){if(t&1){let e=j();a(0,"p-button",10),T("onClick",function(){h(e);let i=f(2);return x(i.generateAdjusmentJournal())}),r()}}function We(t,l){if(t&1&&g(0,Le,1,0,"p-button",9),t&2){let e=f();s("ngIf",e.store.hasCheckedRows())}}function Ke(t,l){t&1&&(a(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),r(),a(3,"th",13),p(4,"Outlet"),r(),a(5,"th",14),p(6,"Number"),r(),a(7,"th",15),p(8,"Date"),r(),a(9,"th",14),p(10,"Adjustment Qty"),r(),a(11,"th",13),p(12,"Type"),r(),a(13,"th",16),p(14,"State"),r(),a(15,"th",17),p(16,"Note"),r(),b(17,"th",18),r())}function qe(t,l){if(t&1&&(a(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",20),p(7),r()(),a(8,"td"),p(9),I(10,"date"),r(),a(11,"td"),p(12),I(13,"number"),r(),a(14,"td"),p(15),r(),a(16,"td"),p(17),r(),a(18,"td"),b(19,"div",21),r(),a(20,"td"),b(21,"p-button",22),r()()),t&2){let e=l.$implicit,n=f(2);m(2),s("value",e),m(2),C(e.outlet),m(2),s("href",n.authService.getTenantExternalURL()+"/menu/Adjustment/Adjustment/Archive/Info?ID="+e.id,G),m(),k(" ",e.number," "),m(2),C(R(10,12,e.date,"d MMM y")),m(3),C(X(13,15,e.quantitySUM)),m(3),C(e.type),m(2),C(e.state),m(2),s("innerHTML",e.note,B),m(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Qe(t,l){if(t&1&&p(0),t&2){let e=f(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function $e(t,l){t&1&&(a(0,"tr")(1,"td",23)(2,"span"),p(3,"No records found."),r()()())}function Xe(t,l){if(t&1){let e=j();a(0,"p-panel")(1,"p-table",11),T("onRowSelect",function(i){h(e);let o=f();return x(o.onRowSelect(i))})("onRowUnselect",function(i){h(e);let o=f();return x(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){h(e);let o=f();return x(o.onHeaderCheckboxToggle(i))})("onPage",function(i){h(e);let o=f();return x(o.onPageChange(i))}),g(2,Ke,18,0,"ng-template",null,3,S)(4,qe,22,17,"ng-template",null,4,S)(6,Qe,1,3,"ng-template",null,5,S)(8,$e,4,0,"ng-template",null,6,S),r()()}if(t&2){let e=f();m(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function Ye(t,l){if(t&1&&(a(0,"span",33),p(1),I(2,"truncate"),r()),t&2){let e=l.$implicit;s("pTooltip",e.name),m(),k(" ",R(2,2,e.name,30)," ")}}function Ze(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function et(t,l){if(t&1&&(a(0,"div"),g(1,Ze,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("from"))}}function tt(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function it(t,l){if(t&1&&(a(0,"div"),g(1,tt,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("to"))}}function nt(t,l){if(t&1&&(a(0,"div")(1,"span",35),p(2),r()()),t&2){let e=l.$implicit;m(2),C(e)}}function ot(t,l){if(t&1&&(a(0,"div"),g(1,nt,3,1,"div",34),r()),t&2){let e=f(2);m(),s("ngForOf",e.getErrors("pageSize"))}}function rt(t,l){if(t&1&&(a(0,"form",24)(1,"div",25)(2,"label",26),p(3,"Outlet"),r(),a(4,"p-select",27),g(5,Ye,3,5,"ng-template",null,7,S),r()(),a(7,"div",25)(8,"label",26),p(9,"From - To"),r(),a(10,"div",28),b(11,"p-datepicker",29),g(12,et,2,1,"div",30),b(13,"p-datepicker",31),g(14,it,2,1,"div",30),r()(),a(15,"div",25)(16,"label",26),p(17,"Page Size"),r(),b(18,"input",32),g(19,ot,2,1,"div",30),r()()),t&2){let e=f();s("formGroup",e.form),m(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),s("iconDisplay","input")("showIcon",!0)("ngClass",E(14,O,e.isInvalid("from"))),m(),s("ngIf",e.isInvalid("from")),m(),s("iconDisplay","input")("showIcon",!0)("ngClass",E(16,O,e.isInvalid("to"))),m(),s("ngIf",e.isInvalid("to")),m(4),s("autoNumeric",$(18,Ue))("ngClass",E(19,O,e.isInvalid("pageSize"))),m(),s("ngIf",e.isInvalid("pageSize"))}}var Lt=(()=>{class t extends Me{constructor(){super(),this.store=w(z),this.generateJournalService=w(A),this.authService=w(oe),this.isDialogFilterVisible=D(!1),this.isInitDialogFilterVisible=D(!1),this.fb=w(ue),this.dayjsService=w(Pe)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:n,to:i,pageNumber:o,rowCount:u,pageSize:_,export:Oe,exportPageNumber:He,exportRowCount:Be}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(""),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(o),rowCount:this.fb.control(u),pageSize:this.fb.control(_,[ae.required]),export:this.fb.control(Oe),exportPageNumber:this.fb.control(He),exportRowCount:this.fb.control(Be)})}onSearch(e){this.store.updateFilter(c(d({},this.store.filter()),{number:e,pageNumber:1}))}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((n,[i,o])=>{switch(i){case"from":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;case"to":typeof o=="object"?n[i]=this.dayjsService.from(o)?this.dayjsService.format(o):null:n[i]=o!=null?String(o):null;break;default:n[i]=o===null?"":o;break}return n},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let n=e.first/e.rows;this.store.updateFilter(c(d({},this.store.filter()),{pageNumber:n+1}))}generateAdjusmentJournal(){this.generateJournalService.createAdjustmentJournal(this.store.checkedAdjustment()).pipe(H(()=>this.store.getAdjustmentJournal(this.store.filter))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=U({type:t,selectors:[["app-adjustment-journal"]],features:[Q([z]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Adjustment",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","14rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(n,i){if(n&1){let o=j();a(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(_){return h(o),N(i.isDialogFilterVisible,_)||(i.isDialogFilterVisible=_),x(_)})("isInitDialogFilterVisibleChange",function(_){return h(o),N(i.isInitDialogFilterVisible,_)||(i.isInitDialogFilterVisible=_),x(_)}),T("filterConfirmed",function(){return h(o),x(i.onFilterOKEvent())})("search",function(_){return h(o),x(i.onSearch(_))}),g(1,We,1,1,"ng-template",null,0,S)(3,Xe,10,5,"ng-template",null,1,S)(5,rt,20,21,"ng-template",null,2,S),r()}n&2&&(s("isSearchableInput",!0)("isFilterable",!0),K("isDialogFilterVisible",i.isDialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,De,ke,Ne,ne,Y,Z,ee,ie,te,be,xe,he,ge,Fe,Ae,Je,Ve,ce,pe,re,le,me,se,de,_e,fe,Ee,Te,je,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Lt as AdjustmentJournalComponent};
package/chunk-N5RPPHA6.js DELETED
@@ -1 +0,0 @@
1
- import{a as re}from"./chunk-G4XX7EU2.js";import{a as dt,b as gt}from"./chunk-AACWH3EJ.js";import{a as ut}from"./chunk-YPBGL37O.js";import{a as It,b as mt}from"./chunk-SNKHWMQW.js";import{a as Ke}from"./chunk-WW5ELKKO.js";import"./chunk-FLZXCWDU.js";import{a as pt,b as st}from"./chunk-NJO5TWIA.js";import{a as ct}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import{a as et}from"./chunk-BY6QUHQI.js";import"./chunk-C2GO6SPF.js";import{a as ne,b as ie}from"./chunk-O4QM64EH.js";import{b as ot,d as Me,i as at,j as lt,k as ke}from"./chunk-SVXDMOLP.js";import{a as it,b as rt}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Ne}from"./chunk-XKCLERWG.js";import{a as ye,b as Re}from"./chunk-H57SDRPH.js";import"./chunk-GDX5XEV3.js";import{a as De,b as Pe}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as Q}from"./chunk-4CDAAU6Z.js";import{f as nt,h as L}from"./chunk-XZQ3IYQ6.js";import"./chunk-X22YKT5B.js";import{a as N,b as A}from"./chunk-JYCUE5HV.js";import{a as w,b as Ie,c as tt,d as we,e as Te,f as Fe}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as Ce,o as Se,w as Y,x as J}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as xe,c as K,e as X,f as _e,i as Xe,j as Ye,k as he,l as Ee,o as ve,u as Je,v as Qe,w as Ze,x as be}from"./chunk-G5S5AZA7.js";import{b as de,d as ge,e as k,l as V}from"./chunk-Z45NTTES.js";import{a as fe}from"./chunk-4AOHMAEQ.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as ze,k as P,p as ue,q as z,r as M}from"./chunk-OKCHQM5Q.js";import{Ab as He,Ac as S,Cb as h,Ga as q,J as qe,Jc as C,Kb as m,Kc as F,Lc as U,Mc as x,Pb as $e,Qb as H,Sb as $,Tb as W,Ub as r,Vb as n,Wb as d,X as O,Yc as te,Z as T,_b as y,ba as le,c as ee,dc as R,ec as g,gb as l,ha as u,pa as v,qa as b,qc as a,rc as E,s as G,sc as I,ta as Ue,uc as We,vc as pe,wa as Ge,wb as D,wc as se,xc as ce,yc as me,zc as Ve}from"./chunk-JP6RBSB3.js";import{a as f,b as _,e as Rt}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{#e=u(fe);#t=u(Ke);getRecurringExpenseLoader(){return this.#e.get(void 0,"api/RecurringExpenseLoader/GetList")}getRecurringExpenses(e){return this.#e.post(void 0,"api/RecurringExpense/GetList",e)}fetchRecurringExpenseForm(e){return this.#e.get(void 0,`api/RecurringExpense/form/${e??""}`)}fetchSupplierSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",o)}fetchCustomerSuggestion(e){let o={count:100,prefix:e};return this.#e.post(this.#t.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",o)}submitRecurringExpense(e,o={}){return this.#e.post(void 0,"api/RecurringExpense/submit",e,o)}removeRecurringExpense(e){return this.#e.delete(void 0,`api/RecurringExpense/${e}`,void 0)}removeRecurringExpenses(e){let o={body:e};return this.#e.delete(void 0,"api/RecurringExpense/Batch",o)}getRecurringExpenseByID(e){return this.#e.get(void 0,`api/RecurringExpense/Info/${e}`)}getAssetValueList(){return this.#e.get(void 0,"api/AssetValue/GetListt")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var wt={data:{data:[],count:0},meta:{Options:{Frequencies:[]},Filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},filter:{text:null,Frequency:0,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4}},Ae=Ie(Fe(wt),tt(t=>({first:te(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:te(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().count)),hasCheckedRows:te(()=>t.data().data.some(c=>c.checked)),checkedInvoice:te(()=>t.data().data.filter(c=>c.checked).map(c=>c.id))})),Te(t=>{let c=u(B);return{updateFilter(o){w(t,i=>_(f({},i),{filter:f(f({},i.filter),o)}))},onRowSelect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!0}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onRowUnselect(o){w(t,i=>{let s=i.data.data.map(p=>p.id===o.id?_(f({},p),{checked:!1}):p);return _(f({},i),{data:_(f({},i.data),{data:s})})})},onHeaderCheckboxToggle(o){w(t,i=>{let s=i.data.data.map(p=>_(f({},p),{checked:o}));return _(f({},i),{data:_(f({},i.data),{data:s})})})},getRecurringExpenseLoader:ne(ee(O(()=>c.getRecurringExpenseLoader().pipe(ie({next:o=>{w(t,i=>_(f({},i),{meta:o}))},error:o=>{console.error("Error fetching Recurring Expense Loader:",o)}}))))),getRecurringExpenses:ne(ee(G(o=>Object.entries(o).reduce((i,[s,p])=>(p!=null&&(i[s]=p),i),{})),O(o=>c.getRecurringExpenses(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching Recurring Expenses:",i)}})))))}}),we(t=>({onInit:()=>{t.getRecurringExpenseLoader(),t.getRecurringExpenses(t.filter)}})));var Dt=["class","page"],Pt=t=>["details/",t];function Mt(t,c){if(t&1){let e=y();r(0,"p-button",12),R("onClick",function(){v(e);let i=g(2);return b(i.onDeleteSelected())}),n()}}function kt(t,c){if(t&1&&(r(0,"div",8),h(1,Mt,1,0,"p-button",9),r(2,"a",10),d(3,"i",11),r(4,"span"),a(5,"Add"),n()()()),t&2){let e=g();l(),m("ngIf",e.store.hasCheckedRows())}}function Vt(t,c){t&1&&(r(0,"tr")(1,"th"),d(2,"p-tableHeaderCheckbox"),n(),r(3,"th"),a(4,"Outlet"),n(),r(5,"th"),a(6,"Name"),n(),r(7,"th"),a(8,"Expense Account"),n(),r(9,"th"),a(10,"Start Date"),n(),r(11,"th"),a(12,"End Date"),n(),r(13,"th"),a(14,"Last Expense"),n(),r(15,"th"),a(16,"Amount"),n(),r(17,"th"),a(18,"Frequency"),n()())}function Nt(t,c){if(t&1&&(r(0,"tr")(1,"td"),d(2,"p-tableCheckbox",14),n(),r(3,"td"),a(4),n(),r(5,"td")(6,"a",15),a(7),n()(),r(8,"td"),a(9),n(),r(10,"td"),a(11),C(12,"date"),n(),r(13,"td"),a(14),C(15,"date"),n(),r(16,"td"),a(17),C(18,"date"),n(),r(19,"td"),a(20),C(21,"number"),n(),r(22,"td"),a(23),n()()),t&2){let e=c.$implicit;l(2),m("value",e),l(2),E(e.outletName),l(2),m("routerLink",S(21,Pt,e.id)),l(),E(e.name),l(2),E(e.expenseName),l(2),E(U(12,10,e.startDate,"d MMM y")),l(3),E(U(15,13,e.endDate,"d MMM y")),l(3),E(U(18,16,e.lastExpenseDate,"d MMM y")),l(3),E(F(21,19,e.amount)),l(3),E(e.repeatTypeLabel)}}function At(t,c){if(t&1&&(r(0,"div"),a(1),n()),t&2){let e=g(2);l(),We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().count," entries ")}}function Lt(t,c){t&1&&(r(0,"tr")(1,"td",16)(2,"span"),a(3,"No recurring expenses found."),n()()())}function Bt(t,c){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",13),R("onPage",function(i){v(e);let s=g();return b(s.onPageChange(i))})("onHeaderCheckboxToggle",function(i){v(e);let s=g();return b(s.onHeaderCheckboxToggle(i))})("onRowSelect",function(i){v(e);let s=g();return b(s.onRowSelect(i))})("onRowUnselect",function(i){v(e);let s=g();return b(s.onRowUnselect(i))}),h(2,Vt,19,0,"ng-template",null,3,x)(4,Nt,24,23,"ng-template",null,4,x)(6,At,2,3,"ng-template",null,5,x)(8,Lt,4,0,"ng-template",null,6,x),n()()}if(t&2){let e=g();l(),m("lazy",!0)("totalRecords",e.store.data().count)("rows",e.store.filter().pageSize)("paginator",!0)("value",e.store.data().data)}}function jt(t,c){if(t&1&&(r(0,"form",17)(1,"div",18)(2,"label",19),a(3,"Type"),n(),d(4,"p-select",20),n()()),t&2){let e=g();m("formGroup",e.form),l(4),m("options",e.store.meta().Options.Frequencies)}}var _t=(()=>{class t extends ct{constructor(){super(...arguments),this.store=u(Ae),this.recurringExpenseService=u(B),this.fb=u(Je),this.isDialogFilterVisible=q(!1)}ngOnInit(){this.initForm()}onPageChange(e){let o=e.first/e.rows;this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:o+1}))}onDeleteSelected(){this.recurringExpenseService.removeRecurringExpenses(this.store.checkedInvoice()).pipe(T(()=>{this.store.updateFilter(_(f({},this.store.filter()),{pageNumber:1}))})).subscribe()}onSearchEvent(e){this.store.updateFilter(_(f({},this.store.filter()),{text:e}))}onFilterEvent(){this.onSubmitFilterDialog()}onSubmitFilterDialog(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((o,[i,s])=>(s!=null&&(o[i]=s),o),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(o=>!o)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(e.data)}initForm(){let{text:e,Frequency:o,pageNumber:i,rowCount:s,pageSize:p,export:j,exportPageNumber:St,exportRowCount:yt}=this.store.filter();this.form=this.fb.group({text:this.fb.control(e),Frequency:this.fb.control(o),pageNumber:this.fb.control(i),rowCount:this.fb.control(s),pageSize:this.fb.control(p),export:this.fb.control(j),exportPageNumber:this.fb.control(St),exportRowCount:this.fb.control(yt)})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ue(t)))(i||t)}})()}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense",8,"page"]],features:[me([Ae]),He],attrs:Dt,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Recurring Expenses",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","create",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","lazy","totalRecords","rows","paginator","value"],[3,"value"],[1,"link-primary",3,"routerLink"],["colspan","9"],[1,"d-flex","flex-column",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","Frequency","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Type",3,"options"]],template:function(o,i){if(o&1){let s=y();r(0,"app-main-panel",7),R("search",function(j){return v(s),b(i.onSearchEvent(j))}),ce("isDialogFilterVisibleChange",function(j){return v(s),se(i.isDialogFilterVisible,j)||(i.isDialogFilterVisible=j),b(j)}),R("filterConfirmed",function(){return v(s),b(i.onFilterEvent())}),h(1,kt,6,1,"ng-template",null,0,x)(3,Bt,10,5,"ng-template",null,1,x)(5,jt,5,2,"ng-template",null,2,x),n()}o&2&&(m("isSearchableInput",!0)("isFilterable",!0),pe("isDialogFilterVisible",i.isDialogFilterVisible),m("scrollable",!0))},dependencies:[L,k,Q,ke,Me,at,lt,M,P,z,ue,V,nt,Pe,De,J,Y,be,he,X,_e,Ee,ve,A,N],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return t})();var Z=Rt(It());var Ut=["class","page"],Gt=()=>["/pages/recurring/recurring-expense"],ae=t=>({"ng-dirty ng-invalid":t}),Ht=()=>({});function $t(t,c){if(t&1){let e=y();r(0,"div",5)(1,"a",6),a(2," Cancel "),n(),r(3,"p-button",7),R("click",function(){v(e);let i=g();return b(i.onSubmit())}),n()()}t&2&&(l(),m("routerLink",Ve(1,Gt)))}function Wt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function zt(t,c){if(t&1&&(r(0,"div",32)(1,"div",33),a(2),n()()),t&2){let e=c.$implicit;l(2),I(" ",e.name," ")}}function Kt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Xt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Yt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Jt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function Qt(t,c){if(t&1&&(r(0,"div",5)(1,"div")(2,"span"),a(3),n()(),r(4,"div",33),a(5),n()()),t&2){let e=c.$implicit;l(3),I("(",e.code,")"),l(2),I(" ",e.value," ")}}function Zt(t,c){if(t&1&&(r(0,"small",19),a(1),n()),t&2){let e=c.$implicit;l(),E(e)}}function en(t,c){if(t&1){let e=y();r(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-scroll-panel")(4,"div",12)(5,"div",13)(6,"form",14)(7,"div",15)(8,"div",13)(9,"div",16)(10,"label",17),a(11,"Name"),n(),d(12,"input",18),r(13,"div"),$(14,Wt,2,1,"small",19,H),n()()(),r(16,"div",20,2)(18,"div",16)(19,"label",17),a(20,"Outlet"),n(),r(21,"p-select",21),h(22,zt,3,1,"ng-template",null,3,x),n()()(),r(24,"div",20)(25,"div",16)(26,"div")(27,"label",17),a(28,"Supplier"),n(),r(29,"p-autocomplete",22),R("completeMethod",function(i){v(e);let s=g(2);return b(s.searchContact(i))}),n()(),r(30,"div"),$(31,Kt,2,1,"small",19,H),n()()(),r(33,"div",20)(34,"div",16)(35,"label",17),a(36,"From"),n(),d(37,"p-datepicker",23),n()(),r(38,"div",20)(39,"div",16)(40,"label",17),a(41,"To"),n(),d(42,"p-datepicker",24),n()(),d(43,"div",25),n(),d(44,"hr"),r(45,"div",15)(46,"div",20)(47,"div",16)(48,"label",17),a(49,"Amount"),n(),d(50,"input",26),r(51,"div"),$(52,Xt,2,1,"small",19,H),n()()(),r(54,"div",20)(55,"div",16)(56,"label",17),a(57,"Frequency"),n(),d(58,"p-select",27),n()(),r(59,"div",20)(60,"div",16)(61,"label",17),a(62,"Expense (Debit)"),n(),r(63,"p-select",28),h(64,Yt,6,2,"ng-template",null,3,x),n()(),r(66,"div"),$(67,Jt,2,1,"small",19,H),n()(),r(69,"div",20)(70,"div",16)(71,"label",17),a(72,"Payment (Credit)"),n(),r(73,"p-select",29),h(74,Qt,6,2,"ng-template",null,3,x),n()(),r(76,"div"),$(77,Zt,2,1,"small",19,H),n()(),r(79,"div",30)(80,"div",16)(81,"label",17),a(82,"Description"),n(),d(83,"textarea",31),n()()()()()()()()()()}if(t&2){let e,o,i,s,p=g(2);l(6),m("formGroup",p.recurringExpenseForm),l(6),m("ngClass",S(17,ae,p.isInvalid("name"))),l(2),W(p.getErrors("name")),l(7),m("options",(e=p.recurringExpenseData())==null||e.options==null?null:e.options.entities),l(8),m("showClear",!0)("ngClass",S(19,ae,p.isInvalid("contact")))("suggestions",p.customerSupplierSuggestions()),l(2),W(p.getErrors("contact")),l(6),m("iconDisplay","input")("showIcon",!0),l(5),m("iconDisplay","input")("showIcon",!0),l(8),m("ngClass",S(21,ae,p.isInvalid("amount")))("autoNumeric",Ve(23,Ht)),l(2),W(p.getErrors("amount")),l(6),m("options",(o=p.recurringExpenseData())==null||o.options==null?null:o.options.frequency),l(5),m("options",(i=p.recurringExpenseData())==null||i.options==null?null:i.options.expenses)("ngClass",S(24,ae,p.isInvalid("expenseAccountID"))),l(4),W(p.getErrors("expenseAccountID")),l(6),m("ngClass",S(26,ae,p.isInvalid("paymentAccountID")))("options",(s=p.recurringExpenseData())==null||s.options==null?null:s.options.assets),l(4),W(p.getErrors("paymentAccountID"))}}function tn(t,c){if(t&1&&h(0,en,84,28,"div",8),t&2){let e=g();m("ngIf",e.recurringExpenseData())}}var je=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.fb=u(Qe),this.destroyRef=u(Ge),this.route=u(de),this.recurringExpenseData=q(null),this.customerSupplierSuggestions=q([]),this.router=u(ge),this.contactType=new Xe(0),this.dayjsService=u(mt)}ngOnInit(){this.initializeForm(),this.fetchRecurringExpenseForm()}initializeForm(){this.recurringExpenseForm=this.fb.group({id:this.fb.control(""),name:this.fb.control("",[K.required]),repeatTypeID:this.fb.control(1,[K.required]),startDate:this.fb.control((0,Z.default)().toISOString()),endDate:this.fb.control(null),lastExpenseDate:this.fb.control(""),amount:this.fb.control(0,[K.required]),paymentAccountID:this.fb.control(null,[K.required]),expenseAccountID:this.fb.control(null,[K.required]),contact:this.fb.control("",[]),description:this.fb.control(""),repeatTypeLabel:this.fb.control(""),outletID:this.fb.control(""),creatorID:this.fb.control(""),created:this.fb.control(""),modifierID:this.fb.control(""),modified:this.fb.control("")})}fetchRecurringExpenseForm(){this.route.paramMap.pipe(G(e=>e.get("id")),O(e=>e?this.recurringExpenseService.fetchRecurringExpenseForm(e):this.recurringExpenseService.fetchRecurringExpenseForm()),T(e=>{this.recurringExpenseData.set(e),this.updateFormWithRecurringExpense(e.form)})).subscribe()}updateFormWithRecurringExpense(e){let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"startDate":i[s]=(0,Z.default)(p).isSame((0,Z.default)("0001-01-01T00:00:00"))?(0,Z.default)().toDate():(0,Z.default)(p).toDate();break;case"repeatTypeID":i[s]=1;break;case"contactID":i.contact=e.contactID?{Key:e.contactID,Value:e.contactName}:null;break;case"paymentAccountID":i[s]=p===re?null:p;break;case"expenseAccountID":i[s]=p===re?null:p;break;default:i[s]=p}return i},{});this.recurringExpenseForm.patchValue(o)}searchContact(e){this.recurringExpenseService.fetchSupplierSuggestion(e.query).pipe(T(this.customerSupplierSuggestions.set)).subscribe()}onSubmit(){let e=this.recurringExpenseForm.value;if(this.recurringExpenseForm.invalid){this.recurringExpenseForm.markAllAsTouched();return}let o=Object.entries(e).reduce((i,[s,p])=>{switch(s){case"amount":i[s]=+p;break;case"startDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"endDate":i[s]=p?this.dayjsService.from(p).format():null;break;case"contact":typeof p=="string"?i.contactID=p:typeof p=="object"&&p!==null?i.contactID=p&&Object.prototype.hasOwnProperty.call(p,"Key")?p.Key:p:i.contactID=re;break;default:i[s]=p;break}return i},{});this.recurringExpenseService.submitRecurringExpense(o).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}isInvalid(e){let o=this.recurringExpenseForm.controls[e];return o.invalid&&(o.dirty||o.touched)}getErrors(e){if(!this.isInvalid(e))return null;let o=this.recurringExpenseForm.controls[e];if(!o.errors)return null;let i=[];for(let[s,p]of Object.entries(o.errors))switch(s){case"required":i.push("This field is required.");break;case"minlength":i.push(`Minimum length is ${p.requiredLength} characters.`);break;case"maxlength":i.push(`Maximum length is ${p.requiredLength} characters.`);break;case"email":i.push("Please enter a valid email address.");break;case"pattern":i.push("The format is invalid.");break;case"min":i.push(`Minimum value is ${p.min}.`);break;case"max":i.push(`Maximum value is ${p.max}.`);break;default:i.push("Invalid value.")}return i}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-form",8,"page"]],attrs:Ut,decls:5,vars:2,consts:[["actionButton",""],["content",""],["outlet",""],["item",""],["pageTitle","Recurring Expense Form",3,"hasMainWrapperPadding","overflowScroll"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit","icon","fa-solid fa-plus",3,"click"],["class","row justify-content-center",4,"ngIf"],[1,"row","justify-content-center"],[1,"col-6"],[1,"h-100","d-flex"],[1,"row","justify-content-center","h-100"],[1,"col-12"],[1,"d-flex","flex-column","row-gap-2",3,"formGroup"],[1,"row","row-gap-2"],[1,"d-flex","flex-column"],["for",""],["formControlName","name","type","text","pInputText","",3,"ngClass"],[1,"text-danger"],[1,"col","col-lg-6"],["filter","","filterBy","name","appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["formControlName","contact","inputStyleClass","w-100","styleClass","w-100","optionLabel","Value","optionValue","Key",3,"completeMethod","showClear","ngClass","suggestions"],["dateFormat","mm/dd/yy","appendTo","body","formControlName","startDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],["appendTo","body","formControlName","endDate","styleClass","w-100","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"col"],["formControlName","amount","type","text","pInputText","",3,"ngClass","autoNumeric"],["appendTo","body","formControlName","repeatTypeID","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"options"],["appendTo","body","formControlName","expenseAccountID","optionLabel","value","optionValue","key","placeholder","Select Expense","filter","","filterBy","code,value",3,"options","ngClass"],["appendTo","body","formControlName","paymentAccountID","optionLabel","value","optionValue","key","filter","","filterBy","code,value","placeholder","Select Payment",3,"ngClass","options"],[1,"col","col-lg-12"],["formControlName","description","rows","3","cols","30","pTextarea",""],[1,"flex","items-center","gap-2"],[1,"text-truncate","d-inline-block",2,"max-width","250px"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,$t,4,2,"ng-template",null,0,x)(3,tn,1,1,"ng-template",null,1,x),n()),o&2&&m("hasMainWrapperPadding",!0)("overflowScroll",!0)},dependencies:[L,Q,Se,Ce,Pe,De,rt,it,gt,dt,st,pt,Re,ye,M,ze,P,be,he,xe,X,_e,Ee,ve,V,k,J,Y,ut,A,N,ot],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=["class","page"],rn=t=>["/pages/recurring/recurring-expense/edit",t];function on(t,c){if(t&1&&(r(0,"a",7),d(1,"i",8),r(2,"span"),a(3,"Edit"),n()()),t&2){let e=g(4);m("routerLink",S(1,rn,e.currentRecurringExpense().id))}}function an(t,c){if(t&1){let e=y();r(0,"p-button",9),R("onClick",function(){v(e);let i=g(4);return b(i.onDeleteRecurringExpense(i.currentRecurringExpense().id))}),n()}}function ln(t,c){if(t&1&&(r(0,"div",4),h(1,on,4,3,"a",5)(2,an,1,0,"p-button",6),n()),t&2){let e=g(3);l(),m("ngIf",e.roleService.setup.recurring),l(),m("ngIf",e.roleService.setup.recurring)}}function pn(t,c){if(t&1&&h(0,ln,3,2,"div",3),t&2){let e=g(2);m("ngIf",e.currentRecurringExpense())}}function sn(t,c){if(t&1){let e=y();r(0,"p-panel",13)(1,"p-scroll-panel")(2,"div",10)(3,"div",14)(4,"div",15)(5,"div",14)(6,"div",16)(7,"div",17)(8,"div",18)(9,"label",19),a(10,"Outlet"),n(),r(11,"input",20),ce("ngModelChange",function(i){v(e);let s=g(3);return se(s.currentRecurringExpense().outletName,i)||(s.currentRecurringExpense().outletName=i),b(i)}),n()()(),r(12,"div",17)(13,"div",18)(14,"label",19),a(15,"Supplier"),n(),d(16,"input",21),n()(),r(17,"div",17)(18,"div",18)(19,"label",19),a(20,"From"),n(),d(21,"input",22),C(22,"date"),n()(),r(23,"div",17)(24,"div",18)(25,"label",19),a(26,"To"),n(),d(27,"input",22),C(28,"date"),n()()(),d(29,"hr"),r(30,"div",16)(31,"div",17)(32,"div",18)(33,"label",19),a(34,"Amount"),n(),d(35,"input",22),C(36,"number"),n()(),r(37,"div",17)(38,"div",18)(39,"label",19),a(40,"Frequency"),n(),d(41,"input",22),n()(),r(42,"div",17)(43,"div",18)(44,"label",19),a(45,"Expense (Debit)"),n(),d(46,"input",22),n()(),r(47,"div",17)(48,"div",18)(49,"label",19),a(50,"Payment (Credit)"),n(),d(51,"input",22),n()(),r(52,"div",23)(53,"div",18)(54,"label",19),a(55,"Description"),n(),d(56,"textarea",24),n()()()()()()()()()}if(t&2){let e=g(3);l(11),pe("ngModel",e.currentRecurringExpense().outletName),l(5),m("value",e.currentRecurringExpense().contactName),l(5),m("value",U(22,9,e.currentRecurringExpense().startDate,"d MMM y")),l(6),m("value",U(28,12,e.currentRecurringExpense().endDate,"d MMM y")),l(8),m("value",F(36,15,e.currentRecurringExpense().amount)),l(6),m("value",e.currentRecurringExpense().repeatTypeLabel),l(5),m("value",e.currentRecurringExpense().expenseName),l(5),m("value",e.currentRecurringExpense().paymentName),l(5),m("value",e.currentRecurringExpense().description)}}function cn(t,c){if(t&1&&(r(0,"div",10)(1,"div",11),h(2,sn,57,17,"p-panel",12),n()()),t&2){let e=g(2);l(2),m("ngIf",e.currentRecurringExpense())}}function mn(t,c){if(t&1&&(r(0,"app-main-panel",2),h(1,pn,1,1,"ng-template",null,0,x)(3,cn,3,1,"ng-template",null,1,x),n()),t&2){let e=g();m("pageTitle",e.currentRecurringExpense().name+" Info")("hasMainWrapperPadding",!0)("overflowScroll",!0)}}var Et=(()=>{class t{constructor(){this.recurringExpenseService=u(B),this.route=u(de),this.router=u(ge),this.currentRecurringExpense=q(null),this.roleService=u(et)}ngOnInit(){this.route.paramMap.pipe(G(e=>e.get("id")),Ne("params"),qe(e=>this.recurringExpenseService.getRecurringExpenseByID(e)),T(e=>this.currentRecurringExpense.set(e)),Ne("recurringExpense")).subscribe()}onDeleteRecurringExpense(e){this.recurringExpenseService.removeRecurringExpense(e).pipe(T(()=>{this.router.navigate(["/pages/recurring/recurring-expense"])})).subscribe()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-recurring-expense-info",8,"page"]],attrs:nn,decls:1,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle","hasMainWrapperPadding","overflowScroll"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["class","p-button p-button-outlined p-button-secondary d-flex gap-2 align-items-center",3,"routerLink",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary","d-flex","gap-2","align-items-center",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],[1,"row","justify-content-center"],[1,"col-6"],["class","h-100 d-flex",4,"ngIf"],[1,"h-100","d-flex"],[1,"col"],[1,"row"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["readonly","","type","text","pInputText","",3,"ngModelChange","ngModel"],["type","text","readonly","","pInputText","",3,"value"],["readonly","","type","text","pInputText","",3,"value"],[1,"col","col-lg-12"],["readonly","","rows","5","cols","30","pTextarea","",3,"value"]],template:function(o,i){o&1&&h(0,mn,5,3,"app-main-panel",2),o&2&&$e(i.currentRecurringExpense()?0:-1)},dependencies:[L,Q,M,P,z,ue,Se,Ce,Ze,xe,X,Ye,J,Y,V,k,A,N,Re,ye],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var vt=[{path:"",redirectTo:"",pathMatch:"full"},{path:"",children:[{path:"",component:_t},{path:"create",component:je},{path:"details/:id",component:Et},{path:"edit/:id",component:je}]}];var bt=(()=>{class t{constructor(){this.httpService=u(fe)}getAssetValue(e){return this.httpService.post(void 0,"/api/AssetValue/GetList",e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var un={filter:{Text:"",Frequency:0,PageNumber:1,RowCount:10},data:null},Oe=Ie(Fe(un),Te(t=>{let c=u(bt);return{getAssetValue:ne(ee(O(o=>c.getAssetValue(o).pipe(ie({next:i=>{w(t,s=>_(f({},s),{data:i}))},error:i=>{console.error("Error fetching asset value:",i)}}))))),updateFilter:o=>{w(t,i=>_(f({},i),{filter:o}))}}}),we({onInit:t=>{t.getAssetValue(t.filter())}}));var dn=t=>["/pages/recurring/recurring-expense/details/",t];function gn(t,c){t&1&&d(0,"div",5)}function fn(t,c){t&1&&(r(0,"tr")(1,"th"),a(2,"Outlet"),n(),r(3,"th"),a(4,"Name"),n(),r(5,"th"),a(6,"Account Code"),n(),r(7,"th",8),a(8,"Price on Purchase"),n(),r(9,"th",8),a(10,"Accomulated Depreciation"),n(),r(11,"th",8),a(12,"Book Value"),n(),r(13,"th",8),a(14,"Frequency"),n()())}function xn(t,c){if(t&1&&(r(0,"tr")(1,"td"),a(2),n(),r(3,"td")(4,"a",9),a(5),n()(),r(6,"td"),a(7),n(),r(8,"td",8),a(9),C(10,"number"),n(),r(11,"td",8),a(12),C(13,"number"),n(),r(14,"td",8),a(15),C(16,"number"),n(),r(17,"td",8),a(18),C(19,"number"),n()()),t&2){let e=c.$implicit;l(2),E(e.entityName),l(2),m("routerLink",S(16,dn,e.id)),l(),E(e.name),l(2),E(e.accountCode),l(2),E(F(10,8,e.priceOnPurchase)),l(3),I(" ",F(13,10,e.accumulatedDepreciation)," "),l(3),I(" ",F(16,12,e.bookValue)," "),l(3),I(" ",F(19,14,e.depreciationPerYear)," ")}}function _n(t,c){if(t&1&&(r(0,"p-panel")(1,"p-table",7),h(2,fn,15,0,"ng-template",null,2,x)(4,xn,20,18,"ng-template",null,3,x),n()()),t&2){let e=g(2);l(),m("value",e.store.data().data)("rows",e.store.filter().RowCount)("totalRecords",e.store.data().count)}}function hn(t,c){if(t&1&&h(0,_n,6,3,"p-panel",6),t&2){let e=g();m("ngIf",e.store.data())}}var Ct=(()=>{class t{constructor(){this.store=u(Oe)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-asset-value"]],features:[me([Oe])],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Asset Value",3,"isSearchableInput","scrollable"],[1,"d-flex","gap-2"],[4,"ngIf"],["styleClass","h-100","dataKey","id",1,"",3,"value","rows","totalRecords"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"]],template:function(o,i){o&1&&(r(0,"app-main-panel",4),h(1,gn,1,0,"ng-template",null,0,x)(3,hn,1,1,"ng-template",null,1,x),n()),o&2&&m("isSearchableInput",!0)("scrollable",!0)},dependencies:[L,M,P,z,A,N,ke,Me,V,k],encapsulation:2})}}return t})();var dr=[{path:"",redirectTo:"recurring-expense",pathMatch:"full"},{path:"recurring-expense",children:vt},{path:"asset-value",component:Ct},{path:"post-to-journal",loadComponent:()=>import("./chunk-JTK43IPK.js").then(t=>t.PostRecurringExpenseComponent)}];export{dr as RECURRING_ROUTES};
package/chunk-XGCWDZO7.js DELETED
@@ -1 +0,0 @@
1
- import{a as ue}from"./chunk-WW5ELKKO.js";import{b as be}from"./chunk-Q23KXB3T.js";import"./chunk-C2GO6SPF.js";import{a as q,b as Q}from"./chunk-O4QM64EH.js";import{d as W,i as xe,j as he,k as X}from"./chunk-SVXDMOLP.js";import"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import{a as Ce}from"./chunk-XKCLERWG.js";import"./chunk-GDX5XEV3.js";import"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{b as ge}from"./chunk-4CDAAU6Z.js";import{h as K}from"./chunk-XZQ3IYQ6.js";import"./chunk-X22YKT5B.js";import{a as A,b as j}from"./chunk-JYCUE5HV.js";import{a as b,b as H,c as z,d as L,e as G,f as $}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{o as _e,w as V,x as F}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{x as fe}from"./chunk-G5S5AZA7.js";import{e as ce,l as me}from"./chunk-Z45NTTES.js";import{a as se}from"./chunk-4AOHMAEQ.js";import{a as de}from"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{k as re,p as le,q as D,r as N,y as pe}from"./chunk-OKCHQM5Q.js";import{Ac as ae,Cb as T,Jc as S,Kb as g,Kc as R,Lc as ie,Mc as _,Nb as I,Ub as a,Vb as i,Wb as J,X as M,Yc as w,Z as te,_b as U,ba as ne,c as k,cb as oe,dc as E,ec as s,gb as m,ha as u,pa as h,qa as C,qc as r,rc as f,s as ee,uc as B,wb as P,yc as O,zc as y}from"./chunk-JP6RBSB3.js";import{a as l,b as d}from"./chunk-YQFG5XE2.js";var v=(()=>{class e{constructor(){this.httpService=u(se)}getGenerateCoa(t){let n={params:new pe().set("PageNumber",t.PageNumber).set("RowCount",t.RowCount)};return this.httpService.get(void 0,"api/Tools/GetListCOA",n)}updateCOABalance(t={}){return this.httpService.put(void 0,"api/Tools/UpdateCOABalance",void 0,t)}getUnbalanceJournal(t){return this.httpService.get(void 0,"api/Tools/UnbalanceJurnal/"+t.PageNumber+"/"+t.RowCount)}updateUnbalanceJournal(t){let o={ListID:t};return this.httpService.put(void 0,"api/Tools/RegenerateUnBalanceJournal",o)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=ne({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Te={filter:{PageNumber:1,RowCount:20},data:{data:[],count:0}},Y=H($(Te),z(e=>({first:w(()=>(e.filter().PageNumber-1)*e.filter().RowCount+1),end:w(()=>Math.min(e.filter().PageNumber*e.filter().RowCount,e.data().count))})),G(e=>{let p=u(v);return{updateFilter:o=>{b(e,n=>d(l({},n),{filter:l(l({},n.filter),o)}))},getUpdateCOA:q(k(M(o=>p.getGenerateCoa(o).pipe(Q({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error(n)}})))))}}),L({onInit(e){e.getUpdateCOA(e.filter)}}));var ke=()=>({height:"calc(100vh - 70px)"}),Me=()=>({"min-width":"50rem"});function Pe(e,p){if(e&1){let t=U();a(0,"p-button",7),E("onClick",function(){h(t);let n=s();return C(n.updateCoaBalance())}),i()}}function Ie(e,p){e&1&&(a(0,"tr")(1,"th"),r(2,"Code"),i(),a(3,"th"),r(4,"Name"),i(),a(5,"th"),r(6,"Outlet"),i(),a(7,"th"),r(8,"COA Balance"),i(),a(9,"th"),r(10,"Correct Balance"),i()())}function Je(e,p){if(e&1&&(a(0,"tr")(1,"td"),r(2),i(),a(3,"td"),r(4),i(),a(5,"td"),r(6),i(),a(7,"td"),r(8),S(9,"number"),i(),a(10,"td"),r(11),S(12,"number"),i()()),e&2){let t=p.$implicit;m(2),f(t.Code),m(2),f(t.Name),m(2),f(t.OutletName),m(2),f(R(9,5,t.Balance)),m(3),f(R(12,7,t.CorrectBalance))}}function Be(e,p){if(e&1&&(a(0,"div",9)(1,"p",10),r(2),i()()),e&2){let t=s(2);m(2),B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Oe(e,p){e&1&&(a(0,"tr")(1,"td",11)(2,"span"),r(3,"No records found."),i()()())}function De(e,p){if(e&1){let t=U();a(0,"p-panel")(1,"p-table",8),E("onPage",function(n){h(t);let c=s();return C(c.onPageChange(n))}),T(2,Ie,11,0,"ng-template",null,2,_)(4,Je,13,9,"ng-template",null,3,_)(6,Be,3,3,"ng-template",null,4,_)(8,Oe,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(y(8,ke)),m(),g("paginator",!0)("lazy",!0)("totalRecords",t.store.data().count)("rows",t.store.filter().RowCount)("value",t.store.data().data)("tableStyle",y(9,Me))}}var we=(()=>{class e{constructor(){this.store=u(Y),this.coaService=u(v),this.toastrService=u(de)}onPageChange(t){this.store.updateFilter(d(l({},this.store.filter()),{PageNumber:Math.floor(t.first/t.rows)+1}))}updateCoaBalance(){this.coaService.updateCOABalance({observe:"response"}).pipe(Ce("Update COA Balance"),te(()=>{this.store.updateFilter(this.store.filter())})).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=P({type:e,selectors:[["app-tools-update-coa"]],features:[O([Y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Update COA Balance",3,"scrollable"],["label","Update",3,"onClick"],[3,"onPage","paginator","lazy","totalRecords","rows","value","tableStyle"],[1,"flex","align-items-center","custom-font-footer",2,"height","100%"],[1,"m-0"],["colspan","5"]],template:function(o,n){o&1&&(a(0,"app-main-panel",6),T(1,Pe,1,0,"ng-template",null,0,_)(3,De,10,10,"ng-template",null,1,_),i()),o&2&&g("scrollable",!0)},dependencies:[K,X,W,ge,N,D,F,V,j,A],styles:["[_nghost-%COMP%]{display:block} .p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit} .p-paginator .p-paginator-pages .p-paginator-page{font-size:14px}.custom-font-footer[_ngcontent-%COMP%]{font-size:.875rem}"],changeDetection:0})}}return e})();var Ne={data:{count:0,data:[]},filter:{PageNumber:1,RowCount:20}},Z=H($(Ne),z(e=>({first:w(()=>(e.filter().PageNumber-1)*e.filter().RowCount+1),end:w(()=>Math.min(e.filter().PageNumber*e.filter().RowCount,e.data().count)),selectedItems:w(()=>e.data().data.filter(p=>p.checked)),hasCheckedRows:w(()=>e.data().data.some(p=>p.checked))})),G(e=>{let p=u(v);return{updateFilter(o){b(e,n=>d(l({},n),{filter:l(l({},n.filter),o)}))},onRowSelect(o){b(e,n=>{let c=n.data.data.map(x=>x.id===o.id?d(l({},x),{checked:!0}):x);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onRowUnselect(o){b(e,n=>{let c=n.data.data.map(x=>x.id===o.id?d(l({},x),{checked:!1}):x);return d(l({},n),{data:d(l({},n.data),{data:c})})})},onHeaderCheckboxToggle(o){b(e,n=>{let c=n.data.data.map(x=>d(l({},x),{checked:o}));return d(l({},n),{data:d(l({},n.data),{data:c})})})},loadData:q(k(M(o=>p.getUnbalanceJournal(o).pipe(ee(n=>d(l({},n),{data:n.data.map(c=>d(l({},c),{checked:!1}))})),Q({next:n=>{b(e,c=>d(l({},c),{data:n}))},error:n=>{console.error("Error loading unbalance journal data:",n)}})))))}}),L(e=>({onInit:()=>{e.loadData(e.filter)}})));var Ve=()=>({height:"calc(100vh - 70px)"}),Fe=e=>["/pages/journal/journal-entry",e];function Ae(e,p){if(e&1){let t=U();a(0,"div",8),J(1,"p-button",9),a(2,"p-button",10),E("onClick",function(){h(t);let n=s(2);return C(n.regenerateUnbalanceJournal())}),r(3,"Regenerate"),i()()}}function je(e,p){if(e&1&&T(0,Ae,4,0,"div",7),e&2){let t=s();g("ngIf",t.store.hasCheckedRows())}}function He(e,p){e&1&&(a(0,"tr")(1,"th",12),J(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),r(4,"Date"),i(),a(5,"th"),r(6,"Number"),i(),a(7,"th",13),r(8,"Debit SUM"),i(),a(9,"th",13),r(10,"Credit SUM"),i(),a(11,"th",13),r(12,"Difference"),i(),a(13,"th"),r(14,"Reference"),i(),a(15,"th"),r(16,"Outlet"),i()())}function ze(e,p){if(e&1&&(a(0,"tr")(1,"td"),J(2,"p-tableCheckbox",14),i(),a(3,"td"),r(4),S(5,"date"),i(),a(6,"td")(7,"a",15),r(8),i()(),a(9,"td",13),r(10),S(11,"number"),i(),a(12,"td",13),r(13),S(14,"number"),i(),a(15,"td",13),r(16),S(17,"number"),i(),a(18,"td")(19,"a",16),r(20),i()(),a(21,"td"),r(22),i()()),e&2){let t=p.$implicit,o=s(2);m(2),g("value",t),m(2),f(ie(5,10,t.date,"dd MMM yyyy")),m(3),g("routerLink",ae(19,Fe,t.id)),m(),f(t.number),m(2),f(R(11,13,t.debitSum)),m(3),f(R(14,15,t.creditSum)),m(3),f(R(17,17,t.differences)),m(3),g("href",o.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+t.id,oe),m(),f(t.referenceText),m(2),f(t.outletName)}}function Le(e,p){if(e&1&&r(0),e&2){let t=s(2);B(" Showing ",t.store.first()," to ",t.store.end()," of ",t.store.data().count," entries ")}}function Ge(e,p){e&1&&(a(0,"tr")(1,"td",17)(2,"span"),r(3,"No records found."),i()()())}function $e(e,p){if(e&1){let t=U();a(0,"p-panel")(1,"p-table",11),E("onPage",function(n){h(t);let c=s();return C(c.onPageChange(n))})("onRowSelect",function(n){h(t);let c=s();return C(c.onRowSelect(n))})("onRowUnselect",function(n){h(t);let c=s();return C(c.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){h(t);let c=s();return C(c.onHeaderCheckboxToggle(n))}),T(2,He,17,0,"ng-template",null,2,_)(4,ze,23,21,"ng-template",null,3,_)(6,Le,1,3,"ng-template",null,4,_)(8,Ge,4,0,"ng-template",null,5,_),i()()}if(e&2){let t=s();I(y(7,Ve)),m(),g("value",t.store.data().data)("lazy",!0)("paginator",!0)("rows",t.store.filter().RowCount)("totalRecords",t.store.data().count)}}var ve=(()=>{class e{constructor(){this.store=u(Z),this.toolsService=u(v),this.authService=u(ue)}onPageChange(t){console.log("Page changed:",t);let o=t.first/t.rows;this.store.updateFilter({PageNumber:o+1})}onRowSelect(t){this.store.onRowSelect(t.data)}onRowUnselect(t){if(Array.isArray(t.data)){t.data.forEach(o=>{this.store.onRowUnselect(o)});return}else this.store.onRowUnselect(t.data)}onHeaderCheckboxToggle(t){this.store.onHeaderCheckboxToggle(t.checked)}regenerateUnbalanceJournal(){let o=this.store.selectedItems().filter(n=>n.checked==!0).map(n=>n.id);this.toolsService.updateUnbalanceJournal(o).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=P({type:e,selectors:[["app-unbalance-journal"]],features:[O([Z])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Unbalance Journal",3,"scrollable"],["class","d-flex gap-2",4,"ngIf"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger"],[3,"onClick"],["paginatorStyleClass","d-flex justify-content-end","dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],[2,"width","1rem"],[1,"text-end"],[3,"value"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","6"]],template:function(o,n){o&1&&(a(0,"app-main-panel",6),T(1,je,1,1,"ng-template",null,0,_)(3,$e,10,8,"ng-template",null,1,_),i()),o&2&&g("scrollable",!0)},dependencies:[K,X,W,xe,he,be,_e,N,re,D,le,fe,F,V,j,A,me,ce],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();var Qt=[{path:"",redirectTo:"generate-coa",pathMatch:"full"},{path:"generate-coa",component:we},{path:"unbalance-journal",component:ve}];export{Qt as TOOLS_ROUTES};
package/chunk-XO27WEAF.js DELETED
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-JOLNIJ36.js";import{a as He}from"./chunk-G4XX7EU2.js";import{a as Oe,b as Be}from"./chunk-AACWH3EJ.js";import{a as ze}from"./chunk-YPBGL37O.js";import{b as A}from"./chunk-SNKHWMQW.js";import{a as re}from"./chunk-WW5ELKKO.js";import"./chunk-FLZXCWDU.js";import{a as je}from"./chunk-XKI7WLHE.js";import"./chunk-DHW7UHFT.js";import"./chunk-C2GO6SPF.js";import{a as j,b as z}from"./chunk-O4QM64EH.js";import{d as Ne,i as ke,j as Me,k as Pe}from"./chunk-SVXDMOLP.js";import{a as Ae,b as De}from"./chunk-S6X7PJAB.js";import"./chunk-LWLJZPBI.js";import"./chunk-3NU3P6NL.js";import"./chunk-GDX5XEV3.js";import{a as Fe,b as Je}from"./chunk-DLUALPHU.js";import"./chunk-4DOELXOP.js";import"./chunk-VVUSFS6O.js";import"./chunk-ZTEDQLOG.js";import"./chunk-EDGADVEY.js";import"./chunk-JTDJJORR.js";import"./chunk-LZUGPBFD.js";import"./chunk-2KERKGCG.js";import{g as Ee,h as Ve}from"./chunk-XZQ3IYQ6.js";import{b as Ie,c as Te}from"./chunk-X22YKT5B.js";import{a as Ce,b as be}from"./chunk-JYCUE5HV.js";import{a as v,b as Se,c as we,d as ve,e as ye,f as Re}from"./chunk-JMEBBWX4.js";import"./chunk-FUZFAJGJ.js";import{n as _e,o as ge,w as he,x as xe}from"./chunk-5FSMHZSY.js";import"./chunk-A5HAJEPC.js";import{b as ae,c as le,e as me,f as pe,k as se,l as ce,o as de,u as ue,x as fe}from"./chunk-G5S5AZA7.js";import"./chunk-Z45NTTES.js";import"./chunk-4AOHMAEQ.js";import"./chunk-BLQJXMNV.js";import"./chunk-F2X3VGZZ.js";import{h as Z,j as ee,k as te,n as ie,p as ne,r as oe}from"./chunk-OKCHQM5Q.js";import{Ab as K,Ac as E,Cb as g,Ga as k,Jc as I,Kb as c,Kc as Y,Lc as V,Mc as w,Ub as r,Vb as o,Wb as b,X as N,Yc as T,Z as H,_b as y,bb as U,c as F,cb as L,dc as R,ec as _,gb as m,ha as C,pa as h,qa as x,qc as s,rc as S,s as J,sc as M,uc as W,vc as $,wb as G,wc as P,xc as q,yc as Q,zc as X}from"./chunk-JP6RBSB3.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var qe={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}},filter:{number:null,outletName:null,from:null,to:null,customerID:null,pageNumber:1,rowCount:20,pageSize:20,export:!1,exportPageNumber:1,exportRowCount:1e4,paymentState:0}},O=Se(Re(qe),we(t=>({first:T(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:T(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:T(()=>t.data().data.some(a=>a.checked)),checkedARCollection:T(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),ye(t=>{let a=C(D),e=C(A);return{updateFilter(n){v(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){v(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!0}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){v(t,i=>{let u=i.data.data.map(p=>p.id===n.id?f(d({},p),{checked:!1}):p);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){v(t,i=>{let u=i.data.data.map(p=>f(d({},p),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getARLoader:j(F(N(()=>a.getARJournalLoader().pipe(z({next:n=>{v(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AR collection loader:",n)}}))))),getARCollection:j(F(J(n=>Object.entries(n).reduce((i,[u,p])=>(p!=null&&(i[u]=p),i),{})),N(n=>a.getARJournal(n).pipe(J(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),z({next:i=>{v(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),ve(t=>({onInit:()=>{t.getARLoader(),t.getARCollection(t.filter)}})));var B=t=>({"ng-invalid ng-dirty":t}),Qe=()=>({});function Xe(t,a){if(t&1){let e=y();r(0,"p-button",10),R("onClick",function(){h(e);let n=_(2);return x(n.onCreateJournal())}),o()}}function Ye(t,a){if(t&1&&g(0,Xe,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function Ze(t,a){t&1&&(r(0,"tr")(1,"th",12),b(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Outlet"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Customer"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),b(17,"th",18),o())}function et(t,a){if(t&1&&(r(0,"tr")(1,"td"),b(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),b(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),b(21,"p-button",22),o()()),t&2){let e=a.$implicit,l=_(2);m(2),c("value",e),m(2),S(e.outlet),m(2),c("href",l.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Invoice/New_Join_Invoice/Info?ID="+e.id,L),m(),M(" ",e.number," "),m(2),S(e.customer),m(2),S(V(12,12,e.date,"d MMM y")),m(3),S(e.due?V(15,15,e.due,"d MMM y hh:mm"):"-"),m(3),c("innerHTML",e.note,U),m(2),S(e.payment),m(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function tt(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function it(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function nt(t,a){if(t&1){let e=y();r(0,"p-panel")(1,"p-table",11),R("onPage",function(n){h(e);let i=_();return x(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){h(e);let i=_();return x(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){h(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){h(e);let i=_();return x(i.onRowUnselect(n))}),g(2,Ze,18,0,"ng-template",null,3,w)(4,et,22,18,"ng-template",null,4,w)(6,tt,1,3,"ng-template",null,5,w)(8,it,4,0,"ng-template",null,6,w),o()()}if(t&2){let e=_();m(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function ot(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),m(),M(" ",V(2,2,e.name,30)," ")}}function rt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function at(t,a){if(t&1&&(r(0,"div"),g(1,rt,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("from"))}}function lt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function mt(t,a){if(t&1&&(r(0,"div"),g(1,lt,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("to"))}}function pt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;m(2),S(e)}}function st(t,a){if(t&1&&(r(0,"div"),g(1,pt,3,1,"div",35),o()),t&2){let e=_(2);m(),c("ngForOf",e.getErrors("pageSize"))}}function ct(t,a){if(t&1){let e=y();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Outlet"),o(),r(4,"p-select",27),g(5,ot,3,5,"ng-template",null,7,w),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),b(11,"p-datepicker",29),g(12,at,2,1,"div",30),b(13,"p-datepicker",31),g(14,mt,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Customer"),o(),r(18,"p-autocomplete",32),I(19,"async"),R("completeMethod",function(n){h(e);let i=_();return x(i.onSearchContact(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),b(23,"input",33),g(24,st,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),m(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),m(7),c("iconDisplay","input")("showIcon",!0)("ngClass",E(17,B,e.isInvalid("from"))),m(),c("ngIf",e.isInvalid("from")),m(),c("iconDisplay","input")("showIcon",!0)("ngClass",E(19,B,e.isInvalid("to"))),m(),c("ngIf",e.isInvalid("to")),m(4),c("suggestions",Y(19,15,e.customerSuggestions$)),m(5),c("autoNumeric",X(21,Qe))("ngClass",E(22,B,e.isInvalid("pageSize"))),m(),c("ngIf",e.isInvalid("pageSize"))}}var ti=(()=>{class t extends je{constructor(){super(),this.store=C(O),this.generateJournalService=C(D),this.authService=C(re),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=C(ue),this.dayjsService=C(A)}ngOnInit(){this.initForm()}initForm(){let{number:e,from:l,to:n,pageNumber:i,rowCount:u,pageSize:p,export:Ue,exportPageNumber:Le,exportRowCount:Ge,outletName:Ke,customerID:We,paymentState:$e}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),from:this.fb.control(this.dayjsService.from(l)?this.dayjsService.from(l).toDate():null),to:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),pageNumber:this.fb.control(i),rowCount:this.fb.control(u),pageSize:this.fb.control(p,[le.required]),export:this.fb.control(Ue),exportPageNumber:this.fb.control(Le),exportRowCount:this.fb.control(Ge),outletName:this.fb.control(Ke),customerID:this.fb.control(We),paymentState:this.fb.control($e)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((l,[n,i])=>{switch(n){case"customerID":i||(l[n]=He);break;case"from":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?l[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:l[n]=i!=null?String(i):null;break;default:l[n]=i===null?"":i;break}return l},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onSearchContact(e){this.customerSuggestions$=this.generateJournalService.getCustomerSuggestions(e.query)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e,pageNumber:1})),this.store.getARCollection(this.store.filter())}onPageChange(e){let l=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:l+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(l=>{this.store.onRowUnselect(l)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createARJournal(this.store.checkedARCollection()).pipe(H(()=>this.store.getARCollection(this.store.filter))).subscribe()}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ar-journal"]],features:[Q([O]),K],decls:8,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","AR Collection",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Outlet",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize",3,"autoNumeric","ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(l,n){if(l&1){let i=y();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(p){return h(i),P(n.isDialogFilterVisible,p)||(n.isDialogFilterVisible=p),x(p)})("isInitDialogFilterVisibleChange",function(p){return h(i),P(n.isInitDialogFilterVisible,p)||(n.isInitDialogFilterVisible=p),x(p)}),R("filterConfirmed",function(){return h(i),x(n.onFilterOKEvent())})("search",function(p){return h(i),x(n.onSearch(p))}),g(1,Ye,1,1,"ng-template",null,0,w)(3,nt,10,5,"ng-template",null,1,w),s(5," <"),g(6,ct,25,24,"ng-template",null,2,w),o()}l&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,oe,Z,ee,te,ie,ne,Pe,Ne,ke,Me,xe,he,be,Ce,fe,se,ae,me,pe,ce,de,Je,Fe,De,Ae,Be,Oe,ge,_e,Ee,Te,Ie,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{ti as ARJournalComponent};