dealposbooks 5.48.0 → 5.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/3rdpartylicenses.txt +5 -5
  2. package/assets/scss/layouts/_sidebar.scss +2 -1
  3. package/assets/scss/style.scss +10 -0
  4. package/chunk-2A5KXVYV.js +129 -0
  5. package/{chunk-DDM2KWNX.js → chunk-2LNMV22E.js} +1 -1
  6. package/chunk-2RHKXE62.js +1 -0
  7. package/chunk-2RKPDCYU.js +1 -0
  8. package/chunk-4KDA7ZRZ.js +1 -0
  9. package/chunk-4ZU2FOSO.js +1 -0
  10. package/chunk-5DRALZZF.js +1 -0
  11. package/chunk-5M5KVWZB.js +1 -0
  12. package/{chunk-SFMFIWMX.js → chunk-5YGRLXFR.js} +1 -1
  13. package/chunk-6RB67IF5.js +1 -0
  14. package/chunk-7HVUWEG2.js +1 -0
  15. package/chunk-A5Q65V4N.js +1 -0
  16. package/{chunk-W63NE6LU.js → chunk-ADODNO5M.js} +4 -4
  17. package/chunk-AJA5W4PQ.js +1 -0
  18. package/chunk-AOQH3HTB.js +1 -0
  19. package/chunk-BRKRIPYY.js +1 -0
  20. package/{chunk-NNNKDAA2.js → chunk-CAS5GLLU.js} +1 -1
  21. package/chunk-CLWQ53HX.js +1 -0
  22. package/{chunk-F6LZM7H5.js → chunk-DGACZ747.js} +1 -1
  23. package/{chunk-FSB3LHPU.js → chunk-EBEY2MBR.js} +1 -1
  24. package/{chunk-RXR5DXWS.js → chunk-ELMSU4U7.js} +1 -1
  25. package/chunk-ER5Y4FMF.js +1 -0
  26. package/chunk-ERG2YCYC.js +1 -0
  27. package/{chunk-VW2FJYIZ.js → chunk-ES2YST7G.js} +1 -1
  28. package/{chunk-LBREDZL5.js → chunk-FWAGEKIF.js} +1 -1
  29. package/{chunk-LXLOWSN6.js → chunk-HCJK6VTO.js} +1 -1
  30. package/chunk-HECYO7RI.js +1 -0
  31. package/chunk-IMQMRA4Y.js +1 -0
  32. package/chunk-IW7TNRJO.js +1 -0
  33. package/chunk-J3R2TUSM.js +1 -0
  34. package/{chunk-NPXVSAMB.js → chunk-JLFNJ2HH.js} +1 -1
  35. package/chunk-K4IULEBH.js +1 -0
  36. package/chunk-KSPR5HTA.js +130 -0
  37. package/chunk-L6PLE5U4.js +1 -0
  38. package/{chunk-EQTP2O7O.js → chunk-LOLOGGWA.js} +1 -1
  39. package/chunk-MV52MU2A.js +1 -0
  40. package/chunk-NMU2YBAB.js +1 -0
  41. package/{chunk-VKT27VPR.js → chunk-O3XDMCQO.js} +2 -2
  42. package/chunk-O54WM4PU.js +1 -0
  43. package/chunk-O7PTQ6FD.js +1 -0
  44. package/{chunk-2JNXKEYZ.js → chunk-OPSSYJMR.js} +1 -1
  45. package/chunk-OQRWMLXY.js +1 -0
  46. package/chunk-OZXIWJFE.js +1 -0
  47. package/{chunk-BG6BR7KI.js → chunk-PKO36DGM.js} +1 -1
  48. package/chunk-Q3HB53OC.js +1 -0
  49. package/{chunk-UEFTMQDF.js → chunk-Q4KG7LH6.js} +1 -1
  50. package/chunk-QJGYGXL3.js +202 -0
  51. package/chunk-STBJVKOH.js +7 -0
  52. package/{chunk-FUCKNGW4.js → chunk-SWU3XDYQ.js} +2 -2
  53. package/chunk-TFW2HBFA.js +1 -0
  54. package/chunk-TON77VSP.js +1 -0
  55. package/chunk-U57VXKUE.js +1 -0
  56. package/{chunk-CEK7MQW2.js → chunk-UHOHG6YG.js} +1 -1
  57. package/chunk-ULAE6ZMS.js +1 -0
  58. package/chunk-VCUOMA7I.js +1 -0
  59. package/{chunk-T367AQJ2.js → chunk-VKNINE5Q.js} +1 -1
  60. package/chunk-WDT3X7BX.js +1 -0
  61. package/chunk-WTU5HM6J.js +8 -0
  62. package/{chunk-FVYL3BQ7.js → chunk-WUMR7VK2.js} +1 -1
  63. package/{chunk-YPOBALKC.js → chunk-XLEICBBP.js} +1 -1
  64. package/chunk-XVAFZB6H.js +1 -0
  65. package/{chunk-ZQWFATZY.js → chunk-ZIZHSXQM.js} +1 -1
  66. package/chunk-ZXJEHHMR.js +1 -0
  67. package/index.html +2 -2
  68. package/main-P47IKABJ.js +1 -0
  69. package/package.json +1 -1
  70. package/{styles-4L5CAR46.css → styles-FYY2LVCE.css} +1 -1
  71. package/chunk-2H7KQZEC.js +0 -8
  72. package/chunk-3NWFEFT2.js +0 -1
  73. package/chunk-4LI7GDDM.js +0 -1
  74. package/chunk-5FV7K5RQ.js +0 -1
  75. package/chunk-6GQ4PTPT.js +0 -7
  76. package/chunk-7OP477BS.js +0 -1
  77. package/chunk-7WCUKMRG.js +0 -1
  78. package/chunk-ACDLAA4B.js +0 -1
  79. package/chunk-B3VZ2ZHJ.js +0 -1
  80. package/chunk-BNPR5SPH.js +0 -1
  81. package/chunk-CVDRHTES.js +0 -1
  82. package/chunk-CZSVRFCL.js +0 -1
  83. package/chunk-DSZOROE6.js +0 -1
  84. package/chunk-F3RSX7TC.js +0 -1
  85. package/chunk-G42V3ZZU.js +0 -1
  86. package/chunk-H7GQCGCR.js +0 -1
  87. package/chunk-IDHDHBFV.js +0 -202
  88. package/chunk-JE4XET33.js +0 -1
  89. package/chunk-LCKRY7CZ.js +0 -1
  90. package/chunk-O76TW6JA.js +0 -1
  91. package/chunk-OVDG3ZBT.js +0 -1
  92. package/chunk-PQL4GCC5.js +0 -1
  93. package/chunk-RE5GBQH6.js +0 -1
  94. package/chunk-S2BFXF7C.js +0 -1
  95. package/chunk-SUXEBUIX.js +0 -1
  96. package/chunk-SV6BE4HG.js +0 -130
  97. package/chunk-TOGXYKTE.js +0 -1
  98. package/chunk-UI2UMYSE.js +0 -1
  99. package/chunk-V22QPBAO.js +0 -1
  100. package/chunk-VVAI7ZGN.js +0 -1
  101. package/chunk-W5E37PZP.js +0 -1
  102. package/chunk-WKHQICFW.js +0 -1
  103. package/chunk-WOYTUHJD.js +0 -1
  104. package/chunk-WPJGKTVO.js +0 -129
  105. package/chunk-XCTUTMD3.js +0 -1
  106. package/chunk-XOSALV7T.js +0 -1
  107. package/chunk-Y7SF5NXD.js +0 -1
  108. package/main-XTOQBEFQ.js +0 -1
package/chunk-W5E37PZP.js DELETED
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-2JNXKEYZ.js";import{a as it}from"./chunk-G4XX7EU2.js";import{a as Pe}from"./chunk-KZHI6PGZ.js";import{a as Ue,b as He}from"./chunk-UVSR4LPB.js";import{a as te}from"./chunk-F3RSX7TC.js";import{b as N}from"./chunk-YPOBALKC.js";import{a as Me}from"./chunk-XKI7WLHE.js";import{a as Ge,b as Be}from"./chunk-VDXZGF3M.js";import"./chunk-MHRSQRHT.js";import"./chunk-U2VDC52W.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{d as ke,i as Je,j as Ne,k as Re}from"./chunk-F6LZM7H5.js";import{a as Ee,b as Te}from"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as Ve}from"./chunk-BT7Y4ADP.js";import"./chunk-T367AQJ2.js";import{a as Fe,b as De}from"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as Ie}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as _e,b as ge}from"./chunk-AD247LWQ.js";import{a as xe,b as y,c as Ce,d as be,e as ve,f as ye,g as we,h as tt}from"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{n as ce,o as de,w as ue,x as fe,y as he,z as Se}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import{b as ie,c as ne,e as oe,f as re,k as le,l as ae,o as pe,u as me,x as se}from"./chunk-VMI3QWC6.js";import"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{h as $,j as Q,k as X,n as et,p as Y,q as Z,s as ee}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Cb as L,Dc as q,Eb as g,Fc as V,Ha as k,Mb as s,Oc as w,Pc as P,Qc as F,Sc as b,Wb as l,Xb as o,Y as B,Yb as x,_ as G,ac as E,bd as I,c as R,eb as U,fc as T,gc as _,ia as v,ib as a,qa as h,ra as S,s as O,sc as m,tc as C,ua as Ze,uc as J,wc as A,xc as W,yb as H,yc as M,zc as K}from"./chunk-6QJHEOXN.js";import{a as c,b as d}from"./chunk-YQFG5XE2.js";var gt={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,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Ke=Ce(we(gt),be(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))})),ye(t=>{let p=v(D),e=v(N);return{updateFilter(n){y(t,i=>d(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!0}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!1}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(u=>d(c({},u),{checked:n}));return d(c({},i),{data:d(c({},i.data),{data:f})})})},getCustomerInvoice:z(R(O(n=>Object.entries(n).reduce((i,[f,u])=>(u!=null&&(i[f]=u),i),{})),B(n=>p.getJournalInvoice(n).pipe(O(i=>d(c({},i),{data:i.data.map(f=>d(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Ve("getCustomerInvoice"),j({next:i=>{y(t,f=>d(c({},f),{data:d(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(R(B(()=>p.getJournalInvoiceLoader().pipe(j({next:n=>{y(t,i=>d(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),ve(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var qe=t=>({"ng-invalid ng-dirty":t});function xt(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 Ct(t,p){if(t&1&&g(0,xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function bt(t,p){t&1&&(l(0,"tr")(1,"th",12),x(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(),x(19,"th",18),o())}function vt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(21,"p-chip",21),o(),l(22,"td"),x(23,"p-chip",21),o(),l(24,"td"),x(25,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),C(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),J(" ",e.number," "),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),J(" ",e.customer," "),a(2),C(F(13,14,e.date,"d MMM y hh:mm")),a(3),C(e.due?F(16,17,e.due,"d MMM y hh:mm"):"-"),a(3),C(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 yt(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function wt(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function It(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,bt,20,0,"ng-template",null,3,b)(4,vt,26,22,"ng-template",null,4,b)(6,yt,1,3,"ng-template",null,5,b)(8,wt,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 Et(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(),J(" ",F(2,2,e.name,30)," ")}}function Tt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Vt(t,p){if(t&1&&(l(0,"div"),g(1,Tt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Ft(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Dt(t,p){if(t&1&&(l(0,"div"),g(1,Ft,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Jt(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("pageSize"))}}function Nt(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,Et,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Vt,2,1,"div",32),x(21,"p-datepicker",33),g(22,Dt,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(),x(30,"input",35),g(31,Jt,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",V(16,qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(18,qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",V(20,qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ut=(()=>{class t extends Me{constructor(){super(...arguments),this.store=v(Ke),this.dayjsService=v(N),this.generateJournalService=v(D),this.authService=v(te),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.customerSuggestions=k([]),this.fb=v(me)}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:u,customerID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=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(u)?this.dayjsService.from(u).toDate():null),customerID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Ve("Customer Suggestions"),G(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(d(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(d(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]=it);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=Ze(t)))(n||t)}})()}static{this.\u0275cmp=H({type:t,selectors:[["app-customer-invoice"]],features:[q([Ke]),L],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","appMaskNumber","",3,"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(u){return h(i),M(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),M(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,Ct,1,1,"ng-template",null,0,b)(3,It,10,5,"ng-template",null,1,b)(5,Nt,32,22,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,de,ce,He,Ue,se,le,ie,oe,re,ae,pe,Se,he,xe,Pe],encapsulation:2,changeDetection:0})}}return t})();var Rt={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,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4},skipRequestFirst:!0},$e=Ce(tt("JournalSupplierBillStore"),we(Rt),be(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))})),ye(t=>{let p=v(D),e=v(N);return{updateFilter(r){y(t,n=>d(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?d(c({},f),{checked:!0}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?d(c({},f),{checked:!1}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>d(c({},f),{checked:r}));return d(c({},n),{data:d(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(R(B(()=>p.getGJSupplierBillLoader().pipe(j({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>d(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(R(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),B(r=>p.getJournalSupplierBill(r).pipe(O(n=>d(c({},n),{data:n.data.map(i=>d(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),j({next:n=>{y(t,i=>d(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),ve(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Qe=t=>({"ng-invalid ng-dirty":t});function Bt(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 Mt(t,p){if(t&1&&g(0,Bt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Pt(t,p){t&1&&(l(0,"tr")(1,"th",12),x(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(),x(19,"th",18),o())}function zt(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(20,"p-chip",21),o(),l(21,"td"),x(22,"p-chip",21),o(),l(23,"td"),x(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),C(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),J(" ",e.number," "),a(2),C(e.customer),a(2),C(F(12,13,e.date,"d MMM y hh:mm")),a(3),C(e.due?F(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),C(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 jt(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ot(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Gt(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,Pt,20,0,"ng-template",null,3,b)(4,zt,25,21,"ng-template",null,4,b)(6,jt,1,3,"ng-template",null,5,b)(8,Ot,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 Ut(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(),J(" ",F(2,2,e.name,30)," ")}}function Ht(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Lt(t,p){if(t&1&&(l(0,"div"),g(1,Ht,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function At(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Wt(t,p){if(t&1&&(l(0,"div"),g(1,At,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(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("pageSize"))}}function $t(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,Ut,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),x(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),x(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),x(19,"p-datepicker",31),g(20,Lt,2,1,"div",32),x(21,"p-datepicker",33),g(22,Wt,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(),x(31,"input",35),g(32,qt,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",V(18,Qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(20,Qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",P(27,16,e.supplierSuggestions$)),a(5),s("ngClass",V(22,Qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ft=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v($e),this.authService=v(te),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(me),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(Ve("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:u,supplierID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=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(u),supplierID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}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(d(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([$e]),L],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","","appMaskNumber","","formControlName","pageSize",3,"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(u){return h(i),M(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),M(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,Mt,1,1,"ng-template",null,0,b)(3,Gt,10,5,"ng-template",null,1,b)(5,$t,33,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:[Ie,Re,ke,Je,Ne,ee,$,Q,X,et,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,He,Ue,se,le,ie,oe,re,ae,pe,de,ce,xe,Se,he,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Xe=Ce(we(Qt),be(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))})),ye(t=>{let p=v(D);return{updateFilter(e){y(t,r=>d(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!0}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!1}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>d(c({},i),{checked:e}));return d(c({},r),{data:d(c({},r.data),{data:n})})})},getGJShiftLoader:z(R(B(()=>p.getGJShiftLoader().pipe(j(e=>y(t,r=>d(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(R(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),B(e=>p.getJournalShift(e).pipe(j(r=>y(t,n=>d(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),ve(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var Ye=t=>({"ng-invalid ng-dirty":t});function Xt(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,Xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Zt(t,p){t&1&&(l(0,"tr")(1,"th",12),x(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(),x(21,"th",18),o())}function ei(t,p){if(t&1&&(l(0,"tr")(1,"td"),x(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"),x(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(),J(" ",e.number," "),a(2),C(F(8,14,e.open,"dd MMM y hh:mm")),a(3),C(F(11,17,e.close,"dd MMM y hh:mm")),a(3),C(e.cashier),a(2),C(P(16,20,e.salesNTax)),a(3),C(P(19,22,e.totalInvoice)),a(3),C(e.outlet),a(2),C(e.register),a(2),C(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 ti(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ii(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ni(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,Zt,22,0,"ng-template",null,3,b)(4,ei,29,26,"ng-template",null,4,b)(6,ti,1,3,"ng-template",null,5,b)(8,ii,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 oi(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(),J(" ",F(2,2,e.name,30)," ")}}function ri(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function li(t,p){if(t&1&&(l(0,"div"),g(1,ri,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function ai(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function pi(t,p){if(t&1&&(l(0,"div"),g(1,ai,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function mi(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function si(t,p){if(t&1&&(l(0,"div"),g(1,mi,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ci(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,oi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),x(11,"p-datepicker",28),g(12,li,2,1,"div",29),x(13,"p-datepicker",30),g(14,pi,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),x(18,"input",31),g(19,si,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",V(13,Ye,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(15,Ye,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("ngClass",V(17,Ye,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Xe),this.authService=v(te),this.isDialogFilterVisible=k(!1),this.isInitDialogFilterVisible=k(!1),this.fb=v(me),this.dayjsService=v(N)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,pageSize:u,export:ze,exportPageNumber:je,exportPageSize:Oe}=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),pageSize:this.fb.control(u,[ne.required]),export:this.fb.control(ze),exportPageNumber:this.fb.control(je),exportPageSize:this.fb.control(Oe)})}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(d(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-shift"]],features:[q([Xe]),L],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","appMaskNumber","",3,"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(u){return h(i),M(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),S(u)})("isInitDialogFilterVisibleChange",function(u){return h(i),M(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),S(u)}),T("filterConfirmed",function(){return h(i),S(n.onFilterOKEvent())})("search",function(u){return h(i),S(n.onSearch(u))}),g(1,Yt,1,1,"ng-template",null,0,b)(3,ni,10,5,"ng-template",null,1,b)(5,ci,20,19,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,ge,_e,fe,ue,se,le,ie,oe,re,ae,pe,De,Fe,Te,Ee,xe,Se,he,de,ce,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var fo=[{path:"invoice",component:ut},{path:"supplier-bill",component:ft},{path:"shift",component:_t},{path:"join-invoice",loadComponent:()=>import("./chunk-SUXEBUIX.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-Y7SF5NXD.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-5FV7K5RQ.js").then(t=>t.AdjustmentJournalComponent)}];export{fo as generateJournalRoutes};
package/chunk-WKHQICFW.js DELETED
@@ -1 +0,0 @@
1
- import{a as X}from"./chunk-UEFTMQDF.js";import{d as q,i as K,j as G,k as Q}from"./chunk-F6LZM7H5.js";import"./chunk-FSB3LHPU.js";import"./chunk-AMGBUOC4.js";import"./chunk-UPSNJEHO.js";import{a as W}from"./chunk-BT7Y4ADP.js";import"./chunk-T367AQJ2.js";import"./chunk-AN4SAUSA.js";import"./chunk-URH77XNK.js";import"./chunk-E7QWESN4.js";import"./chunk-3DBSHDAQ.js";import"./chunk-PPXXWO4E.js";import"./chunk-M4SSELXT.js";import"./chunk-WMZF4DQK.js";import"./chunk-QPPFPDWZ.js";import{i as O}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as B}from"./chunk-ME4ALIS7.js";import{a as N,b as U}from"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import{e as L}from"./chunk-F7PVAVLQ.js";import"./chunk-DSZOROE6.js";import"./chunk-2BI7WNJP.js";import{k as I}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Eb as h,Fc as A,Ha as b,L as R,Mb as d,Rb as v,Sc as _,Wb as i,Xb as o,Y as J,Yb as w,_ as k,ac as T,bd as S,cd as H,fc as x,gc as r,ia as D,ib as f,qa as m,ra as c,s as j,sc as u,tc as V,wc as F,xc as M,yb as E,yc as z,zc as P}from"./chunk-6QJHEOXN.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0)}}function re(t,p){if(t&1&&h(0,le,9,6,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(W("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows","scrollable"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,Q,q,K,G,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
package/chunk-WOYTUHJD.js DELETED
@@ -1 +0,0 @@
1
- import{a as x,b as L}from"./chunk-ZQWFATZY.js";import"./chunk-YPOBALKC.js";import{a as E,b as O}from"./chunk-DJXQKSLT.js";import"./chunk-WXIG4CXY.js";import{i as H}from"./chunk-W63NE6LU.js";import"./chunk-S27Z7D3D.js";import{a as R,b as D}from"./chunk-AD247LWQ.js";import"./chunk-BKTBVFNX.js";import"./chunk-ZFNIPERQ.js";import{w as V,x as j,y as N,z as G}from"./chunk-ME4ALIS7.js";import"./chunk-DTYVTTET.js";import"./chunk-VMI3QWC6.js";import"./chunk-DSZOROE6.js";import{a as I}from"./chunk-2BI7WNJP.js";import{n as A,s as F}from"./chunk-ZK43JB4A.js";import"./chunk-F2X3VGZZ.js";import{Dc as $,Eb as P,Ec as h,Mb as p,Oc as l,Pb as d,Pc as m,Sc as _,W as T,Wb as o,Xb as n,Y as M,Yb as c,_ as S,ac as w,fc as y,gc as s,h as v,ia as u,ib as a,qa as f,ra as C,s as g,sa as b,ta as k,yb as B}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=w();o(0,"div",3)(1,"p-button",4),y("onClick",function(){f(e);let r=s();return C(r.onFormatCOACategory())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),y("onClick",function(){f(e);let r=s();return C(r.onMigrateCoaCategory())}),n()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),l(4,"async"),b(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),l(8,"async"),n()()()),i&2){let e=s();d(h(12,q)),a(),d(h(13,q)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=u(x),this.toastr=u(I),this.refresh$=new v(void 0),this.pageTitle="Chart of Account Category"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOACategoryCount()),S(t=>console.log("API response:",t)),T(1));this.countInPOS$=e.pipe(g(t=>Number(t.pos))),this.countInBooks$=e.pipe(g(t=>Number(t.books)))}onMigrateCoaCategory(){this.migrateService.migrateCoaCategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOACategory(){confirm("Are you sure you want to format?")&&this.migrateService.formatManualCOACategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-coa-configuration"]],features:[$([x])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),P(1,J,5,6,"ng-template",null,0,_)(3,K,9,14,"ng-template",null,1,_),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaCategoryComponent};