dealpos 26.30.2 → 26.30.3

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 (110) hide show
  1. package/browser/{chunk-C3NKDRGQ.js → chunk-24YLKMEJ.js} +1 -1
  2. package/browser/{chunk-JUGPWQZ6.js → chunk-267KXOLJ.js} +1 -1
  3. package/browser/{chunk-XEJHOUOQ.js → chunk-2AW77P5H.js} +1 -1
  4. package/browser/{chunk-T5CUDSUR.js → chunk-2HN5GR2B.js} +1 -1
  5. package/browser/{chunk-BNXRS5LX.js → chunk-3FFHADFC.js} +1 -1
  6. package/browser/{chunk-AMCUQIRG.js → chunk-3N4VJXET.js} +2 -2
  7. package/browser/{chunk-HCD7JJ5J.js → chunk-3SJFBB7T.js} +2 -2
  8. package/browser/{chunk-K4RIGD6R.js → chunk-3Z7HLWOO.js} +1 -1
  9. package/browser/{chunk-XWX5WQ55.js → chunk-4JAMO4DO.js} +1 -1
  10. package/browser/{chunk-FL6U6VZX.js → chunk-4XSFWZ7K.js} +1 -1
  11. package/browser/{chunk-WUOM4FCM.js → chunk-4ZS5NPJA.js} +1 -1
  12. package/browser/{chunk-OLZYUESE.js → chunk-5D2W2SP5.js} +1 -1
  13. package/browser/{chunk-PXSDWGC7.js → chunk-5TCU5VOU.js} +1 -1
  14. package/browser/{chunk-YXYVT5C5.js → chunk-63NBDUGE.js} +1 -1
  15. package/browser/{chunk-OQ4BOSRX.js → chunk-6QO26KHZ.js} +1 -1
  16. package/browser/{chunk-DJLA7A24.js → chunk-6ZV2PHVD.js} +1 -1
  17. package/browser/{chunk-OTVGF2KS.js → chunk-7N6KQX2C.js} +1 -1
  18. package/browser/{chunk-TZRE4VFN.js → chunk-7QR74VBK.js} +1 -1
  19. package/browser/{chunk-ZQLBTGGX.js → chunk-ADCYV4TJ.js} +1 -1
  20. package/browser/{chunk-EKOSQTSC.js → chunk-AHCUPROT.js} +1 -1
  21. package/browser/{chunk-334BLSO3.js → chunk-AQSP7KZF.js} +1 -1
  22. package/browser/{chunk-2TBXAN55.js → chunk-AUDHO5BS.js} +1 -1
  23. package/browser/{chunk-3RH77W4O.js → chunk-BBDLBM57.js} +1 -1
  24. package/browser/{chunk-XYB4O24J.js → chunk-BJBRXOGP.js} +1 -1
  25. package/browser/{chunk-BS4OGNQO.js → chunk-BLQ56J33.js} +1 -1
  26. package/browser/{chunk-DKSFKRM5.js → chunk-BM54M3ZV.js} +1 -1
  27. package/browser/{chunk-B5R4ZCHU.js → chunk-BML2AY2C.js} +1 -1
  28. package/browser/{chunk-6OWKCBDH.js → chunk-BUCTARFG.js} +1 -1
  29. package/browser/{chunk-HNGZDBU6.js → chunk-BXF5MZD5.js} +1 -1
  30. package/browser/{chunk-FOUWAORD.js → chunk-C62BA3B5.js} +1 -1
  31. package/browser/{chunk-F4W5CESZ.js → chunk-CCIW6FD2.js} +2 -2
  32. package/browser/{chunk-PASQXKVH.js → chunk-CFCLB4UL.js} +1 -1
  33. package/browser/{chunk-FHIT2XET.js → chunk-D44RJQYD.js} +1 -1
  34. package/browser/{chunk-PYCGJENT.js → chunk-DC4EEAY2.js} +1 -1
  35. package/browser/{chunk-O67QT5HL.js → chunk-DNYF7RWP.js} +1 -1
  36. package/browser/{chunk-EACUTSGK.js → chunk-EHBSNGFA.js} +1 -1
  37. package/browser/{chunk-WTZ4VHUA.js → chunk-EY3OGCXT.js} +1 -1
  38. package/browser/{chunk-O4HDDCOT.js → chunk-F7VCZNZA.js} +1 -1
  39. package/browser/{chunk-2PSREPC4.js → chunk-FI7CDHP2.js} +1 -1
  40. package/browser/{chunk-HV3UEHSY.js → chunk-FPHH3KEE.js} +1 -1
  41. package/browser/{chunk-DHMQXC66.js → chunk-G2B2G6M2.js} +1 -1
  42. package/browser/{chunk-CFJFTDL6.js → chunk-G2L3TRZ4.js} +1 -1
  43. package/browser/{chunk-URBJVT2R.js → chunk-GDMVDLQL.js} +1 -1
  44. package/browser/{chunk-TLYKJRMB.js → chunk-GG5OI4YH.js} +1 -1
  45. package/browser/{chunk-CQJUAI4B.js → chunk-GTOCPV7W.js} +1 -1
  46. package/browser/{chunk-CO654T7R.js → chunk-GXHORCDU.js} +1 -1
  47. package/browser/{chunk-SXGJPOFD.js → chunk-I5JH4FHZ.js} +1 -1
  48. package/browser/{chunk-HFBLFS5K.js → chunk-IIARVTAV.js} +1 -1
  49. package/browser/{chunk-2XYYCXF6.js → chunk-ILBK4QJU.js} +1 -1
  50. package/browser/{chunk-6NVIYICR.js → chunk-INWOK4UB.js} +1 -1
  51. package/browser/{chunk-ZZS7FKWF.js → chunk-JDGHR27I.js} +1 -1
  52. package/browser/{chunk-TPIJSMHK.js → chunk-JG644ODH.js} +1 -1
  53. package/browser/{chunk-W456MWEG.js → chunk-JLSA27FL.js} +1 -1
  54. package/browser/{chunk-C3XZULLG.js → chunk-JUW73YUO.js} +1 -1
  55. package/browser/{chunk-FRCAWQHL.js → chunk-KYQBB6FB.js} +1 -1
  56. package/browser/{chunk-GHROV7YY.js → chunk-LBMNHT4D.js} +1 -1
  57. package/browser/{chunk-M37N6JER.js → chunk-LPX5PQK3.js} +1 -1
  58. package/browser/{chunk-HSLEEHGI.js → chunk-LYSVMNCT.js} +1 -1
  59. package/browser/{chunk-4O7EXN5A.js → chunk-M2XJN3EA.js} +1 -1
  60. package/browser/{chunk-UW64P7MY.js → chunk-M3YZKABE.js} +1 -1
  61. package/browser/{chunk-NMVNBIUG.js → chunk-M65CFXIN.js} +2 -2
  62. package/browser/{chunk-JRLEZEYA.js → chunk-NNN6BME2.js} +1 -1
  63. package/browser/{chunk-YTVCWA6C.js → chunk-NTNQHEGU.js} +1 -1
  64. package/browser/{chunk-UXFWRBCB.js → chunk-NVSZUDQ3.js} +1 -1
  65. package/browser/{chunk-XPHHU5XT.js → chunk-OJ7VTWPV.js} +1 -1
  66. package/browser/{chunk-JFVKHXLA.js → chunk-OQL3WWEJ.js} +1 -1
  67. package/browser/{chunk-TXGL6RSU.js → chunk-P3Y5AQLZ.js} +1 -1
  68. package/browser/{chunk-KCLXYRDQ.js → chunk-PW3MBJLX.js} +1 -1
  69. package/browser/{chunk-V2PNVAWR.js → chunk-QHOC7DPY.js} +1 -1
  70. package/browser/{chunk-OJRZBKKH.js → chunk-QKLRCAYM.js} +2 -1
  71. package/browser/{chunk-TXYY7NFW.js → chunk-QMWH3WHD.js} +2 -2
  72. package/browser/{chunk-XLHPC77G.js → chunk-R4ZDB744.js} +1 -1
  73. package/browser/{chunk-WNFHW2AY.js → chunk-RCBOZX2E.js} +1 -1
  74. package/browser/{chunk-7PNNJEWM.js → chunk-RDURQRVN.js} +1 -1
  75. package/browser/{chunk-A44IGHZE.js → chunk-RIYY3QQM.js} +1 -1
  76. package/browser/{chunk-3PBPXKUX.js → chunk-RJDXGATF.js} +1 -1
  77. package/browser/{chunk-6HOI2DZC.js → chunk-RLLTMUIE.js} +1 -1
  78. package/browser/{chunk-HVTVTW4L.js → chunk-RXTLYS3E.js} +1 -1
  79. package/browser/{chunk-ORP6ORNF.js → chunk-SK7ARU4O.js} +1 -1
  80. package/browser/{chunk-PT4JSUZS.js → chunk-SXIGGHCM.js} +2 -2
  81. package/browser/{chunk-UMZLK4TK.js → chunk-T5POZFJR.js} +1 -1
  82. package/browser/{chunk-HGM4ALOK.js → chunk-TS3T4RUV.js} +1 -1
  83. package/browser/{chunk-SQIG4R6F.js → chunk-TU65CJU6.js} +1 -1
  84. package/browser/chunk-TWKXHHO2.js +1 -0
  85. package/browser/{chunk-W5WO4T6I.js → chunk-TXTMOYXQ.js} +1 -1
  86. package/browser/{chunk-ZFRAXSXE.js → chunk-TYA4ZZGP.js} +1 -1
  87. package/browser/{chunk-LPQT42CQ.js → chunk-TYDYN2JU.js} +1 -1
  88. package/browser/{chunk-WWPDXHL2.js → chunk-U7YB5QYB.js} +1 -1
  89. package/browser/{chunk-LAVXD6Q2.js → chunk-UO6VYPQB.js} +1 -1
  90. package/browser/{chunk-IO5KIVH5.js → chunk-UQWOSVAY.js} +2 -2
  91. package/browser/{chunk-EU43KDPC.js → chunk-US4LHROB.js} +1 -1
  92. package/browser/{chunk-OZ4PXQO2.js → chunk-USXXWE3L.js} +1 -1
  93. package/browser/{chunk-WKOGLKPE.js → chunk-VG7AM63M.js} +1 -1
  94. package/browser/{chunk-LGWLN7QT.js → chunk-W33LB7GX.js} +1 -1
  95. package/browser/{chunk-U6EYZAB6.js → chunk-WBUZCVFS.js} +1 -1
  96. package/browser/{chunk-H35DD76P.js → chunk-WE7MAWON.js} +1 -1
  97. package/browser/{chunk-ECBFGU72.js → chunk-WF4CWM6A.js} +1 -1
  98. package/browser/{chunk-ZP376MYF.js → chunk-WYDVIMXE.js} +1 -1
  99. package/browser/{chunk-PPY57HD2.js → chunk-XDXFOB74.js} +1 -1
  100. package/browser/{chunk-LIB4SWU2.js → chunk-XGLKE2VY.js} +1 -1
  101. package/browser/{chunk-YN5IOBGZ.js → chunk-XOYAX2XN.js} +1 -1
  102. package/browser/{chunk-SJAVIF7S.js → chunk-YZJ46NPL.js} +1 -1
  103. package/browser/{chunk-L66LD6K4.js → chunk-ZBXFSNXW.js} +1 -1
  104. package/browser/{chunk-JMOEFRQU.js → chunk-ZG7JV4Z6.js} +1 -1
  105. package/browser/{chunk-4FTDSQIR.js → chunk-ZQVSSHSG.js} +1 -1
  106. package/browser/{chunk-CS4ERLDD.js → chunk-ZWRKBAF7.js} +1 -1
  107. package/browser/index.html +2 -2
  108. package/browser/{main-5TTEWE7J.js → main-KDGMS2WN.js} +1 -1
  109. package/package.json +1 -1
  110. package/browser/chunk-CTXVEOZD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as se}from"./chunk-EU43KDPC.js";import{a as _t}from"./chunk-JI7J6USO.js";import{a as kt,b as ce}from"./chunk-KIONH5BK.js";import{b as wt,c as St,f as Vt}from"./chunk-SXGJPOFD.js";import{a as re,b as le}from"./chunk-Z7UCI72M.js";import{N as xt,n as yt}from"./chunk-7OCVKGLK.js";import{c as vt}from"./chunk-LCBHD53Y.js";import{b as Tt,c as Mt,f as pe}from"./chunk-C6TJ57ES.js";import{a as Ge}from"./chunk-VUC4E73K.js";import{u as Ct}from"./chunk-OTSIIVCA.js";import{d as bt}from"./chunk-R7VXUOCU.js";import{B as lt,Ca as mt,Da as ft,Fa as gt,G as oe,Ga as ht,Ha as j,N as st,X as ve,ca as ct,da as pt,oa as dt,ra as ut,s as rt,sa as ae}from"./chunk-NYN3E7NN.js";import{E as ie,c as et,h as te,i as tt,k as nt,o as ne,p as it}from"./chunk-R36OIJC7.js";import{a as Je,c as at}from"./chunk-A44IGHZE.js";import{a as ot}from"./chunk-LIB4SWU2.js";import{a as Xe}from"./chunk-PPTZHIIZ.js";import{$ as Ve,$a as y,$c as ze,Ab as V,Ba as De,Bb as k,Cb as T,Da as ge,Db as g,Eb as r,Fa as he,Fb as l,Fc as Y,Gb as h,Gc as Ne,Hc as Re,M as fe,Oc as Ce,Pb as b,Qd as Ze,Rd as qe,Sb as f,Sc as He,Sd as Ye,Ta as Ie,Tc as w,Ua as s,Ub as c,Uc as G,Vb as U,Wb as M,Xb as Z,Xc as je,Zb as D,_b as I,ac as Oe,ad as X,ba as ke,bc as Ke,bd as Qe,d as we,db as K,eb as $,ec as R,fc as Le,gb as Ee,gc as _e,hb as Fe,hc as _,ib as Pe,ic as L,id as We,ja as B,jb as be,jc as A,ka as W,la as Te,mc as E,md as $e,na as O,nc as F,nd as Ue,oc as P,r as Se,ra as p,sa as d,sb as Be,sc as H,vd as J,wb as u,wc as Ae,wd as ee,xc as q,ya as v,yb as m,yc as x,za as Me}from"./chunk-DUSKF5IQ.js";import{a as S,b as Q}from"./chunk-NF7PG5F2.js";var de=class t{_openDialog=new we;openDialog$=this._openDialog.asObservable();openDialog(o){this._openDialog.next(o??{})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=B({token:t,factory:t.\u0275fac,providedIn:"root"})};var Dt=`
1
+ import{a as se}from"./chunk-US4LHROB.js";import{a as _t}from"./chunk-JI7J6USO.js";import{a as kt,b as ce}from"./chunk-KIONH5BK.js";import{b as wt,c as St,f as Vt}from"./chunk-I5JH4FHZ.js";import{a as re,b as le}from"./chunk-Z7UCI72M.js";import{N as xt,n as yt}from"./chunk-7OCVKGLK.js";import{c as vt}from"./chunk-LCBHD53Y.js";import{b as Tt,c as Mt,f as pe}from"./chunk-C6TJ57ES.js";import{a as Ge}from"./chunk-VUC4E73K.js";import{u as Ct}from"./chunk-OTSIIVCA.js";import{d as bt}from"./chunk-R7VXUOCU.js";import{B as lt,Ca as mt,Da as ft,Fa as gt,G as oe,Ga as ht,Ha as j,N as st,X as ve,ca as ct,da as pt,oa as dt,ra as ut,s as rt,sa as ae}from"./chunk-NYN3E7NN.js";import{E as ie,c as et,h as te,i as tt,k as nt,o as ne,p as it}from"./chunk-R36OIJC7.js";import{a as Je,c as at}from"./chunk-RIYY3QQM.js";import{a as ot}from"./chunk-XGLKE2VY.js";import{a as Xe}from"./chunk-PPTZHIIZ.js";import{$ as Ve,$a as y,$c as ze,Ab as V,Ba as De,Bb as k,Cb as T,Da as ge,Db as g,Eb as r,Fa as he,Fb as l,Fc as Y,Gb as h,Gc as Ne,Hc as Re,M as fe,Oc as Ce,Pb as b,Qd as Ze,Rd as qe,Sb as f,Sc as He,Sd as Ye,Ta as Ie,Tc as w,Ua as s,Ub as c,Uc as G,Vb as U,Wb as M,Xb as Z,Xc as je,Zb as D,_b as I,ac as Oe,ad as X,ba as ke,bc as Ke,bd as Qe,d as we,db as K,eb as $,ec as R,fc as Le,gb as Ee,gc as _e,hb as Fe,hc as _,ib as Pe,ic as L,id as We,ja as B,jb as be,jc as A,ka as W,la as Te,mc as E,md as $e,na as O,nc as F,nd as Ue,oc as P,r as Se,ra as p,sa as d,sb as Be,sc as H,vd as J,wb as u,wc as Ae,wd as ee,xc as q,ya as v,yb as m,yc as x,za as Me}from"./chunk-DUSKF5IQ.js";import{a as S,b as Q}from"./chunk-NF7PG5F2.js";var de=class t{_openDialog=new we;openDialog$=this._openDialog.asObservable();openDialog(o){this._openDialog.next(o??{})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=B({token:t,factory:t.\u0275fac,providedIn:"root"})};var Dt=`
2
2
  .p-popover {
3
3
  margin-block-start: dt('popover.gutter');
4
4
  background: dt('popover.background');
@@ -1 +1 @@
1
- import{a as J}from"./chunk-UMZLK4TK.js";import"./chunk-UXZTZFCB.js";import"./chunk-ORJAUIF4.js";import{a as G}from"./chunk-UXFWRBCB.js";import"./chunk-TPIJSMHK.js";import"./chunk-LZBHDTSD.js";import{g as q,h as z}from"./chunk-C3NKDRGQ.js";import"./chunk-VU5DCR4V.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-SLMXA7HD.js";import"./chunk-EU43KDPC.js";import{a as A}from"./chunk-ZP376MYF.js";import"./chunk-JI7J6USO.js";import"./chunk-KIONH5BK.js";import"./chunk-SXGJPOFD.js";import"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as j,b as k}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-BNXRS5LX.js";import"./chunk-OKQYRKDJ.js";import"./chunk-HFBLFS5K.js";import"./chunk-DU6XSMWH.js";import"./chunk-ECBFGU72.js";import"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as R,h as V,o as W}from"./chunk-R36OIJC7.js";import"./chunk-A44IGHZE.js";import"./chunk-LIB4SWU2.js";import"./chunk-AGPZGAMV.js";import"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-DHMQXC66.js";import{n as B,q as H}from"./chunk-ETYXTCKV.js";import{$a as p,Bb as M,Cb as N,Db as s,Eb as i,Fb as n,Fc as h,Gc as F,Hc as T,Lc as E,Pb as v,Sb as w,Ua as l,Ub as S,db as C,hc as a,ib as D,ic as c,jb as I,mc as _,nc as b,oc as y,qd as P,ra as g,sa as f,sd as L,vd as O,zb as x}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";function U(r,u){if(r&1){let e=v();i(0,"div")(1,"div",9)(2,"h6"),a(3,"Outlet"),n(),i(4,"outlet-selector",10),y("ngModelChange",function(t){g(e);let m=S();return b(m.pageData.Filter.ListIDs,t)||(m.pageData.Filter.ListIDs=t),f(t)}),n()()()}if(r&2){let e=S();l(4),s("accessType",2),_("ngModel",e.pageData.Filter.ListIDs),s("multiple",!0)}}function X(r,u){if(r&1&&(i(0,"tr")(1,"td"),a(2),n(),i(3,"td"),a(4),h(5,"number"),n(),i(6,"td"),a(7),h(8,"date"),n()()),r&2){let e=u.$implicit;l(2),c(e==null?null:e.EntityName),l(2),c(F(5,3,e==null?null:e.Number)),l(3),c(T(8,5,e==null?null:e.Modified,"dd MMM yyyy HH:mm"))}}var K=class r extends G{constructor(e,o,t){super(e,o,"Setup/Data/TransactionInvoiceNumber",null,t);this.httpService=o}httpService;preGetList(){let e=this.pageData.Filter?.ListIDs?this.pageData.Filter?.ListIDs:[];this.pageData.Filter={ListIDs:e}}static \u0275fac=function(o){return new(o||r)(p(A),p(H),p(B))};static \u0275cmp=C({type:r,selectors:[["app-invoice-numbering"]],features:[D],decls:19,vars:4,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","isFilterOnDropdown","hideSearchBox","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["matTooltip","Next invoice number index to be generated",2,"width","200px"],[2,"width","200px"],[1,"dialog-filter"],["placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple"]],template:function(o,t){if(o&1){let m=v();i(0,"mainpanel-cmp",1),w("onSubmit",function(){return t.searchFromPageOne()}),y("filterChange",function(d){return g(m),b(t.pageData.Filter,d)||(t.pageData.Filter=d),f(d)}),i(1,"filters"),I(2,U,5,3,"ng-template",null,0,E),n(),i(4,"content")(5,"div",2)(6,"div",3)(7,"table",4)(8,"thead",5)(9,"tr",6)(10,"th"),a(11,"Outlet"),n(),i(12,"th",7),a(13," Next Number "),n(),i(14,"th",8),a(15,"Modified"),n()()(),i(16,"tbody"),M(17,X,9,8,"tr",null,x),n()()()()()()}o&2&&(s("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),_("filter",t.pageData.Filter),l(17),N(t.data==null?null:t.data.Data))},dependencies:[O,z,q,J,R,V,W,k,j,L,P],encapsulation:2})};export{K as InvoiceNumberingComponent};
1
+ import{a as J}from"./chunk-T5POZFJR.js";import"./chunk-UXZTZFCB.js";import"./chunk-ORJAUIF4.js";import{a as G}from"./chunk-NVSZUDQ3.js";import"./chunk-JG644ODH.js";import"./chunk-LZBHDTSD.js";import{g as q,h as z}from"./chunk-24YLKMEJ.js";import"./chunk-VU5DCR4V.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-SLMXA7HD.js";import"./chunk-US4LHROB.js";import{a as A}from"./chunk-WYDVIMXE.js";import"./chunk-JI7J6USO.js";import"./chunk-KIONH5BK.js";import"./chunk-I5JH4FHZ.js";import"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as j,b as k}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-3FFHADFC.js";import"./chunk-OKQYRKDJ.js";import"./chunk-IIARVTAV.js";import"./chunk-DU6XSMWH.js";import"./chunk-WF4CWM6A.js";import"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as R,h as V,o as W}from"./chunk-R36OIJC7.js";import"./chunk-RIYY3QQM.js";import"./chunk-XGLKE2VY.js";import"./chunk-AGPZGAMV.js";import"./chunk-K74WZXBF.js";import"./chunk-PPTZHIIZ.js";import"./chunk-G2B2G6M2.js";import{n as B,q as H}from"./chunk-ETYXTCKV.js";import{$a as p,Bb as M,Cb as N,Db as s,Eb as i,Fb as n,Fc as h,Gc as F,Hc as T,Lc as E,Pb as v,Sb as w,Ua as l,Ub as S,db as C,hc as a,ib as D,ic as c,jb as I,mc as _,nc as b,oc as y,qd as P,ra as g,sa as f,sd as L,vd as O,zb as x}from"./chunk-DUSKF5IQ.js";import"./chunk-NF7PG5F2.js";function U(r,u){if(r&1){let e=v();i(0,"div")(1,"div",9)(2,"h6"),a(3,"Outlet"),n(),i(4,"outlet-selector",10),y("ngModelChange",function(t){g(e);let m=S();return b(m.pageData.Filter.ListIDs,t)||(m.pageData.Filter.ListIDs=t),f(t)}),n()()()}if(r&2){let e=S();l(4),s("accessType",2),_("ngModel",e.pageData.Filter.ListIDs),s("multiple",!0)}}function X(r,u){if(r&1&&(i(0,"tr")(1,"td"),a(2),n(),i(3,"td"),a(4),h(5,"number"),n(),i(6,"td"),a(7),h(8,"date"),n()()),r&2){let e=u.$implicit;l(2),c(e==null?null:e.EntityName),l(2),c(F(5,3,e==null?null:e.Number)),l(3),c(T(8,5,e==null?null:e.Modified,"dd MMM yyyy HH:mm"))}}var K=class r extends G{constructor(e,o,t){super(e,o,"Setup/Data/TransactionInvoiceNumber",null,t);this.httpService=o}httpService;preGetList(){let e=this.pageData.Filter?.ListIDs?this.pageData.Filter?.ListIDs:[];this.pageData.Filter={ListIDs:e}}static \u0275fac=function(o){return new(o||r)(p(A),p(H),p(B))};static \u0275cmp=C({type:r,selectors:[["app-invoice-numbering"]],features:[D],decls:19,vars:4,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","isFilterOnDropdown","hideSearchBox","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["matTooltip","Next invoice number index to be generated",2,"width","200px"],[2,"width","200px"],[1,"dialog-filter"],["placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple"]],template:function(o,t){if(o&1){let m=v();i(0,"mainpanel-cmp",1),w("onSubmit",function(){return t.searchFromPageOne()}),y("filterChange",function(d){return g(m),b(t.pageData.Filter,d)||(t.pageData.Filter=d),f(d)}),i(1,"filters"),I(2,U,5,3,"ng-template",null,0,E),n(),i(4,"content")(5,"div",2)(6,"div",3)(7,"table",4)(8,"thead",5)(9,"tr",6)(10,"th"),a(11,"Outlet"),n(),i(12,"th",7),a(13," Next Number "),n(),i(14,"th",8),a(15,"Modified"),n()()(),i(16,"tbody"),M(17,X,9,8,"tr",null,x),n()()()()()()}o&2&&(s("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),_("filter",t.pageData.Filter),l(17),N(t.data==null?null:t.data.Data))},dependencies:[O,z,q,J,R,V,W,k,j,L,P],encapsulation:2})};export{K as InvoiceNumberingComponent};
@@ -1 +1 @@
1
- import{a as A}from"./chunk-TPIJSMHK.js";import{a as M}from"./chunk-KTMZNXL5.js";import{a as x}from"./chunk-C3NKDRGQ.js";import{a as w}from"./chunk-3GAEZ6NJ.js";import{a as F}from"./chunk-VUC4E73K.js";import{a as h}from"./chunk-KXQJYBG5.js";import{a as g}from"./chunk-PPTZHIIZ.js";import{Ba as p,da as C,na as y,r as P,x as I}from"./chunk-DUSKF5IQ.js";import{a as D,b as v}from"./chunk-NF7PG5F2.js";var b=class{enabledDragItem=p(!1);constructor(){}drop(o,t){w(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){this.enabledDragItem.set(!this.enabledDragItem())}onSaveDragAndDrop(o,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.postListID(o,t.data().Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.putListID(o,t.data().Data)}};var m=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData().Filter.Export=!0,e.pageData().Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData().Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData().Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return g.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let L=parseInt(n.getAttribute("colspan"));for(let d=1;d<L;d++)a["column"+s]="",s++;let l=n.innerText,u=l.toString().split("");if(o&&u[0]==="0"&&u.length>1){let d="'"+l.trim();a["column"+s]=d}else a["column"+s]=l.trim()}),e.push(a)}),e}};var S=class{listTotal=p(0);pageSize=p(0);show=p(!1);constructor(){}changePaginationData(o){let t=o.pageData().Filter.RowCount;this.pageSize.set(t);let e=o.data(),i=e?.ListTotal??e?.Data?.total?.value??0;this.listTotal.set(i),this.show.set(this.pageSize()<=this.listTotal())}changePage(o,t,e){t().Filter.PageNumber=o.pageIndex+1,e.getListData()}};var T=class extends M{constructor(t,e,i,r,a,s,c,n="post",L="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=c;this.dataMethod=n;this.loaderMethod=L;this.exportHandler=new m(e),r?(s&&this.loaderPayload.set(D({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),I([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload(),this.loaderMethod)]).pipe(P(([l,u])=>u)).pipe(F()).subscribe(l=>{this.pageData.set(l),this.pageData().Filter||(this.pageData().Filter={},this.pageData().Filter.RowCount=20),this.pageData().Filter.PageNumber=1,this.pageData().Filter.ID=this.loaderPayload()?.ID,this.preInitList(),c?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData().Filter.RowCount=20,this.pageData().Filter.PageNumber=1,this.preInitList(),I({menuData:this.menuData$,listData:this.getListData$()}).pipe(F()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=y(x);reportFilterService=y(A);pageData=p({Filter:{},Options:{},Roles:{},Config:{}});data=p(null);pagination=new S;dragDrop=new b;exportHandler;comparation=p(0);loaderPayload=p({});reloadRowCount=p(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData().Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&this.menuData.update(i=>v(D({},i),{SH:e.PageSubTitle})),this.data.set(e),this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&this.pageData.update(i=>v(D({},i),{HideStoreApiCount:!1}))})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData().Filter,this.dataMethod).pipe(C(e=>{this.data.set(e),this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData().Filter.PageNumber=1,this.getListData("filterMode")}getOpenDialogOptions(){}postInit(t){t.PageTitle!=null&&(this.menuData().H=t.PageTitle)}preGetList(){this.pageData().Filter.From==null&&(this.pageData().Filter.From=g.MinDate),this.pageData().Filter.To==null&&(this.pageData().Filter.To=g.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data().Data=this.data().Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data()&&(t=this.data().Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,h.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData().Filter.FormatType=1,this.pageData().Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData().Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data()[t]:this.data();if(e.length<1)return;let i=Object.assign({},this.pageData().Filter);i.From=new Date(new Date(this.pageData().Filter.From).getFullYear(),new Date(this.pageData().Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData().Filter.To).getFullYear(),new Date(this.pageData().Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation.set(0),e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let c=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,c.length>0){let n=c[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation.set(this.comparation()+s.Increase)}})})}};export{T as a};
1
+ import{a as A}from"./chunk-JG644ODH.js";import{a as M}from"./chunk-KTMZNXL5.js";import{a as x}from"./chunk-24YLKMEJ.js";import{a as w}from"./chunk-3GAEZ6NJ.js";import{a as F}from"./chunk-VUC4E73K.js";import{a as h}from"./chunk-KXQJYBG5.js";import{a as g}from"./chunk-PPTZHIIZ.js";import{Ba as p,da as C,na as y,r as P,x as I}from"./chunk-DUSKF5IQ.js";import{a as D,b as v}from"./chunk-NF7PG5F2.js";var b=class{enabledDragItem=p(!1);constructor(){}drop(o,t){w(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){this.enabledDragItem.set(!this.enabledDragItem())}onSaveDragAndDrop(o,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.postListID(o,t.data().Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem.set(!this.enabledDragItem()),this.enabledDragItem()||t.putListID(o,t.data().Data)}};var m=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData().Filter.Export=!0,e.pageData().Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData().Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData().Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return g.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let L=parseInt(n.getAttribute("colspan"));for(let d=1;d<L;d++)a["column"+s]="",s++;let l=n.innerText,u=l.toString().split("");if(o&&u[0]==="0"&&u.length>1){let d="'"+l.trim();a["column"+s]=d}else a["column"+s]=l.trim()}),e.push(a)}),e}};var S=class{listTotal=p(0);pageSize=p(0);show=p(!1);constructor(){}changePaginationData(o){let t=o.pageData().Filter.RowCount;this.pageSize.set(t);let e=o.data(),i=e?.ListTotal??e?.Data?.total?.value??0;this.listTotal.set(i),this.show.set(this.pageSize()<=this.listTotal())}changePage(o,t,e){t().Filter.PageNumber=o.pageIndex+1,e.getListData()}};var T=class extends M{constructor(t,e,i,r,a,s,c,n="post",L="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=c;this.dataMethod=n;this.loaderMethod=L;this.exportHandler=new m(e),r?(s&&this.loaderPayload.set(D({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),I([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload(),this.loaderMethod)]).pipe(P(([l,u])=>u)).pipe(F()).subscribe(l=>{this.pageData.set(l),this.pageData().Filter||(this.pageData().Filter={},this.pageData().Filter.RowCount=20),this.pageData().Filter.PageNumber=1,this.pageData().Filter.ID=this.loaderPayload()?.ID,this.preInitList(),c?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData().Filter.RowCount=20,this.pageData().Filter.PageNumber=1,this.preInitList(),I({menuData:this.menuData$,listData:this.getListData$()}).pipe(F()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=y(x);reportFilterService=y(A);pageData=p({Filter:{},Options:{},Roles:{},Config:{}});data=p(null);pagination=new S;dragDrop=new b;exportHandler;comparation=p(0);loaderPayload=p({});reloadRowCount=p(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData().Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&this.menuData.update(i=>v(D({},i),{SH:e.PageSubTitle})),this.data.set(e),this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&this.pageData.update(i=>v(D({},i),{HideStoreApiCount:!1}))})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData().Filter,this.dataMethod).pipe(C(e=>{this.data.set(e),this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData().HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData().Filter.PageNumber=1,this.getListData("filterMode")}getOpenDialogOptions(){}postInit(t){t.PageTitle!=null&&(this.menuData().H=t.PageTitle)}preGetList(){this.pageData().Filter.From==null&&(this.pageData().Filter.From=g.MinDate),this.pageData().Filter.To==null&&(this.pageData().Filter.To=g.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data().Data=this.data().Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data()&&(t=this.data().Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,h.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,h.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData().Filter.FormatType=1,this.pageData().Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData().Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data()[t]:this.data();if(e.length<1)return;let i=Object.assign({},this.pageData().Filter);i.From=new Date(new Date(this.pageData().Filter.From).getFullYear(),new Date(this.pageData().Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData().Filter.To).getFullYear(),new Date(this.pageData().Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation.set(0),e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let c=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,c.length>0){let n=c[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation.set(this.comparation()+s.Increase)}})})}};export{T as a};
@@ -1 +1 @@
1
- import{a as je}from"./chunk-RMPCUE2N.js";import{a as Le}from"./chunk-I7CB3WMS.js";import{d as Ue}from"./chunk-K2BCWJSV.js";import"./chunk-TDI2ZUL6.js";import{b as Pe,c as be,d as Me}from"./chunk-7GBU7E7F.js";import{a as Be,b as Qe}from"./chunk-EHCELKQF.js";import{b as Ae}from"./chunk-DJLA7A24.js";import"./chunk-6QINUZF2.js";import"./chunk-ZKLLTU3R.js";import"./chunk-JTZLL5AS.js";import"./chunk-CKHJNQTW.js";import{a as A}from"./chunk-UMZLK4TK.js";import"./chunk-UXZTZFCB.js";import"./chunk-LC65V6UK.js";import"./chunk-CNBTTBK3.js";import"./chunk-6QDAWGFY.js";import"./chunk-CCLE2IVS.js";import{a as we}from"./chunk-XEJHOUOQ.js";import{b as Fe}from"./chunk-6623DFFS.js";import"./chunk-ORJAUIF4.js";import"./chunk-UXFWRBCB.js";import"./chunk-TPIJSMHK.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as ke}from"./chunk-B5AGSH45.js";import{g as Ne,h as We}from"./chunk-C3NKDRGQ.js";import"./chunk-ZT6YAUVX.js";import{a as Re}from"./chunk-ESWYZY2G.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import"./chunk-VU5DCR4V.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-EU43KDPC.js";import{a as Ee}from"./chunk-ZP376MYF.js";import"./chunk-JI7J6USO.js";import"./chunk-KIONH5BK.js";import"./chunk-SXGJPOFD.js";import"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as De,b as ve}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-BNXRS5LX.js";import"./chunk-OKQYRKDJ.js";import"./chunk-HFBLFS5K.js";import{d as Se,e as Ve}from"./chunk-ULWLSYED.js";import"./chunk-DU6XSMWH.js";import"./chunk-ECBFGU72.js";import{a as Te,c as Ie}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as q}from"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{b as xe,c as Oe}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as U,F as fe,c as ye,h as N,o as W}from"./chunk-R36OIJC7.js";import"./chunk-A44IGHZE.js";import"./chunk-LIB4SWU2.js";import{a as Ce}from"./chunk-AGPZGAMV.js";import{b as he}from"./chunk-K74WZXBF.js";import{a as k}from"./chunk-PPTZHIIZ.js";import"./chunk-DHMQXC66.js";import{n as S,q as _e}from"./chunk-ETYXTCKV.js";import{$ as Y,$a as M,Ba as V,D as G,Db as c,Eb as o,Fb as r,Fc as T,Gb as w,Gc as R,Hc as H,Kb as Q,Lb as j,Lc as ae,Mc as oe,Nd as me,Oc as re,Pb as D,Qd as ue,Sb as y,Sd as ge,Ua as l,Ub as s,Xc as le,da as J,db as L,ec as $,hc as d,hd as se,ib as X,ic as ee,jb as O,jc as x,kc as te,kd as pe,ld as ce,mc as f,na as v,nc as h,oc as C,ra as u,sa as g,sd as de,vd as E,wb as Z,xc as ne,yb as K,yc as ie}from"./chunk-DUSKF5IQ.js";import{a as P,b}from"./chunk-NF7PG5F2.js";var B=class a{dialogRef=v(Te);toastrService=v(S);modalConfig;selectedOutlets=[];constructor(){this.modalConfig=new xe,this.modalConfig.title="Update ROP",this.modalConfig.customWidth="350px"}onOk(){if(this.selectedOutlets.length===0){this.toastrService.warning("Please select at least one outlet","Warning");return}this.dialogRef.close(this.selectedOutlets)}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=L({type:a,selectors:[["app-modal-update-rop"]],decls:6,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"row"],[1,"col-12"],[3,"ngModelChange","ngModel","multiple"]],template:function(e,t){e&1&&(o(0,"modal-material",0),y("onOk",function(){return t.onOk()})("onCancel",function(){return t.onClose()})("onClose",function(){return t.onClose()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"outlet-selector",4),C("ngModelChange",function(i){return h(t.selectedOutlets,i)||(t.selectedOutlets=i),i}),r()()()()()()),e&2&&(c("config",t.modalConfig),l(5),f("ngModel",t.selectedOutlets),c("multiple",!0))},dependencies:[E,Oe,A,U,N,W],encapsulation:2})};var z=(i=>(i[i.negative=0]="negative",i[i.empty=1]="empty",i[i.critical=2]="critical",i[i.optimal=3]="optimal",i[i.overstock=4]="overstock",i))(z||{});var Je=()=>[],Xe=a=>({ID:a});function Ze(a,m){if(a&1){let e=D();o(0,"button",7),y("click",function(){u(e);let n=s();return g(n.openExportModal())}),w(1,"i",8),d(2," Export "),r()}}function Ke(a,m){if(a&1){let e=D();o(0,"button",9),y("click",function(){u(e);let n=s();return g(n.onSubmitROP())}),w(1,"i",10),d(2," Save ROP "),r()}if(a&2){let e=s();c("matTooltip","Save ROP to Outlet "+e.outletSelected)}}function $e(a,m){if(a&1){let e=D();o(0,"h6"),d(1,"Show Inventory & Sales for Outlet"),r(),o(2,"outlet-selector",11),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.ListIDs,n)||(i.pageData().Filter.ListIDs=n),g(n)}),r(),o(3,"h6"),d(4,"Category"),r(),o(5,"POS-product-category-select",12),C("selectedCategoryIDChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CategoryID,n)||(i.pageData().Filter.CategoryID=n),g(n)}),r(),o(6,"h6"),d(7," Product Sold Within Days "),w(8,"i",13),r(),o(9,"input",14),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.NumberOfDays,n)||(i.pageData().Filter.NumberOfDays=n),g(n)}),r(),o(10,"h6"),d(11,"Inventory Threshold"),r(),o(12,"div",15)(13,"div",16)(14,"input",17),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CriticalDaysThreshold,n)||(i.pageData().Filter.CriticalDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s();return g(i.onCriticalChange(n))}),r(),o(15,"div",18)(16,"div",19),w(17,"div",20)(18,"div",21)(19,"div",22),r(),o(20,"div",23)(21,"span"),d(22),r(),o(23,"span"),d(24),r(),o(25,"span"),d(26),r()()(),o(27,"input",24),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.OverstockDaysThreshold,n)||(i.pageData().Filter.OverstockDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s();return g(i.onOverstockChange(n))}),r()()(),o(28,"h6"),d(29,"Days Of Risk"),r(),o(30,"ng-select",25),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.DaysOfRisk,n)||(i.pageData().Filter.DaysOfRisk=n),g(n)}),r(),o(31,"h6"),d(32,"Set ROP for Outlet"),r(),o(33,"outlet-selector",26),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.TargetOutlet,n)||(i.pageData().Filter.TargetOutlet=n),g(n)}),y("onListOutlets",function(n){u(e);let i=s();return g(i.getOutlets(n))}),r(),o(34,"h6"),d(35,"Count Indirect Allocated"),r(),o(36,"radio-options",27),C("modelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CalculateIndirectAllocated,n)||(i.pageData().Filter.CalculateIndirectAllocated=n),g(n)}),r()}if(a&2){let e,t=s();l(2),c("multiple",!0)("accessType",2),f("ngModel",t.pageData().Filter.ListIDs),l(3),f("selectedCategoryID",t.pageData().Filter.CategoryID),c("showClear",!0),l(4),f("ngModel",t.pageData().Filter.NumberOfDays),l(5),f("ngModel",t.pageData().Filter.CriticalDaysThreshold),l(8),x("\u2264",t.pageData().Filter.CriticalDaysThreshold," Days"),l(2),te("",t.pageData().Filter.CriticalDaysThreshold+1,"-",t.pageData().Filter.OverstockDaysThreshold," Days"),l(2),x(">",t.pageData().Filter.OverstockDaysThreshold," Days"),l(),f("ngModel",t.pageData().Filter.OverstockDaysThreshold),l(3),c("items",((e=t.pageData().Options)==null?null:e.DaysOfRisks)||ne(19,Je))("clearable",!0),f("ngModel",t.pageData().Filter.DaysOfRisk),l(3),c("multiple",!1)("accessType",2),f("ngModel",t.pageData().Filter.TargetOutlet),l(3),f("model",t.pageData().Filter.CalculateIndirectAllocated)}}function et(a,m){a&1&&(o(0,"th",43),d(1," LT "),r())}function tt(a,m){if(a&1&&(o(0,"th",44),d(1," ROP "),r()),a&2){let e=s(2);c("matTooltip","Based on "+e.outletSelected+" ROP")}}function nt(a,m){if(a&1){let e=D();o(0,"td",46)(1,"input",47),C("ngModelChange",function(n){u(e);let i=s().$implicit;return h(i.LeadTime,n)||(i.LeadTime=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s().$implicit,p=s(2);return g(p.onInputLeadTime(n,i))}),r()()}if(a&2){let e=s(),t=e.$implicit,n=e.index;l(),c("name","LeadTime"+n),f("ngModel",t.LeadTime),c("id","leadTime"+n)}}function it(a,m){if(a&1){let e=D();o(0,"div",49)(1,"div",50)(2,"span",51),d(3),T(4,"number"),r(),w(5,"i",52),o(6,"div",53)(7,"input",54),T(8,"quantityFraction"),y("ngModelChange",function(n){u(e);let i=s(2).$implicit,p=s(2);return g(p.onInputROP(n,i))}),r()()()()}if(a&2){let e=s(2),t=e.$implicit,n=e.index,i=s(2);l(3),x(" ",R(4,5,i.getOriginalROP(t))," "),l(4),c("decimalPlaces",i.ropDecimalPlaces)("name","ROP"+n)("ngModel",R(8,7,t.ROP))("id","ROP"+n)}}function at(a,m){if(a&1&&(o(0,"span",46),d(1),T(2,"number"),r()),a&2){let e=s(2).$implicit;l(),x(" ",R(2,1,e.ROP)," ")}}function ot(a,m){if(a&1&&(o(0,"td",46),O(1,it,9,9,"div",48)(2,at,3,3,"span",41),r()),a&2){let e=s().$implicit;l(),c("ngIf",e.LeadTime),l(),c("ngIf",!e.LeadTime)}}function rt(a,m){if(a&1&&(o(0,"tr")(1,"td")(2,"a",45),d(3),r()(),o(4,"td"),d(5),r(),o(6,"td",46),d(7),T(8,"quantityFraction"),r(),o(9,"td",46),d(10),T(11,"number"),r(),o(12,"td",46),d(13),T(14,"number"),r(),o(15,"td",46)(16,"div"),d(17),r()(),O(18,nt,2,3,"td",41)(19,ot,3,2,"td",41),r()),a&2){let e=m.$implicit,t=s(2);l(2),c("queryParams",ie(27,Xe,e.ID)),l(),x(" ",e.Name," "),l(2),ee(e.Code),l(2),x(" ",R(8,19,e.Available)," "),l(3),x(" ",H(11,21,e.QtySoldPerDay,"1.0-2")," "),l(3),x(" ",e.QtySoldPerDay<0?"-":H(14,24,e.DaysOf,"1.0-0")," "),l(3),$("text-negative",e.DaysOfRiskType===t.riskType.negative)("text-empty",e.DaysOfRiskType===t.riskType.empty)("text-critical",e.DaysOfRiskType===t.riskType.critical)("text-optimal",e.DaysOfRiskType===t.riskType.optimal)("text-overstock",e.DaysOfRiskType===t.riskType.overstock),l(),x(" ",e.DaysOfRisk," "),l(),c("ngIf",t.pageData().Filter.TargetOutlet),l(),c("ngIf",t.pageData().Filter.TargetOutlet)}}function lt(a,m){a&1&&(o(0,"td",46)(1,"span"),d(2,"Bulk Lead Time "),r()())}function st(a,m){if(a&1){let e=D();o(0,"td")(1,"input",55),y("ngModelChange",function(n){u(e);let i=s(2);return g(i.onBulkUpdateLT(n))}),r()()}if(a&2){let e=s(2);l(),c("ngModel",e.bulkUpdateLTValue())("id","LT")}}function pt(a,m){if(a&1){let e=D();o(0,"div",28)(1,"div",29)(2,"table",30),y("matSortChange",function(n){u(e);let i=s();return g(i.sortData(n))}),o(3,"thead",31)(4,"tr")(5,"th",32),d(6,"Product"),r(),o(7,"th",33),d(8,"Code"),r(),o(9,"th",34),d(10," Available "),r(),o(11,"th",35),d(12," SOLD/DAY "),r(),o(13,"th",36),d(14," Days Of "),r(),o(15,"th",37),d(16," Risk "),r(),O(17,et,2,0,"th",38)(18,tt,2,1,"th",39),r()(),o(19,"tbody"),O(20,rt,20,29,"tr",40),r(),o(21,"tfoot")(22,"tr"),w(23,"td")(24,"td")(25,"td")(26,"td")(27,"td"),O(28,lt,3,0,"td",41),Z(29,st,2,2,"td"),r()()()(),o(30,"div")(31,"POS-complex-pagination",42),y("jumpToPage",function(){u(e);let n=s();return g(n.getListData())})("previousPage",function(){u(e);let n=s();return g(n.getListData())})("nextPage",function(){u(e);let n=s();return g(n.getListData())}),C("reloadRowCountChange",function(n){u(e);let i=s();return h(i.reloadRowCount,n)||(i.reloadRowCount=n),g(n)}),r()()()}if(a&2){let e,t=s();l(11),c("matTooltip","Based on Last "+t.pageData().Filter.NumberOfDays+" Days Sold"),l(6),c("ngIf",t.pageData().Filter.TargetOutlet),l(),c("ngIf",t.pageData().Filter.TargetOutlet),l(2),c("ngForOf",t.data().Data),l(8),c("ngIf",t.pageData().Filter.TargetOutlet&&t.data().Data.length>0),l(),K(t.pageData().Filter.TargetOutlet&&t.data().Data.length>0?29:-1),l(2),c("total",t.data().Data.length)("totalAllData",(e=t.data())==null?null:e.ListTotal)("pageData",t.pageData()),f("reloadRowCount",t.reloadRowCount)}}var He=class a extends we{constructor(e,t,n,i,p,_){super(e,t,"Inventory/DayOf","InventoryLoader/DaysOf",void 0,_,!0);this.httpService=t;this.csvConverter=i;this.roleService=p}httpService;csvConverter;roleService;dialog=v(Ie);fractionData=v(Ce);locale=v(oe);riskType=z;get ropDecimalPlaces(){return this.fractionData.quantity.maximumFraction}formatQuantityFraction(e){let t=`1.${this.fractionData.quantity.minimumFraction}-${this.fractionData.quantity.maximumFraction}`;return se(e,this.locale,t)}ListUpdateROP=V([]);listOutlet=V([]);bulkUpdateLTValue=le("");toastr=v(S);originalROPValues=V(new Map);rawROPValues=V([]);subTotalROP=re(()=>this.ListUpdateROP()?this.ListUpdateROP().reduce((e,t)=>e+Number(t.Value),0).toFixed(3):0);postInit(e){this.rawROPValues.set(e.Data),this.ListUpdateROP.set([]),this.originalROPValues.set(new Map)}preInitList(){this.menuData().H="Days of Inventory"}onInputLeadTime(e,t){if(k.IsEmpty(e)||e===0){this.rawROPValues().find(F=>F.ID===t.ID)&&(t.LeadTime="",t.ROP=this.getOriginalROP(t)),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}));return}let n=this.originalROPValues();n.has(t.ID)||(n.set(t.ID,t.ROP),this.originalROPValues.set(new Map(n)));let i=this.fractionData.quantity.maximumFraction,p=e*t.QtySoldPerDay;t.ROP=parseFloat(p.toFixed(i)),this.ListUpdateROP.update(_=>[..._.filter(qe=>qe.Key!==t.ID),{Key:t.ID,Value:this.formatQuantityFraction(t.ROP)}])}onInputROP(e,t){if(e){let n=this.fractionData.quantity.maximumFraction,i=parseFloat(e.toFixed(n));t.ROP=i,this.ListUpdateROP.update(p=>[...p.filter(F=>F.Key!==t.ID),{Key:t.ID,Value:this.formatQuantityFraction(i)}])}}getOriginalROP(e){return this.originalROPValues().get(e.ID)||e.ROP}get outletSelected(){if(this.listOutlet().length>0&&this.pageData().Filter.TargetOutlet){let e=this.listOutlet().findIndex(t=>t.k===this.pageData().Filter.TargetOutlet);if(e!==-1)return this.listOutlet()[e].v}return""}getOutlets(e){console.log(e),this.listOutlet.set(e)}onSubmitROP(){let e={ListUpdateROP:[...this.ListUpdateROP()],EntityID:this.pageData().Filter.TargetOutlet};this.httpService.post(q.UpdateROP,e).pipe(je("response"),J(t=>{this.toastr.success("ROP has been updated successfully.","Success!"),this.originalROPValues.set(new Map),this.getListData(),this.ListUpdateROP.set([]),this.bulkUpdateLTValue.set("")})).subscribe()}resetOriginalROP(e){let t=this.originalROPValues();t.has(e.ID)&&(t.delete(e.ID),this.originalROPValues.set(new Map(t)))}updateRop(e,t){this.dialog.open(B).afterClosed().pipe(G(n=>k.IsNotEmpty(n)),Y(n=>{let i={VariantID:e.ID,ListEntityID:n,ROP:e.ROP};return this.httpService.post(q.UpdateROP,i)})).subscribe(()=>{this.clearInput(`leadTime${t}`),this.toastr.success("ROP has been updated successfully.","Success!"),this.getListData()})}clearInput(e){let t=document.getElementById(e);t&&(t.value="")}openExportModal(){this.dialog.open(Fe,{data:{title:"Days of Inventory",exportTypes:[{ID:"InventoryExport/GetDaysOfExport",Value:"Default",FileName:"Days of Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"Inventory/DayOfCount",pagination:!0}})}sortData(e){let t=[...this.data().Data];if(!e.active||e.direction===""){this.data.set(b(P({},this.data()),{Data:[...t]}));return}let n=t.sort((i,p)=>{let _=e.direction==="asc";switch(e.active){case"Name":return I(i.Name,p.Name,_);case"Code":return I(i.Code,p.Code,_);case"QtySold":return I(i.QtySold,p.QtySold,_);case"QtySoldPerDay":return I(i.QtySoldPerDay,p.QtySoldPerDay,_);case"OnHand":return I(i.OnHand,p.OnHand,_);case"Available":return I(i.Available,p.Available,_);case"DaysOf":return I(i.DaysOf,p.DaysOf,_);default:return 0}});this.data.set(b(P({},this.data()),{Data:[...n]}))}onBulkUpdateLT(e){let t=this.originalROPValues(),n=this.rawROPValues();if(k.IsEmpty(e)){this.bulkUpdateLTValue.set(""),this.data.set(b(P({},this.data()),{Data:n.map(p=>b(P({},p),{LeadTime:null}))}));return}let i=+e;if(this.bulkUpdateLTValue.set(i),!!this.data()?.Data){for(let p of this.data().Data)t.has(p.ID)||t.set(p.ID,p.ROP),p.LeadTime=i,p.ROP=i*(p.QtySoldPerDay||0);this.originalROPValues.set(new Map(t)),this.ListUpdateROP.set(this.data().Data.map(p=>({Key:p.ID,Value:this.formatQuantityFraction(p.ROP)}))),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}))}}onCriticalChange(e){let t=this.pageData().Filter.ExceedDaysThreshold;e>=t&&(this.pageData().Filter.ExceedDaysThreshold=e+1)}onOverstockChange(e){let t=this.pageData().Filter.CriticalDaysThreshold;e<=t&&(this.pageData().Filter.ExceedDaysThreshold=t+1)}static \u0275fac=function(t){return new(t||a)(M(Ee),M(_e),M(S),M(ke),M(he),M(me))};static \u0275cmp=L({type:a,selectors:[["app-days-of-inventory"]],inputs:{bulkUpdateLTValue:[1,"bulkUpdateLTValue"]},outputs:{bulkUpdateLTValue:"bulkUpdateLTValueChange"},features:[X],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","text","isFilterOnDropdown"],["ngProjectAs","actions",5,["actions"]],["class","btn btn-outline-secondary me-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary","role","button",3,"matTooltip","click",4,"ngIf"],["ngProjectAs","filters",5,["filters"]],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-2",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-outline-secondary",3,"click","matTooltip"],[1,"fa-solid","fa-save","me-3"],["placeholder","Choose Outlets",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["matTooltip","Number of past days used to calculate average daily sales for inventory planning","matTooltipPosition","above",1,"fa-light","fa-circle-info",2,"cursor","pointer"],["autoNum","","min","1",1,"form-control",3,"ngModelChange","ngModel"],[1,"threshold-compact-wrapper"],[1,"threshold-row"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-critical",3,"ngModelChange","ngModel"],[1,"threshold-bar-container"],[1,"threshold-bar"],["matTooltip","Critical","matTooltipPosition","above",1,"bar-segment","seg-critical"],["matTooltip","Optimal","matTooltipPosition","above",1,"bar-segment","seg-optimal"],["matTooltip","Overstock","matTooltipPosition","above",1,"bar-segment","seg-overstock"],[1,"threshold-bar-labels"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-overstock",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","All",1,"ng-select",3,"ngModelChange","items","clearable","ngModel"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","onListOutlets","multiple","accessType","ngModel"],["name","IndirectAllocated",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","125px"],["mat-sort-header","Available","matTooltip","Inventory available for sale","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","QtySoldPerDay","arrowPosition","before",1,"text-end",2,"width","100px",3,"matTooltip"],["mat-sort-header","DaysOf","arrowPosition","before","matTooltip","How many days left until you run out of inventory",1,"text-end",2,"width","100px"],["mat-sort-header","DaysOfRisk","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 80px","matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order","class","text-end",4,"ngIf"],["class","text-end","style","width: 120px",3,"matTooltip",4,"ngIf"],[4,"ngFor","ngForOf"],["class","text-end",4,"ngIf"],["api","Inventory/DayOfCount",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],["matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order",1,"text-end",2,"width","80px"],[1,"text-end",2,"width","120px",3,"matTooltip"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","name","ngModel","id"],["class","rop-comparison",4,"ngIf"],[1,"rop-comparison"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],[1,"old-value"],[1,"fa-solid","fa-arrow-right","text-muted"],[1,"input-group","input-group-sm",2,"width","70px"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","decimalPlaces","name","ngModel","id"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","id"]],template:function(t,n){if(t&1){let i=D();o(0,"mainpanel-cmp",1),y("onSubmit",function(){return n.getListData()}),C("textChange",function(_){return u(i),h(n.pageData().Filter.FilterText,_)||(n.pageData().Filter.FilterText=_),g(_)}),Q(1,2),O(2,Ze,3,0,"button",3)(3,Ke,3,1,"button",4),j(),Q(4,5),O(5,$e,37,20,"ng-template",null,0,ae),j(),o(7,"content"),O(8,pt,32,10,"div",6),r()()}t&2&&(c("pageData",n.menuData()),f("text",n.pageData().Filter.FilterText),c("isFilterOnDropdown",!1),l(2),c("ngIf",n.roleService.global.Export),l(),c("ngIf",n.ListUpdateROP().length>0),l(5),c("ngIf",n.data()))},dependencies:[E,pe,ce,We,Ne,Re,U,ye,N,W,A,ge,ue,Qe,Be,Ae,ve,De,fe,Me,Pe,be,Ue,Ve,Se,de,Le],styles:[".threshold-compact-wrapper[_ngcontent-%COMP%]{background:#f8f9fa;border-radius:8px;padding:.6rem .75rem;margin:.25rem 0 1rem;border:1px solid #e9ecef}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]{width:48px;text-align:center;font-size:.75rem;font-weight:600;border-radius:6px;border:1.5px solid #e5e7eb;padding:.3rem .15rem;background:#fff;color:#374151;flex-shrink:0;transition:all .15s ease}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]:focus{outline:none}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]{border-color:#f5f0a6}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]:focus{border-color:#fff44f;box-shadow:0 0 0 2px #fff44f1f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]{border-color:#96b0f7}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]:focus{border-color:#3581d8;box-shadow:0 0 0 2px #3581d81f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem;min-width:0}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%]{display:flex;height:10px;border-radius:5px;overflow:hidden;box-shadow:inset 0 1px 2px #00000014}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment[_ngcontent-%COMP%]{flex:1;transition:background .3s ease;cursor:pointer}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]{background:#fff44f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]:hover{background:#f7e817}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]{background:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]:hover{background:#388e3c}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]{background:#3581d8}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]:hover{background:#2c58af}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.55rem;font-weight:500;color:#9ca3af;padding:0 2px}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){color:#a39800}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){color:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){color:#3581d8}.text-negative[_ngcontent-%COMP%]{color:#a61b29}.text-empty[_ngcontent-%COMP%]{color:#d82e3f}.text-critical[_ngcontent-%COMP%]{color:#e8c73a}.text-optimal[_ngcontent-%COMP%]{color:#28cc2d}.text-overstock[_ngcontent-%COMP%]{color:#3581d8}"],changeDetection:0})};function I(a,m,e){return a===null||a===""?e?-1:1:m===null||m===""?e?1:-1:typeof a=="string"&&typeof m=="string"?a.localeCompare(m)*(e?1:-1):typeof a=="number"&&typeof m=="number"?(a<m?-1:1)*(e?1:-1):typeof a=="string"&&typeof m=="number"?e?-1:1:typeof a=="number"&&typeof m=="string"?e?1:-1:0}export{He as DaysOfInventoryComponent};
1
+ import{a as je}from"./chunk-RMPCUE2N.js";import{a as Le}from"./chunk-I7CB3WMS.js";import{d as Ue}from"./chunk-K2BCWJSV.js";import"./chunk-TDI2ZUL6.js";import{b as Pe,c as be,d as Me}from"./chunk-7GBU7E7F.js";import{a as Be,b as Qe}from"./chunk-EHCELKQF.js";import{b as Ae}from"./chunk-6ZV2PHVD.js";import"./chunk-6QINUZF2.js";import"./chunk-ZKLLTU3R.js";import"./chunk-JTZLL5AS.js";import"./chunk-CKHJNQTW.js";import{a as A}from"./chunk-T5POZFJR.js";import"./chunk-UXZTZFCB.js";import"./chunk-LC65V6UK.js";import"./chunk-CNBTTBK3.js";import"./chunk-6QDAWGFY.js";import"./chunk-CCLE2IVS.js";import{a as we}from"./chunk-2AW77P5H.js";import{b as Fe}from"./chunk-6623DFFS.js";import"./chunk-ORJAUIF4.js";import"./chunk-NVSZUDQ3.js";import"./chunk-JG644ODH.js";import"./chunk-KTMZNXL5.js";import"./chunk-LZBHDTSD.js";import{a as ke}from"./chunk-B5AGSH45.js";import{g as Ne,h as We}from"./chunk-24YLKMEJ.js";import"./chunk-ZT6YAUVX.js";import{a as Re}from"./chunk-ESWYZY2G.js";import"./chunk-MF3BDWCO.js";import"./chunk-BF42EMHQ.js";import"./chunk-VU5DCR4V.js";import"./chunk-WURU2W3C.js";import"./chunk-UEFG7JV5.js";import"./chunk-ZSK2V6PP.js";import"./chunk-2KEPYDRB.js";import"./chunk-EUIKMR24.js";import"./chunk-7VXCKSAE.js";import"./chunk-3GAEZ6NJ.js";import"./chunk-MOV2FQBP.js";import"./chunk-W4DKC5G3.js";import"./chunk-SLMXA7HD.js";import"./chunk-US4LHROB.js";import{a as Ee}from"./chunk-WYDVIMXE.js";import"./chunk-JI7J6USO.js";import"./chunk-KIONH5BK.js";import"./chunk-I5JH4FHZ.js";import"./chunk-W7I2IWJP.js";import"./chunk-HPCTP4FD.js";import"./chunk-KFWGALIF.js";import{a as De,b as ve}from"./chunk-Z7UCI72M.js";import"./chunk-PPMQE2JW.js";import"./chunk-7OCVKGLK.js";import"./chunk-NF7H3LPQ.js";import"./chunk-3FFHADFC.js";import"./chunk-OKQYRKDJ.js";import"./chunk-IIARVTAV.js";import{d as Se,e as Ve}from"./chunk-ULWLSYED.js";import"./chunk-DU6XSMWH.js";import"./chunk-WF4CWM6A.js";import{a as Te,c as Ie}from"./chunk-LCBHD53Y.js";import"./chunk-IKV23X6H.js";import"./chunk-C6TJ57ES.js";import"./chunk-RJDDPGUV.js";import"./chunk-VUC4E73K.js";import"./chunk-OTSIIVCA.js";import{a as q}from"./chunk-DUAKLYOO.js";import"./chunk-QSBTT5BF.js";import"./chunk-IX2NXO5F.js";import"./chunk-ZRB4EZI3.js";import{b as xe,c as Oe}from"./chunk-KXQJYBG5.js";import"./chunk-3MLD6BQG.js";import"./chunk-LUUIBDJG.js";import"./chunk-R7VXUOCU.js";import"./chunk-NYN3E7NN.js";import{E as U,F as fe,c as ye,h as N,o as W}from"./chunk-R36OIJC7.js";import"./chunk-RIYY3QQM.js";import"./chunk-XGLKE2VY.js";import{a as Ce}from"./chunk-AGPZGAMV.js";import{b as he}from"./chunk-K74WZXBF.js";import{a as k}from"./chunk-PPTZHIIZ.js";import"./chunk-G2B2G6M2.js";import{n as S,q as _e}from"./chunk-ETYXTCKV.js";import{$ as Y,$a as M,Ba as V,D as G,Db as c,Eb as o,Fb as r,Fc as T,Gb as w,Gc as R,Hc as H,Kb as Q,Lb as j,Lc as ae,Mc as oe,Nd as me,Oc as re,Pb as D,Qd as ue,Sb as y,Sd as ge,Ua as l,Ub as s,Xc as le,da as J,db as L,ec as $,hc as d,hd as se,ib as X,ic as ee,jb as O,jc as x,kc as te,kd as pe,ld as ce,mc as f,na as v,nc as h,oc as C,ra as u,sa as g,sd as de,vd as E,wb as Z,xc as ne,yb as K,yc as ie}from"./chunk-DUSKF5IQ.js";import{a as P,b}from"./chunk-NF7PG5F2.js";var B=class a{dialogRef=v(Te);toastrService=v(S);modalConfig;selectedOutlets=[];constructor(){this.modalConfig=new xe,this.modalConfig.title="Update ROP",this.modalConfig.customWidth="350px"}onOk(){if(this.selectedOutlets.length===0){this.toastrService.warning("Please select at least one outlet","Warning");return}this.dialogRef.close(this.selectedOutlets)}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=L({type:a,selectors:[["app-modal-update-rop"]],decls:6,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"row"],[1,"col-12"],[3,"ngModelChange","ngModel","multiple"]],template:function(e,t){e&1&&(o(0,"modal-material",0),y("onOk",function(){return t.onOk()})("onCancel",function(){return t.onClose()})("onClose",function(){return t.onClose()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"outlet-selector",4),C("ngModelChange",function(i){return h(t.selectedOutlets,i)||(t.selectedOutlets=i),i}),r()()()()()()),e&2&&(c("config",t.modalConfig),l(5),f("ngModel",t.selectedOutlets),c("multiple",!0))},dependencies:[E,Oe,A,U,N,W],encapsulation:2})};var z=(i=>(i[i.negative=0]="negative",i[i.empty=1]="empty",i[i.critical=2]="critical",i[i.optimal=3]="optimal",i[i.overstock=4]="overstock",i))(z||{});var Je=()=>[],Xe=a=>({ID:a});function Ze(a,m){if(a&1){let e=D();o(0,"button",7),y("click",function(){u(e);let n=s();return g(n.openExportModal())}),w(1,"i",8),d(2," Export "),r()}}function Ke(a,m){if(a&1){let e=D();o(0,"button",9),y("click",function(){u(e);let n=s();return g(n.onSubmitROP())}),w(1,"i",10),d(2," Save ROP "),r()}if(a&2){let e=s();c("matTooltip","Save ROP to Outlet "+e.outletSelected)}}function $e(a,m){if(a&1){let e=D();o(0,"h6"),d(1,"Show Inventory & Sales for Outlet"),r(),o(2,"outlet-selector",11),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.ListIDs,n)||(i.pageData().Filter.ListIDs=n),g(n)}),r(),o(3,"h6"),d(4,"Category"),r(),o(5,"POS-product-category-select",12),C("selectedCategoryIDChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CategoryID,n)||(i.pageData().Filter.CategoryID=n),g(n)}),r(),o(6,"h6"),d(7," Product Sold Within Days "),w(8,"i",13),r(),o(9,"input",14),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.NumberOfDays,n)||(i.pageData().Filter.NumberOfDays=n),g(n)}),r(),o(10,"h6"),d(11,"Inventory Threshold"),r(),o(12,"div",15)(13,"div",16)(14,"input",17),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CriticalDaysThreshold,n)||(i.pageData().Filter.CriticalDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s();return g(i.onCriticalChange(n))}),r(),o(15,"div",18)(16,"div",19),w(17,"div",20)(18,"div",21)(19,"div",22),r(),o(20,"div",23)(21,"span"),d(22),r(),o(23,"span"),d(24),r(),o(25,"span"),d(26),r()()(),o(27,"input",24),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.OverstockDaysThreshold,n)||(i.pageData().Filter.OverstockDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s();return g(i.onOverstockChange(n))}),r()()(),o(28,"h6"),d(29,"Days Of Risk"),r(),o(30,"ng-select",25),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.DaysOfRisk,n)||(i.pageData().Filter.DaysOfRisk=n),g(n)}),r(),o(31,"h6"),d(32,"Set ROP for Outlet"),r(),o(33,"outlet-selector",26),C("ngModelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.TargetOutlet,n)||(i.pageData().Filter.TargetOutlet=n),g(n)}),y("onListOutlets",function(n){u(e);let i=s();return g(i.getOutlets(n))}),r(),o(34,"h6"),d(35,"Count Indirect Allocated"),r(),o(36,"radio-options",27),C("modelChange",function(n){u(e);let i=s();return h(i.pageData().Filter.CalculateIndirectAllocated,n)||(i.pageData().Filter.CalculateIndirectAllocated=n),g(n)}),r()}if(a&2){let e,t=s();l(2),c("multiple",!0)("accessType",2),f("ngModel",t.pageData().Filter.ListIDs),l(3),f("selectedCategoryID",t.pageData().Filter.CategoryID),c("showClear",!0),l(4),f("ngModel",t.pageData().Filter.NumberOfDays),l(5),f("ngModel",t.pageData().Filter.CriticalDaysThreshold),l(8),x("\u2264",t.pageData().Filter.CriticalDaysThreshold," Days"),l(2),te("",t.pageData().Filter.CriticalDaysThreshold+1,"-",t.pageData().Filter.OverstockDaysThreshold," Days"),l(2),x(">",t.pageData().Filter.OverstockDaysThreshold," Days"),l(),f("ngModel",t.pageData().Filter.OverstockDaysThreshold),l(3),c("items",((e=t.pageData().Options)==null?null:e.DaysOfRisks)||ne(19,Je))("clearable",!0),f("ngModel",t.pageData().Filter.DaysOfRisk),l(3),c("multiple",!1)("accessType",2),f("ngModel",t.pageData().Filter.TargetOutlet),l(3),f("model",t.pageData().Filter.CalculateIndirectAllocated)}}function et(a,m){a&1&&(o(0,"th",43),d(1," LT "),r())}function tt(a,m){if(a&1&&(o(0,"th",44),d(1," ROP "),r()),a&2){let e=s(2);c("matTooltip","Based on "+e.outletSelected+" ROP")}}function nt(a,m){if(a&1){let e=D();o(0,"td",46)(1,"input",47),C("ngModelChange",function(n){u(e);let i=s().$implicit;return h(i.LeadTime,n)||(i.LeadTime=n),g(n)}),y("ngModelChange",function(n){u(e);let i=s().$implicit,p=s(2);return g(p.onInputLeadTime(n,i))}),r()()}if(a&2){let e=s(),t=e.$implicit,n=e.index;l(),c("name","LeadTime"+n),f("ngModel",t.LeadTime),c("id","leadTime"+n)}}function it(a,m){if(a&1){let e=D();o(0,"div",49)(1,"div",50)(2,"span",51),d(3),T(4,"number"),r(),w(5,"i",52),o(6,"div",53)(7,"input",54),T(8,"quantityFraction"),y("ngModelChange",function(n){u(e);let i=s(2).$implicit,p=s(2);return g(p.onInputROP(n,i))}),r()()()()}if(a&2){let e=s(2),t=e.$implicit,n=e.index,i=s(2);l(3),x(" ",R(4,5,i.getOriginalROP(t))," "),l(4),c("decimalPlaces",i.ropDecimalPlaces)("name","ROP"+n)("ngModel",R(8,7,t.ROP))("id","ROP"+n)}}function at(a,m){if(a&1&&(o(0,"span",46),d(1),T(2,"number"),r()),a&2){let e=s(2).$implicit;l(),x(" ",R(2,1,e.ROP)," ")}}function ot(a,m){if(a&1&&(o(0,"td",46),O(1,it,9,9,"div",48)(2,at,3,3,"span",41),r()),a&2){let e=s().$implicit;l(),c("ngIf",e.LeadTime),l(),c("ngIf",!e.LeadTime)}}function rt(a,m){if(a&1&&(o(0,"tr")(1,"td")(2,"a",45),d(3),r()(),o(4,"td"),d(5),r(),o(6,"td",46),d(7),T(8,"quantityFraction"),r(),o(9,"td",46),d(10),T(11,"number"),r(),o(12,"td",46),d(13),T(14,"number"),r(),o(15,"td",46)(16,"div"),d(17),r()(),O(18,nt,2,3,"td",41)(19,ot,3,2,"td",41),r()),a&2){let e=m.$implicit,t=s(2);l(2),c("queryParams",ie(27,Xe,e.ID)),l(),x(" ",e.Name," "),l(2),ee(e.Code),l(2),x(" ",R(8,19,e.Available)," "),l(3),x(" ",H(11,21,e.QtySoldPerDay,"1.0-2")," "),l(3),x(" ",e.QtySoldPerDay<0?"-":H(14,24,e.DaysOf,"1.0-0")," "),l(3),$("text-negative",e.DaysOfRiskType===t.riskType.negative)("text-empty",e.DaysOfRiskType===t.riskType.empty)("text-critical",e.DaysOfRiskType===t.riskType.critical)("text-optimal",e.DaysOfRiskType===t.riskType.optimal)("text-overstock",e.DaysOfRiskType===t.riskType.overstock),l(),x(" ",e.DaysOfRisk," "),l(),c("ngIf",t.pageData().Filter.TargetOutlet),l(),c("ngIf",t.pageData().Filter.TargetOutlet)}}function lt(a,m){a&1&&(o(0,"td",46)(1,"span"),d(2,"Bulk Lead Time "),r()())}function st(a,m){if(a&1){let e=D();o(0,"td")(1,"input",55),y("ngModelChange",function(n){u(e);let i=s(2);return g(i.onBulkUpdateLT(n))}),r()()}if(a&2){let e=s(2);l(),c("ngModel",e.bulkUpdateLTValue())("id","LT")}}function pt(a,m){if(a&1){let e=D();o(0,"div",28)(1,"div",29)(2,"table",30),y("matSortChange",function(n){u(e);let i=s();return g(i.sortData(n))}),o(3,"thead",31)(4,"tr")(5,"th",32),d(6,"Product"),r(),o(7,"th",33),d(8,"Code"),r(),o(9,"th",34),d(10," Available "),r(),o(11,"th",35),d(12," SOLD/DAY "),r(),o(13,"th",36),d(14," Days Of "),r(),o(15,"th",37),d(16," Risk "),r(),O(17,et,2,0,"th",38)(18,tt,2,1,"th",39),r()(),o(19,"tbody"),O(20,rt,20,29,"tr",40),r(),o(21,"tfoot")(22,"tr"),w(23,"td")(24,"td")(25,"td")(26,"td")(27,"td"),O(28,lt,3,0,"td",41),Z(29,st,2,2,"td"),r()()()(),o(30,"div")(31,"POS-complex-pagination",42),y("jumpToPage",function(){u(e);let n=s();return g(n.getListData())})("previousPage",function(){u(e);let n=s();return g(n.getListData())})("nextPage",function(){u(e);let n=s();return g(n.getListData())}),C("reloadRowCountChange",function(n){u(e);let i=s();return h(i.reloadRowCount,n)||(i.reloadRowCount=n),g(n)}),r()()()}if(a&2){let e,t=s();l(11),c("matTooltip","Based on Last "+t.pageData().Filter.NumberOfDays+" Days Sold"),l(6),c("ngIf",t.pageData().Filter.TargetOutlet),l(),c("ngIf",t.pageData().Filter.TargetOutlet),l(2),c("ngForOf",t.data().Data),l(8),c("ngIf",t.pageData().Filter.TargetOutlet&&t.data().Data.length>0),l(),K(t.pageData().Filter.TargetOutlet&&t.data().Data.length>0?29:-1),l(2),c("total",t.data().Data.length)("totalAllData",(e=t.data())==null?null:e.ListTotal)("pageData",t.pageData()),f("reloadRowCount",t.reloadRowCount)}}var He=class a extends we{constructor(e,t,n,i,p,_){super(e,t,"Inventory/DayOf","InventoryLoader/DaysOf",void 0,_,!0);this.httpService=t;this.csvConverter=i;this.roleService=p}httpService;csvConverter;roleService;dialog=v(Ie);fractionData=v(Ce);locale=v(oe);riskType=z;get ropDecimalPlaces(){return this.fractionData.quantity.maximumFraction}formatQuantityFraction(e){let t=`1.${this.fractionData.quantity.minimumFraction}-${this.fractionData.quantity.maximumFraction}`;return se(e,this.locale,t)}ListUpdateROP=V([]);listOutlet=V([]);bulkUpdateLTValue=le("");toastr=v(S);originalROPValues=V(new Map);rawROPValues=V([]);subTotalROP=re(()=>this.ListUpdateROP()?this.ListUpdateROP().reduce((e,t)=>e+Number(t.Value),0).toFixed(3):0);postInit(e){this.rawROPValues.set(e.Data),this.ListUpdateROP.set([]),this.originalROPValues.set(new Map)}preInitList(){this.menuData().H="Days of Inventory"}onInputLeadTime(e,t){if(k.IsEmpty(e)||e===0){this.rawROPValues().find(F=>F.ID===t.ID)&&(t.LeadTime="",t.ROP=this.getOriginalROP(t)),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}));return}let n=this.originalROPValues();n.has(t.ID)||(n.set(t.ID,t.ROP),this.originalROPValues.set(new Map(n)));let i=this.fractionData.quantity.maximumFraction,p=e*t.QtySoldPerDay;t.ROP=parseFloat(p.toFixed(i)),this.ListUpdateROP.update(_=>[..._.filter(qe=>qe.Key!==t.ID),{Key:t.ID,Value:this.formatQuantityFraction(t.ROP)}])}onInputROP(e,t){if(e){let n=this.fractionData.quantity.maximumFraction,i=parseFloat(e.toFixed(n));t.ROP=i,this.ListUpdateROP.update(p=>[...p.filter(F=>F.Key!==t.ID),{Key:t.ID,Value:this.formatQuantityFraction(i)}])}}getOriginalROP(e){return this.originalROPValues().get(e.ID)||e.ROP}get outletSelected(){if(this.listOutlet().length>0&&this.pageData().Filter.TargetOutlet){let e=this.listOutlet().findIndex(t=>t.k===this.pageData().Filter.TargetOutlet);if(e!==-1)return this.listOutlet()[e].v}return""}getOutlets(e){console.log(e),this.listOutlet.set(e)}onSubmitROP(){let e={ListUpdateROP:[...this.ListUpdateROP()],EntityID:this.pageData().Filter.TargetOutlet};this.httpService.post(q.UpdateROP,e).pipe(je("response"),J(t=>{this.toastr.success("ROP has been updated successfully.","Success!"),this.originalROPValues.set(new Map),this.getListData(),this.ListUpdateROP.set([]),this.bulkUpdateLTValue.set("")})).subscribe()}resetOriginalROP(e){let t=this.originalROPValues();t.has(e.ID)&&(t.delete(e.ID),this.originalROPValues.set(new Map(t)))}updateRop(e,t){this.dialog.open(B).afterClosed().pipe(G(n=>k.IsNotEmpty(n)),Y(n=>{let i={VariantID:e.ID,ListEntityID:n,ROP:e.ROP};return this.httpService.post(q.UpdateROP,i)})).subscribe(()=>{this.clearInput(`leadTime${t}`),this.toastr.success("ROP has been updated successfully.","Success!"),this.getListData()})}clearInput(e){let t=document.getElementById(e);t&&(t.value="")}openExportModal(){this.dialog.open(Fe,{data:{title:"Days of Inventory",exportTypes:[{ID:"InventoryExport/GetDaysOfExport",Value:"Default",FileName:"Days of Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"Inventory/DayOfCount",pagination:!0}})}sortData(e){let t=[...this.data().Data];if(!e.active||e.direction===""){this.data.set(b(P({},this.data()),{Data:[...t]}));return}let n=t.sort((i,p)=>{let _=e.direction==="asc";switch(e.active){case"Name":return I(i.Name,p.Name,_);case"Code":return I(i.Code,p.Code,_);case"QtySold":return I(i.QtySold,p.QtySold,_);case"QtySoldPerDay":return I(i.QtySoldPerDay,p.QtySoldPerDay,_);case"OnHand":return I(i.OnHand,p.OnHand,_);case"Available":return I(i.Available,p.Available,_);case"DaysOf":return I(i.DaysOf,p.DaysOf,_);default:return 0}});this.data.set(b(P({},this.data()),{Data:[...n]}))}onBulkUpdateLT(e){let t=this.originalROPValues(),n=this.rawROPValues();if(k.IsEmpty(e)){this.bulkUpdateLTValue.set(""),this.data.set(b(P({},this.data()),{Data:n.map(p=>b(P({},p),{LeadTime:null}))}));return}let i=+e;if(this.bulkUpdateLTValue.set(i),!!this.data()?.Data){for(let p of this.data().Data)t.has(p.ID)||t.set(p.ID,p.ROP),p.LeadTime=i,p.ROP=i*(p.QtySoldPerDay||0);this.originalROPValues.set(new Map(t)),this.ListUpdateROP.set(this.data().Data.map(p=>({Key:p.ID,Value:this.formatQuantityFraction(p.ROP)}))),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}))}}onCriticalChange(e){let t=this.pageData().Filter.ExceedDaysThreshold;e>=t&&(this.pageData().Filter.ExceedDaysThreshold=e+1)}onOverstockChange(e){let t=this.pageData().Filter.CriticalDaysThreshold;e<=t&&(this.pageData().Filter.ExceedDaysThreshold=t+1)}static \u0275fac=function(t){return new(t||a)(M(Ee),M(_e),M(S),M(ke),M(he),M(me))};static \u0275cmp=L({type:a,selectors:[["app-days-of-inventory"]],inputs:{bulkUpdateLTValue:[1,"bulkUpdateLTValue"]},outputs:{bulkUpdateLTValue:"bulkUpdateLTValueChange"},features:[X],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","textChange","pageData","text","isFilterOnDropdown"],["ngProjectAs","actions",5,["actions"]],["class","btn btn-outline-secondary me-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary","role","button",3,"matTooltip","click",4,"ngIf"],["ngProjectAs","filters",5,["filters"]],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-2",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-outline-secondary",3,"click","matTooltip"],[1,"fa-solid","fa-save","me-3"],["placeholder","Choose Outlets",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["matTooltip","Number of past days used to calculate average daily sales for inventory planning","matTooltipPosition","above",1,"fa-light","fa-circle-info",2,"cursor","pointer"],["autoNum","","min","1",1,"form-control",3,"ngModelChange","ngModel"],[1,"threshold-compact-wrapper"],[1,"threshold-row"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-critical",3,"ngModelChange","ngModel"],[1,"threshold-bar-container"],[1,"threshold-bar"],["matTooltip","Critical","matTooltipPosition","above",1,"bar-segment","seg-critical"],["matTooltip","Optimal","matTooltipPosition","above",1,"bar-segment","seg-optimal"],["matTooltip","Overstock","matTooltipPosition","above",1,"bar-segment","seg-overstock"],[1,"threshold-bar-labels"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-overstock",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","All",1,"ng-select",3,"ngModelChange","items","clearable","ngModel"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","onListOutlets","multiple","accessType","ngModel"],["name","IndirectAllocated",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","125px"],["mat-sort-header","Available","matTooltip","Inventory available for sale","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","QtySoldPerDay","arrowPosition","before",1,"text-end",2,"width","100px",3,"matTooltip"],["mat-sort-header","DaysOf","arrowPosition","before","matTooltip","How many days left until you run out of inventory",1,"text-end",2,"width","100px"],["mat-sort-header","DaysOfRisk","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 80px","matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order","class","text-end",4,"ngIf"],["class","text-end","style","width: 120px",3,"matTooltip",4,"ngIf"],[4,"ngFor","ngForOf"],["class","text-end",4,"ngIf"],["api","Inventory/DayOfCount",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],["matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order",1,"text-end",2,"width","80px"],[1,"text-end",2,"width","120px",3,"matTooltip"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","name","ngModel","id"],["class","rop-comparison",4,"ngIf"],[1,"rop-comparison"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],[1,"old-value"],[1,"fa-solid","fa-arrow-right","text-muted"],[1,"input-group","input-group-sm",2,"width","70px"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","decimalPlaces","name","ngModel","id"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","id"]],template:function(t,n){if(t&1){let i=D();o(0,"mainpanel-cmp",1),y("onSubmit",function(){return n.getListData()}),C("textChange",function(_){return u(i),h(n.pageData().Filter.FilterText,_)||(n.pageData().Filter.FilterText=_),g(_)}),Q(1,2),O(2,Ze,3,0,"button",3)(3,Ke,3,1,"button",4),j(),Q(4,5),O(5,$e,37,20,"ng-template",null,0,ae),j(),o(7,"content"),O(8,pt,32,10,"div",6),r()()}t&2&&(c("pageData",n.menuData()),f("text",n.pageData().Filter.FilterText),c("isFilterOnDropdown",!1),l(2),c("ngIf",n.roleService.global.Export),l(),c("ngIf",n.ListUpdateROP().length>0),l(5),c("ngIf",n.data()))},dependencies:[E,pe,ce,We,Ne,Re,U,ye,N,W,A,ge,ue,Qe,Be,Ae,ve,De,fe,Me,Pe,be,Ue,Ve,Se,de,Le],styles:[".threshold-compact-wrapper[_ngcontent-%COMP%]{background:#f8f9fa;border-radius:8px;padding:.6rem .75rem;margin:.25rem 0 1rem;border:1px solid #e9ecef}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]{width:48px;text-align:center;font-size:.75rem;font-weight:600;border-radius:6px;border:1.5px solid #e5e7eb;padding:.3rem .15rem;background:#fff;color:#374151;flex-shrink:0;transition:all .15s ease}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]:focus{outline:none}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]{border-color:#f5f0a6}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]:focus{border-color:#fff44f;box-shadow:0 0 0 2px #fff44f1f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]{border-color:#96b0f7}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]:focus{border-color:#3581d8;box-shadow:0 0 0 2px #3581d81f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem;min-width:0}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%]{display:flex;height:10px;border-radius:5px;overflow:hidden;box-shadow:inset 0 1px 2px #00000014}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment[_ngcontent-%COMP%]{flex:1;transition:background .3s ease;cursor:pointer}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]{background:#fff44f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]:hover{background:#f7e817}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]{background:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]:hover{background:#388e3c}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]{background:#3581d8}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]:hover{background:#2c58af}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.55rem;font-weight:500;color:#9ca3af;padding:0 2px}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){color:#a39800}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){color:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){color:#3581d8}.text-negative[_ngcontent-%COMP%]{color:#a61b29}.text-empty[_ngcontent-%COMP%]{color:#d82e3f}.text-critical[_ngcontent-%COMP%]{color:#e8c73a}.text-optimal[_ngcontent-%COMP%]{color:#28cc2d}.text-overstock[_ngcontent-%COMP%]{color:#3581d8}"],changeDetection:0})};function I(a,m,e){return a===null||a===""?e?-1:1:m===null||m===""?e?1:-1:typeof a=="string"&&typeof m=="string"?a.localeCompare(m)*(e?1:-1):typeof a=="number"&&typeof m=="number"?(a<m?-1:1)*(e?1:-1):typeof a=="string"&&typeof m=="number"?e?-1:1:typeof a=="number"&&typeof m=="string"?e?1:-1:0}export{He as DaysOfInventoryComponent};
@@ -1 +1 @@
1
- import{a as S,b as n,c as g}from"./chunk-OKQYRKDJ.js";import{a as f}from"./chunk-HFBLFS5K.js";import{a}from"./chunk-PPTZHIIZ.js";import{n as v}from"./chunk-ETYXTCKV.js";import{H as h,M as r,d as i,e as o,ja as u,k as l,m as c,ma as b,na as C}from"./chunk-DUSKF5IQ.js";var p=class s{constructor(e){this.toastr=e;this.socketConnection=new g().withUrl("/POSHub").withAutomaticReconnect().configureLogging(S.Information).build(),this.registerEventHandler(),this.connectivity.online$.subscribe(t=>{t&&this.socketConnection.state===n.Disconnected&&(console.log("Internet back online, reconnecting SignalR..."),this.startConnection())})}toastr;lastGroupID;OnPaymentReceived=new i;OnReceivePushNotification=new i;OnContactReceive=new i;OnPromotionEventChange=new i;_recacheOutlet=new o(!1);recacheOutlet$=this._recacheOutlet.asObservable();_recacheCategory=new o(!1);recacheCategory$=this._recacheCategory.asObservable();_recacheSalesPerson=new o(!1);recacheSalesPerson$=this._recacheSalesPerson.asObservable();socketConnection;connectionStateSubject=new i;connectivity=C(f);startConnection(){if(!this.connectivity.isOnline){console.warn("SignalR: Skipping connection, app is offline.");return}this.socketConnection.state==n.Disconnected&&this.socketConnection.start().then(()=>{console.info("SignalR Connected"),this.connectionStateSubject.next(!0)}).catch(e=>console.error("SignalR Start Error:",e))}SubscribeGroup(e,t=null){if(e!=this.lastGroupID){if(!this.connectivity.isOnline){console.warn("SignalR: Cannot subscribe group while offline.");return}this.socketConnection.state==n.Disconnected?(this.startConnection(),this.connectionStateSubject.pipe(r(1)).subscribe(()=>{this.invokeSubscribe(e,t)})):this.socketConnection.state==n.Connecting?this.connectionStateSubject.pipe(r(1)).subscribe(()=>{this.invokeSubscribe(e,t)}):this.socketConnection.state==n.Connected&&this.invokeSubscribe(e,t)}}invokeSubscribe(e,t){let k={CurrentID:e,PreviousID:t};this.socketConnection.invoke("SubscribeGroup",k).then(()=>{console.info(`SignalR Subscribed to Group: [${e}]`),this.lastGroupID=e}).catch(m=>{console.error(m)})}registerEventHandler(){this.socketConnection.on("ReceiveMobilePaymentSignal",e=>{this.OnPaymentReceived.next(e)}),this.socketConnection.on("OnContactReceive",e=>{this.OnContactReceive.next(e)}),this.socketConnection.on("ReceiveNewPromotionSignal",e=>{this.OnPromotionEventChange.next(e)}),this.socketConnection.on("ReceivePushNotificationSignal",e=>{this.OnReceivePushNotification.next(e)}),this.socketConnection.on("ReceiveOutletChanges",()=>{this._recacheOutlet.next(!0)}),this.socketConnection.on("ReceiveProductCategoryChanges",()=>{this._recacheCategory.next(!0)}),this.socketConnection.on("ReceiveSalesPersonChanges",()=>{this._recacheSalesPerson.next(!0)})}isSocketConnected(){return a.IsEmpty(this.socketConnection)?!1:this.socketConnection.state==n.Connected&&a.IsNotEmpty(this.socketConnection.connectionId)}broadcast(e){return this.connectivity.isOnline?this.isSocketConnected()?l(this.socketConnection.invoke("BroadCast",e)).pipe(h(t=>(this.toastr.error(t,"Error"),c(()=>t)))):c(()=>"SignalR is not connected"):c(()=>"Anda sedang offline. Broadcast tidak dapat dikirim.")}resetOutletCache(){this._recacheOutlet.next(!1)}resetCategoryCache(){this._recacheCategory.next(!1)}resetSalesPersonCache(){this._recacheSalesPerson.next(!1)}static \u0275fac=function(t){return new(t||s)(b(v))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};export{p as a};
1
+ import{a as S,b as n,c as g}from"./chunk-OKQYRKDJ.js";import{a as f}from"./chunk-IIARVTAV.js";import{a}from"./chunk-PPTZHIIZ.js";import{n as v}from"./chunk-ETYXTCKV.js";import{H as h,M as r,d as i,e as o,ja as u,k as l,m as c,ma as b,na as C}from"./chunk-DUSKF5IQ.js";var p=class s{constructor(e){this.toastr=e;this.socketConnection=new g().withUrl("/POSHub").withAutomaticReconnect().configureLogging(S.Information).build(),this.registerEventHandler(),this.connectivity.online$.subscribe(t=>{t&&this.socketConnection.state===n.Disconnected&&(console.log("Internet back online, reconnecting SignalR..."),this.startConnection())})}toastr;lastGroupID;OnPaymentReceived=new i;OnReceivePushNotification=new i;OnContactReceive=new i;OnPromotionEventChange=new i;_recacheOutlet=new o(!1);recacheOutlet$=this._recacheOutlet.asObservable();_recacheCategory=new o(!1);recacheCategory$=this._recacheCategory.asObservable();_recacheSalesPerson=new o(!1);recacheSalesPerson$=this._recacheSalesPerson.asObservable();socketConnection;connectionStateSubject=new i;connectivity=C(f);startConnection(){if(!this.connectivity.isOnline){console.warn("SignalR: Skipping connection, app is offline.");return}this.socketConnection.state==n.Disconnected&&this.socketConnection.start().then(()=>{console.info("SignalR Connected"),this.connectionStateSubject.next(!0)}).catch(e=>console.error("SignalR Start Error:",e))}SubscribeGroup(e,t=null){if(e!=this.lastGroupID){if(!this.connectivity.isOnline){console.warn("SignalR: Cannot subscribe group while offline.");return}this.socketConnection.state==n.Disconnected?(this.startConnection(),this.connectionStateSubject.pipe(r(1)).subscribe(()=>{this.invokeSubscribe(e,t)})):this.socketConnection.state==n.Connecting?this.connectionStateSubject.pipe(r(1)).subscribe(()=>{this.invokeSubscribe(e,t)}):this.socketConnection.state==n.Connected&&this.invokeSubscribe(e,t)}}invokeSubscribe(e,t){let k={CurrentID:e,PreviousID:t};this.socketConnection.invoke("SubscribeGroup",k).then(()=>{console.info(`SignalR Subscribed to Group: [${e}]`),this.lastGroupID=e}).catch(m=>{console.error(m)})}registerEventHandler(){this.socketConnection.on("ReceiveMobilePaymentSignal",e=>{this.OnPaymentReceived.next(e)}),this.socketConnection.on("OnContactReceive",e=>{this.OnContactReceive.next(e)}),this.socketConnection.on("ReceiveNewPromotionSignal",e=>{this.OnPromotionEventChange.next(e)}),this.socketConnection.on("ReceivePushNotificationSignal",e=>{this.OnReceivePushNotification.next(e)}),this.socketConnection.on("ReceiveOutletChanges",()=>{this._recacheOutlet.next(!0)}),this.socketConnection.on("ReceiveProductCategoryChanges",()=>{this._recacheCategory.next(!0)}),this.socketConnection.on("ReceiveSalesPersonChanges",()=>{this._recacheSalesPerson.next(!0)})}isSocketConnected(){return a.IsEmpty(this.socketConnection)?!1:this.socketConnection.state==n.Connected&&a.IsNotEmpty(this.socketConnection.connectionId)}broadcast(e){return this.connectivity.isOnline?this.isSocketConnected()?l(this.socketConnection.invoke("BroadCast",e)).pipe(h(t=>(this.toastr.error(t,"Error"),c(()=>t)))):c(()=>"SignalR is not connected"):c(()=>"Anda sedang offline. Broadcast tidak dapat dikirim.")}resetOutletCache(){this._recacheOutlet.next(!1)}resetCategoryCache(){this._recacheCategory.next(!1)}resetSalesPersonCache(){this._recacheSalesPerson.next(!1)}static \u0275fac=function(t){return new(t||s)(b(v))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};export{p as a};