dealpos 25.47.0 → 25.47.2

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 (160) hide show
  1. package/browser/{chunk-K4LLK7O5.js → chunk-2B5OZGVM.js} +1 -1
  2. package/browser/{chunk-2RERZJD4.js → chunk-2MCEIRJY.js} +1 -1
  3. package/browser/{chunk-HV4KV3DJ.js → chunk-3FYNWZYY.js} +1 -1
  4. package/browser/{chunk-E2DUJTA4.js → chunk-3OHHXDTW.js} +1 -1
  5. package/browser/{chunk-FR66DARJ.js → chunk-3YOY54TO.js} +1 -1
  6. package/browser/{chunk-FY2ZQK3Q.js → chunk-3ZL5OQ6Y.js} +1 -1
  7. package/browser/{chunk-647PQZMJ.js → chunk-44RMDJGQ.js} +1 -1
  8. package/browser/{chunk-2LSFBE4Q.js → chunk-4CKBIRQ2.js} +1 -1
  9. package/browser/{chunk-5OKSTEWQ.js → chunk-4U2TXFUV.js} +1 -1
  10. package/browser/{chunk-KTPMM54V.js → chunk-4Y2FYXDF.js} +1 -1
  11. package/browser/{chunk-C5S5BG57.js → chunk-54OUVAKK.js} +1 -1
  12. package/browser/{chunk-2HOSLZ77.js → chunk-5BH2H4V6.js} +1 -1
  13. package/browser/{chunk-BATVMTNZ.js → chunk-5BLWYLXP.js} +1 -1
  14. package/browser/{chunk-RF5WGONA.js → chunk-5DQ4MJJT.js} +1 -1
  15. package/browser/{chunk-QIFQFG3V.js → chunk-5MJHW4YM.js} +1 -1
  16. package/browser/{chunk-HLML4BKF.js → chunk-5MWGLO24.js} +1 -1
  17. package/browser/{chunk-WDD7INF4.js → chunk-5QUOXOR7.js} +11 -11
  18. package/browser/{chunk-WBO7PC7R.js → chunk-5SJK4QC2.js} +1 -1
  19. package/browser/{chunk-LLEPB2B6.js → chunk-64RUCACD.js} +1 -1
  20. package/browser/{chunk-BYO7FJ4O.js → chunk-6GLKD66N.js} +1 -1
  21. package/browser/{chunk-XE46ZDV6.js → chunk-6PX2PA2J.js} +1 -1
  22. package/browser/{chunk-CAGQRIPG.js → chunk-6UMKFILJ.js} +1 -1
  23. package/browser/{chunk-NN2EFVJK.js → chunk-7GQF6UNI.js} +1 -1
  24. package/browser/{chunk-ROLAW5XO.js → chunk-7KAETFNH.js} +1 -1
  25. package/browser/{chunk-EZ5EW4QK.js → chunk-7SJB3DEF.js} +1 -1
  26. package/browser/{chunk-KBISFX5T.js → chunk-7WXQYKCT.js} +1 -1
  27. package/browser/chunk-A243LOWU.js +1 -0
  28. package/browser/{chunk-ZSW24KNO.js → chunk-A5MP4QMZ.js} +1 -1
  29. package/browser/{chunk-DWZLJMWC.js → chunk-ABNUBGXO.js} +1 -1
  30. package/browser/{chunk-APOV2ZYY.js → chunk-AEXXXOEQ.js} +1 -1
  31. package/browser/{chunk-ABO3BJKM.js → chunk-AMONIKLC.js} +1 -1
  32. package/browser/{chunk-INHUUGSI.js → chunk-AUBQH6JY.js} +1 -1
  33. package/browser/chunk-AVTYR2I6.js +1 -0
  34. package/browser/{chunk-DM4PGQEH.js → chunk-AZBA2YOQ.js} +2 -2
  35. package/browser/{chunk-QDE5Y76C.js → chunk-B3STLAM7.js} +1 -1
  36. package/browser/{chunk-QZMZBCE7.js → chunk-BA3BDB5Y.js} +1 -1
  37. package/browser/chunk-BCUIYEEN.js +1 -0
  38. package/browser/{chunk-OFTORAX4.js → chunk-BK4CA5K2.js} +1 -1
  39. package/browser/{chunk-H4DUHWPT.js → chunk-BVZ7ACQM.js} +1 -1
  40. package/browser/{chunk-EKORPCX3.js → chunk-BWXXYBLG.js} +1 -1
  41. package/browser/{chunk-ON47ICI3.js → chunk-C6YPXBIP.js} +1 -1
  42. package/browser/chunk-CLBQLTFG.js +4 -0
  43. package/browser/{chunk-PECGNYTX.js → chunk-CSFFF2YO.js} +1 -1
  44. package/browser/{chunk-P632SS2L.js → chunk-CUULWZUF.js} +1 -1
  45. package/browser/{chunk-QQ4DCXLE.js → chunk-D6HRDYFW.js} +1 -1
  46. package/browser/{chunk-HQ4NLUV6.js → chunk-DEGB7PBB.js} +1 -1
  47. package/browser/chunk-DPGY5YXC.js +1 -0
  48. package/browser/{chunk-NRF37QSD.js → chunk-E5XIALIA.js} +1 -1
  49. package/browser/chunk-EANAFODJ.js +1 -0
  50. package/browser/{chunk-IGNVHAO2.js → chunk-EQR3RN5K.js} +1 -1
  51. package/browser/{chunk-UBCB4G4S.js → chunk-F652VZDD.js} +1 -1
  52. package/browser/{chunk-EAFSL5ZF.js → chunk-FE5USLDO.js} +1 -1
  53. package/browser/{chunk-BCD363QF.js → chunk-FFNEDDOO.js} +1 -1
  54. package/browser/{chunk-ME5KGPYC.js → chunk-FFW4SP7H.js} +1 -1
  55. package/browser/{chunk-JVEVLEGH.js → chunk-FG3HLE5U.js} +1 -1
  56. package/browser/{chunk-DSQH2UQV.js → chunk-FHPFRT4L.js} +1 -1
  57. package/browser/{chunk-474F5EIO.js → chunk-FJC7EOO5.js} +1 -1
  58. package/browser/{chunk-ZXSVZL53.js → chunk-FNH6K4S4.js} +1 -1
  59. package/browser/chunk-FSBKLNRT.js +4 -0
  60. package/browser/{chunk-BKBSPC2U.js → chunk-G2VAG4V3.js} +1 -1
  61. package/browser/{chunk-5PUIMWNW.js → chunk-G5VELV3S.js} +1 -1
  62. package/browser/{chunk-6WEGHV7F.js → chunk-GN3HVOCN.js} +1 -1
  63. package/browser/{chunk-JWH2AZ3Z.js → chunk-GXVEYJWC.js} +1 -1
  64. package/browser/{chunk-L32BGRA6.js → chunk-GYNJFQPE.js} +1 -1
  65. package/browser/{chunk-UBXEYFKJ.js → chunk-H2SA27YZ.js} +1 -1
  66. package/browser/{chunk-BY57IAJ7.js → chunk-HD2QU6GJ.js} +1 -1
  67. package/browser/{chunk-27Y3MQJV.js → chunk-HVJHE6PQ.js} +1 -1
  68. package/browser/{chunk-P53EATPC.js → chunk-I2SL4ZPJ.js} +1 -1
  69. package/browser/{chunk-KEAT6AT3.js → chunk-I5W4NCFM.js} +1 -1
  70. package/browser/{chunk-EX4TE4E5.js → chunk-IDOZYC3I.js} +1 -1
  71. package/browser/chunk-IFOBYW26.js +1 -0
  72. package/browser/chunk-IVQ42QHP.js +5 -0
  73. package/browser/{chunk-MA6NB2EZ.js → chunk-JIPNMAEP.js} +1 -1
  74. package/browser/{chunk-GK4I3EKQ.js → chunk-JNORDOWT.js} +1 -1
  75. package/browser/{chunk-POJQGU7L.js → chunk-JR5LAUIS.js} +1 -1
  76. package/browser/{chunk-HTJJDQ3V.js → chunk-JYA7PGNK.js} +1 -1
  77. package/browser/{chunk-TH7SO4LD.js → chunk-L2V3KTC6.js} +1 -1
  78. package/browser/{chunk-ORQ3JDJE.js → chunk-LBZL2R6L.js} +1 -1
  79. package/browser/{chunk-Z7IU5JLK.js → chunk-LDTRYGRE.js} +1 -1
  80. package/browser/{chunk-DC426G2P.js → chunk-LOD3JYZW.js} +1 -1
  81. package/browser/{chunk-T5FBPKPS.js → chunk-LRXTFWOZ.js} +1 -1
  82. package/browser/{chunk-LWA7CCEY.js → chunk-M47WPS54.js} +3 -3
  83. package/browser/{chunk-WA4WWHYW.js → chunk-M4EGMZWI.js} +1 -1
  84. package/browser/{chunk-3HS4V7LK.js → chunk-MH7N5XSV.js} +3 -3
  85. package/browser/{chunk-IUDUQNN7.js → chunk-MUM4RT2P.js} +1 -1
  86. package/browser/{chunk-WH2BY5K4.js → chunk-MVUVDYGQ.js} +1 -1
  87. package/browser/chunk-NBMH5YL2.css +1 -0
  88. package/browser/{chunk-UE2HBW5H.js → chunk-NVCUDJUL.js} +1 -1
  89. package/browser/{chunk-PLWCVGTF.js → chunk-O2LFJOK7.js} +1 -1
  90. package/browser/{chunk-IT6GHGT4.js → chunk-OINIYEKP.js} +1 -1
  91. package/browser/{chunk-CX7CJIXK.js → chunk-OJM2IYYY.js} +2 -2
  92. package/browser/chunk-P3SYBLK4.js +21 -0
  93. package/browser/{chunk-MHVF2KXK.js → chunk-PACJK6XZ.js} +1 -1
  94. package/browser/{chunk-Q473GHR5.js → chunk-PEIXGMKS.js} +1 -1
  95. package/browser/{chunk-NX6ACGTN.js → chunk-PIZRVCBM.js} +1 -1
  96. package/browser/{chunk-GNODCFOP.js → chunk-PJCGIZLH.js} +1 -1
  97. package/browser/{chunk-BALKIB67.js → chunk-PKS7H624.js} +1 -1
  98. package/browser/{chunk-4JAEMXSQ.js → chunk-PSJRHKCL.js} +1 -1
  99. package/browser/{chunk-MSW23AJV.js → chunk-QDHSPK4B.js} +1 -1
  100. package/browser/{chunk-DGF2U27C.js → chunk-QGBQPCW2.js} +2 -2
  101. package/browser/{chunk-AIM6VG2H.js → chunk-QJD336PR.js} +1 -1
  102. package/browser/chunk-QLAA4AMU.js +1 -0
  103. package/browser/{chunk-SO4GMA3Y.js → chunk-QPOOLLKY.js} +1 -1
  104. package/browser/{chunk-HU3YNBXW.js → chunk-QVCQODGZ.js} +1 -1
  105. package/browser/chunk-QXWCGE56.js +1 -0
  106. package/browser/{chunk-WMUZZ5XX.js → chunk-RAQ5KDLF.js} +1 -1
  107. package/browser/{chunk-QVJJGWXC.js → chunk-RB6A4M7Y.js} +14 -14
  108. package/browser/{chunk-SGSO4UVM.js → chunk-RCW2TTR7.js} +1 -1
  109. package/browser/{chunk-ULYBLEXA.js → chunk-RJJYGGF6.js} +1 -1
  110. package/browser/{chunk-3YKXHA6Q.js → chunk-RMB6IO7X.js} +1 -1
  111. package/browser/{chunk-YG6ODXQF.js → chunk-RMU3G7EK.js} +1 -1
  112. package/browser/{chunk-FQSAJFS6.js → chunk-RNYFGIMB.js} +1 -1
  113. package/browser/{chunk-JKMJAL6Y.js → chunk-SIS55WCN.js} +2 -2
  114. package/browser/{chunk-RSN23KAR.js → chunk-SKDXVP3A.js} +1 -1
  115. package/browser/{chunk-IQDT5K5I.js → chunk-SQ3QIOE4.js} +1 -1
  116. package/browser/{chunk-RYTM3LHN.js → chunk-SUKZF5RZ.js} +1 -1
  117. package/browser/{chunk-XIXDLSA2.js → chunk-SVUUS5JD.js} +1 -1
  118. package/browser/{chunk-7EQG6N5Y.js → chunk-SWPKQM2X.js} +1 -1
  119. package/browser/{chunk-NZYZO47Z.js → chunk-T25N3EEG.js} +1 -1
  120. package/browser/{chunk-KD7WBOUR.js → chunk-T2H2XAEJ.js} +1 -1
  121. package/browser/{chunk-W3EZ4JHD.js → chunk-T4XIWNFQ.js} +1 -1
  122. package/browser/{chunk-GDS3XQ5F.js → chunk-T7DUQW7O.js} +1 -1
  123. package/browser/{chunk-7P3E5NJO.js → chunk-TEV65D26.js} +1 -1
  124. package/browser/{chunk-JEFUIFY4.js → chunk-TOUJ6K3E.js} +1 -1
  125. package/browser/{chunk-E3LGKC33.js → chunk-TUM5HKY7.js} +1 -1
  126. package/browser/{chunk-SKE3MW2D.js → chunk-TYX5PWAF.js} +1 -1
  127. package/browser/{chunk-P7UMAIIW.js → chunk-UTTEBWDI.js} +1 -1
  128. package/browser/{chunk-WBMSB25X.js → chunk-UTTKPBED.js} +1 -1
  129. package/browser/{chunk-MPAFCKH7.js → chunk-VAPCHGLS.js} +1 -1
  130. package/browser/{chunk-2JZS4BMV.js → chunk-VLHLS6LD.js} +1 -1
  131. package/browser/{chunk-YRGHPSPV.js → chunk-VX5HH3BW.js} +1 -1
  132. package/browser/{chunk-5L54U63F.js → chunk-W4W2KCYV.js} +1 -1
  133. package/browser/{chunk-SARJJ3AZ.js → chunk-WNZKCNMC.js} +1 -1
  134. package/browser/{chunk-MPE7Q4VX.js → chunk-XL7XI3DY.js} +1 -1
  135. package/browser/{chunk-QRTOTG7S.js → chunk-XNJ2P2ZO.js} +1 -1
  136. package/browser/{chunk-6TGKH2KC.js → chunk-XORANKYI.js} +1 -1
  137. package/browser/{chunk-O5IZN23R.js → chunk-XVAFOEWU.js} +2 -2
  138. package/browser/{chunk-3XKRDZSE.js → chunk-YQUQYWX3.js} +1 -1
  139. package/browser/{chunk-YMLCHH2G.js → chunk-ZEGLCDLU.js} +1 -1
  140. package/browser/{chunk-P6NP3EAO.js → chunk-ZJDY54VM.js} +1 -1
  141. package/browser/{chunk-M5KE2CW7.js → chunk-ZQHJ2WC2.js} +1 -1
  142. package/browser/chunk-ZVOEO2AC.js +3 -0
  143. package/browser/index.html +2 -2
  144. package/browser/main-WPNH2WGQ.css +1 -0
  145. package/browser/{main-VVZRGXWB.js → main-Z44VJHQT.js} +2 -2
  146. package/package.json +1 -1
  147. package/browser/chunk-4ZXLS56M.js +0 -4
  148. package/browser/chunk-5ZFCEP2C.css +0 -1
  149. package/browser/chunk-6SC4T77S.js +0 -1
  150. package/browser/chunk-D6Y2NJT7.js +0 -1
  151. package/browser/chunk-FIMFYHCK.js +0 -4
  152. package/browser/chunk-G5QWJMKY.js +0 -1
  153. package/browser/chunk-GI7KMXBX.js +0 -21
  154. package/browser/chunk-I2P6B3IK.js +0 -1
  155. package/browser/chunk-IR2QPNXA.js +0 -5
  156. package/browser/chunk-KUYGPZRD.js +0 -1
  157. package/browser/chunk-LEGL2HWF.js +0 -1
  158. package/browser/chunk-MMP7HKXF.js +0 -1
  159. package/browser/chunk-WY6RTBDA.js +0 -3
  160. package/browser/main-5IXVIJ7Z.css +0 -1
@@ -1,14 +1,14 @@
1
- import{a as ri,b as Gr}from"./chunk-RNXOIUIO.js";import{a as Yr}from"./chunk-ZSW24KNO.js";import{a as Mt,b as Hr}from"./chunk-AQQHMGYE.js";import{a as Ht,b as Qr}from"./chunk-7EQG6N5Y.js";import{a as Hn,b as Oi}from"./chunk-GDRHD33K.js";import{a as oi}from"./chunk-2MQDNPCG.js";import{a as De}from"./chunk-6TGKH2KC.js";import{a as ze}from"./chunk-LBQRCFLJ.js";import{a as Gn}from"./chunk-3PC6CTVP.js";import{a as gt}from"./chunk-2LOWEWI4.js";import{a as cr}from"./chunk-ZEKZLSGA.js";import{b as gr}from"./chunk-KEAT6AT3.js";import"./chunk-WH2BY5K4.js";import{a as Bi}from"./chunk-HLML4BKF.js";import"./chunk-6H5P35AP.js";import{a as Ar}from"./chunk-DLNZDHGS.js";import{a as Rr,b as kr,d as Wr,g as Nr}from"./chunk-RF5WGONA.js";import"./chunk-BYXBJQAS.js";import{a as Vi}from"./chunk-R4OHTTCT.js";import{a as Ir,b as br}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{e as _r}from"./chunk-INHUUGSI.js";import{a as Er,b as Mr,c as Vr,d as Br,e as Or,f as Lr}from"./chunk-P632SS2L.js";import"./chunk-KHR4NBM3.js";import"./chunk-TH7SO4LD.js";import"./chunk-H7XFYY6V.js";import"./chunk-XACC6EMJ.js";import{a as te}from"./chunk-HL3ONSX6.js";import{a as Z}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{a as Ei,b as Fr,c as An,d as J,e as Mi}from"./chunk-SO4GMA3Y.js";import{a as Vn,b as Ti}from"./chunk-PECGNYTX.js";import"./chunk-3RK6DDJD.js";import{a as Mn}from"./chunk-SARJJ3AZ.js";import{a as Dn,b as vn,c as wn,f as Fn,g as In,h as bn,p as wi,q as En}from"./chunk-DC426G2P.js";import"./chunk-3KSZCJ6T.js";import"./chunk-BYO7FJ4O.js";import"./chunk-CBSYYTXQ.js";import{c as ur,d as Te,e as Nn}from"./chunk-6WEGHV7F.js";import"./chunk-G4IW5GPY.js";import{a as Pi}from"./chunk-EKORPCX3.js";import{a as pe,b as Ce,c as sr}from"./chunk-APOV2ZYY.js";import{a as Et,b as Pr}from"./chunk-I3ABVEQL.js";import{d as vr,f as fe}from"./chunk-BCD363QF.js";import{a as wr,b as Tr,c as U}from"./chunk-SKE3MW2D.js";import{b as K}from"./chunk-KD7WBOUR.js";import{a as me}from"./chunk-GK4I3EKQ.js";import{a as mr}from"./chunk-5PUIMWNW.js";import"./chunk-QFON23YX.js";import"./chunk-FIUZN6JU.js";import{a as q}from"./chunk-4QM23MMO.js";import{e as A,f as bi}from"./chunk-BALKIB67.js";import"./chunk-HV4KV3DJ.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as Cr}from"./chunk-YRGHPSPV.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import"./chunk-M43HNBJQ.js";import{a as fr,c as Ue}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{d as Dr}from"./chunk-5OKSTEWQ.js";import{b as N}from"./chunk-QRTOTG7S.js";import"./chunk-CS6HBROS.js";import"./chunk-JUS6LLVX.js";import{C as kn,F as Ne,G as Wn,j as Tn,m as Pn,t as dr,u as Fi,v as ni,w as On}from"./chunk-QZMZBCE7.js";import{b as ae,c as yn}from"./chunk-C4WJKF7R.js";import{A as Rn,B as Sr,C as ai,K as Ii,N as yr,g as se,o as xr,s as Ln,z as hr}from"./chunk-NZYZO47Z.js";import{a as Bn,d as $}from"./chunk-7TBS7SPQ.js";import"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{b as xn,e as ti,f as ii,g as z}from"./chunk-A45GTZVV.js";import"./chunk-NWSIPELM.js";import{a as rr}from"./chunk-6SGN7MNX.js";import{c as or,j as lr,k as Xi,l as pr}from"./chunk-L76WVZW6.js";import{a as Ki}from"./chunk-2FWFPV5I.js";import{oa as hn,pa as Sn,xa as ar}from"./chunk-O5SLP4JK.js";import{F as Gt,G as fn,a as $o,b as er,c as Qe,h as L,l as tr,o as k,q as ir,s as nr}from"./chunk-RNLSEEMX.js";import"./chunk-H4DUHWPT.js";import"./chunk-ROLAW5XO.js";import{a as V,d as Y}from"./chunk-USJ6ILEE.js";import"./chunk-4ZXLS56M.js";import{$b as Ut,$d as zi,Ab as G,Bb as H,Bc as d,Ca as dt,Cb as c,Cc as g,Db as n,Dc as v,E as mi,Eb as a,Ec as Si,Ed as Zo,Fb as b,Hc as O,I as Yi,Ia as fo,Ja as No,Jb as pt,Jc as jo,K as Lo,Kb as mt,Kc as yi,Lb as Ho,Lc as un,M as Ro,Ma as Ao,Mb as I,Ob as P,Oc as qo,Pc as Di,Q as an,Qa as Ee,Qb as m,Sa as ln,Tb as xo,Tc as _n,Ub as cn,Vb as fi,Vc as Uo,Wb as xi,Wd as We,Xa as o,Xc as ho,Y as Nt,Ya as pn,Yc as zo,Yd as Cn,Zc as Ko,Zd as Q,_b as Dt,aa as Co,ac as qi,bc as Qo,be as qe,cc as Ui,cd as Ze,db as w,dc as p,ec as F,ed as st,ee as R,fa as At,fc as D,fd as it,gc as ei,hb as B,ib as Ci,ic as f,jb as mn,jc as x,jd as Xo,ka as ko,kc as h,kd as gn,la as on,lb as W,ma as gi,mb as sn,md as re,na as $t,nb as E,o as _i,oc as Ct,od as ne,pa as Fe,rd as vi,sc as hi,t as qt,ta as u,tb as si,tc as M,td as Jo,u as go,ua as _,uc as X,vb as S,vc as ue,wb as Go,wc as _t,xa as rn,xb as y,xc as zt,yb as ji,yc as dn,za as Wo,zb as j,zc as Yo}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{a as tt,b as nt,f as Ql,h as Zt,k as Qi}from"./chunk-SNAKHGZS.js";var bo=Ql((Ji,Io)=>{(function(i,s){typeof Ji=="object"&&typeof Io=="object"?Io.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Ji=="object"?Ji["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Ji:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var oe=r[ye];if(oe!==void 0)return oe.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var oe=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(oe,{a:oe}),oe},t.d=(ye,oe)=>{for(var Ve in oe)t.o(oe,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:oe[Ve]})},t.o=(ye,oe)=>Object.prototype.hasOwnProperty.call(ye,oe);var l={};t.d(l,{default:()=>Hl});var C=t(944),T=t.n(C),$e=t(984),Ai=t.n($e);let Gi={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function $i(ye,oe,Ve,he,at,Ge){let ee=(Ge-oe)*(Ve-ye)-(he-oe)*(at-ye);return ee>0||!(ee<0)}function en(ye,oe,Ve,he,at,Ge,ee,Le){return $i(ye,oe,at,Ge,ee,Le)!==$i(Ve,he,at,Ge,ee,Le)&&$i(ye,oe,Ve,he,at,Ge)!==$i(ye,oe,Ve,he,ee,Le)}let{animObject:_o}=T(),{format:Ol}=Ai(),{setOptions:Ll}=T(),{composed:Rl}=T(),{boxIntersectLine:Eo,intersectRect:kl}={boxIntersectLine:function(ye,oe,Ve,he,at,Ge,ee,Le){return en(ye,oe,ye+Ve,oe,at,Ge,ee,Le)||en(ye+Ve,oe,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe+he,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe,ye,oe+he,at,Ge,ee,Le)},intersectRect:function(ye,oe){return!(oe.left>ye.right||oe.right<ye.left||oe.top>ye.bottom||oe.bottom<ye.top)}},{addEvent:Mo,extend:Vo,fireEvent:Wl,isNumber:tn,pick:Kt,pushUnique:Nl,syncTimeout:Al}=T();function di(ye,oe,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=Kt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Xt,It,et,Be;for(et=0;ct&&et<ct.length;et+=1)if(kl(ct[et],{left:oe,right:oe+he.width,top:Ve,bottom:Ve+he.height}))return!1;for(et=0;et<Ge.series.length;et+=1){let ut=Ge.series[et],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=oe-16&&Re[Be-1].chartX<=oe+he.width+16){if(Eo(oe,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Eo(oe-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Xt=oe+he.width/2-Re[Be].chartX)*Xt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(oe+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:oe,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Bo(ye){if(this.renderer){let oe=this,Ve=_o(oe.renderer.globalAnimation).duration;oe.labelSeries=[],oe.labelSeriesMaxSum=0,oe.seriesLabelTimer&&T().clearTimeout(oe.seriesLabelTimer),oe.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&oe.labelSeries&&(oe.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),oe.labelSeriesMaxSum=Math.max(oe.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,_o(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),oe.seriesLabelTimer=Al(function(){oe.series&&oe.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Xt=[],It=Ke.graph||Ke.area,et=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Hi=Be?Re.len:ut.len,ht=Kt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Jt=Be?"chartCenterX":"chartCenterY";function pi(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Xt.push(lt))}if(Ke.getPointSpline&&et&&et.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=et.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=et.getPointAtLength(ct),Rt=Be?Hi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;pi({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();pi({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(tn(Lt)&&tn(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Hi-((kt||yt.plotY||0)+Kt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+Kt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)pi({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Jt]:(lt[Jt]||0)+((bt[Jt]||0)-(lt[Jt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});pi(bt),lt=bt}}}return Xt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+Kt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Xt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,et=ee.interpolatedPoints,Be=Kt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Hi,ht,je,Tt=ee.labelBySeries,Jt,pi,lt;function yt(Yt,Wt,jt){let nn=Math.max(ft,Kt(pi,-1/0)),ui=Math.min(ft+Xt,Kt(lt,1/0));return Yt>nn&&Yt<=ui-jt.width&&Wt>=xt&&Wt<=xt+It-jt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Jt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],pi=Math.min.apply(Math,Jt),lt=Math.max.apply(Math,Jt)),ee.visible&&!ee.boosted&&et){if(!Tt){var Rt,kt,bt;let Yt=ee.name;if(typeof Le.format=="string"?Yt=Ol(Le.format,ee,he):Le.formatter&&(Yt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Yt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(Vo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=et.length-1;ht>0;ht-=1)Be?yt(ot=(et[ht].chartCenterX??et[ht].chartX)-Je.width/2,wt=(et[ht].chartCenterY??et[ht].chartY)-Je.height/2,Je)&&(je=di(ee,ot,wt,Je)):(yt(ot=et[ht].chartX+3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX+3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Xt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Hi=di(ee,ot,wt,Je,!0))&&ut.push(Hi);if(ut.length){ut.sort((Wt,jt)=>jt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Yt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Yt&&ee.labelBySeries){let Wt,jt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},nn={opacity:1};Yt<=10&&(nn={x:jt.x,y:jt.y},jt={}),ct&&(Wt=_o(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(Vo(jt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(nn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let ui=ee.searchPoint({chartX:je.x,chartY:je.y},!0);ui&&(Tt.closest=[ui,je.x-(ui.plotX||0),je.y-(ui.plotY||0)])}}else Lt()}else Lt()}),Wl(he,"afterDrawSeriesLabels")})(oe)},oe.renderer.forExport||!Ve?0:Ve)}}function Gl(ye,oe,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return tn(Ge)&&tn(ee)&&(Le=[["M",Ge,ee]],(Ke=oe-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>oe+he?Le.push(["L",ye+ct,oe+he]):ee<oe?Le.push(["L",ye+ct,oe]):Ge<ye?Le.push(["L",ye,oe+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,oe+he/2])),Le||[]}let Oo=T();({compose:function(ye,oe){Nl(Rl,"SeriesLabel")&&(Mo(ye,"load",Bo),Mo(ye,"redraw",Bo),oe.prototype.symbols.connector=Gl,Ll({plotOptions:{series:{label:Gi}}}))}}).compose(Oo.Chart,Oo.SVGRenderer);let Hl=T();return l.default})())});var jr=(i,s)=>({"text-success":i,"text-danger":s});function Yl(i,s){i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2&&(o(),D(" ",v(2,1,s.Quantity,"1.0-0")," "))}function jl(i,s){if(i&1){let e=I();n(0,"span",5),P("click",function(){u(e);let t=m(2);return _(t.loadComplementaryQuantity())}),b(1,"i",6),a()}}function ql(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Cost "),a()(),n(4,"td")(5,"span",4),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",4),p(10),d(11,"number"),a()()()),i&2){let e=m();o(6),D(" ",g(7,2,e.Cost)," "),o(4),D(" ",v(11,4,e.CostRatio,"1.0-2"),"% ")}}function Ul(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Profit "),a()(),n(4,"td")(5,"span",7),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",8),p(10),d(11,"number"),a()()()),i&2){let e=m();o(5),c("ngClass",ue(9,jr,e.Profit>0,e.Profit<0)),o(),D(" ",g(7,4,e.Profit)," "),o(3),c("ngClass",ue(12,jr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),D("",v(11,6,e.ProfitRatio,"1.0-2"),"%")}}function zl(i,s){if(i&1&&(n(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"span",3),p(5,"Orders"),a()(),n(6,"td"),p(7),d(8,"number"),a(),b(9,"td"),a(),n(10,"tr")(11,"td")(12,"span",3),p(13," Quantity "),a()(),n(14,"td"),p(15),d(16,"quantityFraction"),a(),b(17,"td"),a(),n(18,"tr")(19,"td")(20,"span",3),p(21," Complementary "),a()(),n(22,"td"),S(23,Yl,3,4,"span"),d(24,"async"),Go(25,jl,2,0,"span"),a(),b(26,"td"),a(),n(27,"tr")(28,"td")(29,"span",3),p(30," Gross Sales "),a()(),n(31,"td"),p(32),d(33,"amountFraction"),a(),b(34,"td"),a(),n(35,"tr")(36,"td")(37,"span",3),p(38," Discount "),a()(),n(39,"td")(40,"span",4),p(41),d(42,"amountFraction"),a()(),n(43,"td")(44,"span",4),p(45),d(46,"number"),a()()(),n(47,"tr")(48,"td")(49,"span",3),p(50," Sales "),a()(),n(51,"td"),p(52),d(53,"amountFraction"),a(),b(54,"td"),a(),n(55,"tr")(56,"td")(57,"span",3),p(58," Tax "),a()(),n(59,"td"),p(60),d(61,"amountFraction"),a(),b(62,"td"),a(),n(63,"tr")(64,"td")(65,"span",3),p(66," Sales + Tax "),a()(),n(67,"td"),p(68),d(69,"amountFraction"),a(),b(70,"td"),a(),S(71,ql,12,7,"tr"),S(72,Ul,12,15,"tr"),a()()),i&2){let e,r=s,t=m();o(7),F(g(8,11,r.Orders)),o(8),F(g(16,13,r.Quantity)),o(8),y((e=g(24,15,t.complementaryQuantity$))?23:25,e),o(9),F(g(33,17,r.GrossSales)),o(9),D(" ",g(42,19,r.Discount)," "),o(4),D(" ",v(46,21,r.DiscountRatio,"1.0-2"),"% "),o(7),F(g(53,24,r.Sales)),o(8),F(g(61,26,r.Tax)),o(8),F(g(69,28,r.SalesWithTax)),o(3),y(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?71:-1),o(),y(t.roleService.report.Profit?72:-1)}}var Qn=class i{constructor(s,e,r,t){this.httpService=s;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(qt(s=>(s.ProfitRatio=this.profitRatioCalculation(s.Profit,s.Sales,s.Tax),s.CostRatio=this.costRatioCalculation(s.Cost,s.Sales,s.Tax),s.DiscountRatio=this.discountPercentageCalc(s.Discount,s.GrossSales,s.Tax),s))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Fi,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}profitRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}discountPercentageCalc(s=0,e=0,r=0){return s/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Nt())}static \u0275fac=function(e){return new(e||i)(w(R),w(Y),w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[[3,"onClose","config"],[1,"p-3"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){if(e&1&&(n(0,"modal-material",0),P("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),S(3,zl,73,30,"table",2),d(4,"async"),a()()()),e&2){let t;c("config",r.modalConfig),o(3),y((t=g(4,2,r.reportSummary$))?3:-1,t)}},dependencies:[Ze,ni,gn,ne,Z,te],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var Kl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],qr=i=>({ID:i});function Xl(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Jl(i,s){if(i&1&&(n(0,"div",2),S(1,Xl,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function Zl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function $l(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function ep(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function tp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function ip(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function np(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function ap(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function op(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function rp(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function lp(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function pp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function mp(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function sp(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,pp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,mp,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function cp(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function dp(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,ep,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,tp,3,4,"span"),a(),S(17,ip,3,3,"span",46),S(18,np,2,1,"i",49),S(19,ap,2,1,"span",50),S(20,op,2,0,"span"),a(),S(21,rp,2,3,"div",51),S(22,lp,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,sp,27,19,"tr",55,j),a()(),n(29,"table",56),G(30,cp,8,5,"tr",null,j),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Kl))("queryParams",X(22,qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function up(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function _p(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function gp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function Cp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,$l,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,dp,32,24,"div",null,j),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,up,3,0,"span",40),S(35,_p,3,3,"span"),p(36),a()(),S(37,gp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),si("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Yn=class i extends De{constructor(e,r,t,l,C,T,$e,Ai){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=$e;this.roleService=Ai}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Qn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(We),w(z),w(qe),w(Y))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Jl,2,1,"div",2),a(),n(3,"filters"),E(4,Zl,46,26,"ng-template",null,0,O),a(),S(6,Cp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,U,ze,xr,Ln,ne,re,Z,te],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var jn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Fi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,k,Ue,ni],encapsulation:2})};var xp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ur=i=>({ID:i}),hp=()=>["/menu/Contacts/Contact/Customers/Info"],Sp=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function yp(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Dp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function vp(i,s){if(i&1){let e=I();n(0,"datepicker",26),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);f("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),f("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function wp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,Dp,11,4,"ng-container",13)(19,vp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),f("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),f("ngModel",r.pageData.Filter.SalesID),o(3),f("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),f("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),f("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),f("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),f("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),f("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",r.pageData.Filter.RowCount)}}function Tp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Pp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Fp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function Ip(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function bp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Ep(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function Mp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Vp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Bp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Op(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Lp(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function Rp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function kp(i,s){i&1&&b(0,"br")}function Wp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Np(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Ap(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,hp))("queryParams",X(4,Ur,e.CustomerID)),o(),F(e.CustomerName)}}function Gp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Hp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Qp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Yp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function qp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Up(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function zp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Kp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Xp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,Sp,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Jp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,kp,1,0,"br",4)(7,Wp,2,1,"i",4),a(),E(8,Np,7,8,"td",4)(9,Ap,3,6,"td",4),S(10,Gp,3,4,"td"),S(11,Hp,2,1,"td"),E(12,Qp,2,1,"td",4)(13,Yp,3,3,"td",68)(14,jp,3,3,"td",69)(15,qp,3,3,"td",69)(16,Up,3,3,"td",70)(17,zp,3,3,"td",69)(18,Kp,3,3,"td",69)(19,Xp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,xp))("queryParams",X(19,Ur,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Zp(i,s){i&1&&b(0,"td",79)}function $p(i,s){i&1&&b(0,"td",79)}function em(i,s){i&1&&b(0,"td",79)}function tm(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function im(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function nm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function am(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function om(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function rm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function lm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function pm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,Zp,1,0,"td",80)(4,$p,1,0,"td",80)(5,em,1,0,"td",80)(6,tm,2,0,"td",81)(7,im,4,6,"td",68)(8,nm,4,6,"td",69)(9,am,4,6,"td",69)(10,om,4,6,"td",70)(11,rm,4,6,"td",69)(12,lm,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function mm(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),E(8,Tp,2,0,"th",43)(9,Pp,2,0,"th",44),S(10,Fp,2,0,"th",45),S(11,Ip,2,0,"th",46),E(12,bp,2,0,"th",47)(13,Ep,2,0,"th",48)(14,Mp,2,0,"th",49)(15,Vp,2,0,"th",50)(16,Bp,2,0,"th",51)(17,Op,2,0,"th",52)(18,Lp,2,0,"th",53)(19,Rp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Jp,20,21,"tr",55),a(),E(22,pm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function sm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function cm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dm(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function um(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function _m(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,mm,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,sm,3,0,"span",34)(9,cm,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,dm,3,0,"a",36)(13,um,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var qn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(jn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,yp,3,0,"button",3),a(),n(3,"filters"),E(4,wp,36,22,"ng-template",null,0,O),a(),E(6,_m,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,Te,Ne,Vi,U,ze,se,ne,re,Z],encapsulation:2})};var gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],fm=()=>["/menu/Products/Setup/Brand/Brand_Form"],xm=i=>({ID:i}),hm=(i,s)=>({BrandID:i,Name:s});function Sm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function ym(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Dm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function vm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,vm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,fm))("queryParams",X(12,xm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",ue(14,hm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Tm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,Dm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,wm,12,17,"tr",null,j),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var Un=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Sm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,ym,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Tm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,gm)),o(3),c("routerLink",M(9,Cm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,k,ae,pe,Ce,U,se,Z,te],encapsulation:2})};function Pm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var zn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,Pm,4,3,"label",null,j),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[ni],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Vm=()=>["/menu/Contacts/Contact/Customers/Info"],Bm=i=>({ID:i});function Om(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Lm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Rm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function km(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Wm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Nm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Am(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Gm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Hm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Qm(i,s){if(i&1&&(n(0,"span"),G(1,Hm,5,2,"span",null,j),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Ym(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function jm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Um(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Km(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Xm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Jm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Qm,3,0,"span"),S(6,Ym,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,jm,3,3,"td",34),S(11,qm,3,3,"td",34),S(12,Um,3,3,"td",35),S(13,zm,3,3,"td",34),S(14,Km,3,3,"td",36),S(15,Xm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Vm))("queryParams",X(14,Bm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function Zm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Jm,16,16,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function $m(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,Rm,2,0,"th",22),S(10,km,2,0,"th",23),S(11,Wm,2,0,"th",24),S(12,Nm,2,0,"th",25),S(13,Am,2,0,"th",26),S(14,Gm,2,0,"th",27),a()(),S(15,Zm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=kn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Nt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(zn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Om,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Lm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,$m,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fm)),o(3),c("routerLink",M(13,Im)),o(3),c("routerLink",M(14,bm)),o(3),c("routerLink",M(15,Em)),o(4),c("routerLink",M(16,Mm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,U,oi,ne,Z,te],encapsulation:2})};var es=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function os(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function rs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function ls(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ps(i,s){if(i&1&&(n(0,"tbody",22),G(1,ls,12,10,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function ms(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ps,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,os,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,rs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ms,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,es)),o(3),c("routerLink",M(12,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z],encapsulation:2})};var ss=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],cs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ds=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],us=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],_s=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function gs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Cs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function fs(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function xs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function hs(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function Ss(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function ys(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function Ds(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function vs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,Ss,3,3,"td",23),S(4,ys,3,3,"td",23),S(5,Ds,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function ws(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,fs,2,0,"th",19),S(7,xs,2,0,"th",20),S(8,hs,2,0,"th",21),a()(),n(9,"tbody",22),G(10,vs,6,4,"tr",null,j),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Jn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Nt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,gs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,Cs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ws,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ss)),o(3),c("routerLink",M(13,cs)),o(3),c("routerLink",M(14,ds)),o(3),c("routerLink",M(15,us)),o(3),c("routerLink",M(16,_s)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z,te],encapsulation:2})};var Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Es=()=>["/menu/Contacts/Contact/Suppliers/Info"],Ms=i=>({ID:i}),Vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function Bs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Os(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Ls(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,Es))("queryParams",X(20,Ms,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Kr))("queryParams",_t(23,Vs,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function Rs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function ks(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Ls,17,27,"tr",24,j),a(),S(17,Rs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Os,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,ks,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Kr)),o(3),c("routerLink",M(13,Ts)),o(3),c("routerLink",M(14,Ps)),o(3),c("routerLink",M(15,Fs)),o(3),c("routerLink",M(16,Is)),o(3),c("routerLink",M(17,bs)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,k,pe,Ce,Ue,U,re,Z,te],encapsulation:2})};var Xr=Zt(Ei());var Ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],As=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],js=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),qs=i=>[i],Us=i=>({ID:i}),zs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Jr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Ks=(i,s,e)=>({VariantID:i,From:s,To:e}),Xs=(i,s,e)=>({ProductID:i,From:s,To:e});function Js(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",dn(1,js,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function Zs(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function $s(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function e0(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function t0(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function i0(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function n0(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function a0(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function o0(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function r0(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function l0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function p0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function m0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function s0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),h("ngModelChange",function(t){u(e);let l=m().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function c0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,ln)}}function d0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function u0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Yo(4,zs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function g0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function C0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function f0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Ks,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function x0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Xs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function h0(i,s){if(i&1&&(n(0,"td",75),E(1,f0,5,16,"a",78)(2,x0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function S0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function D0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function v0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function w0(i,s){if(i&1&&(n(0,"tr",60),E(1,s0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,c0,2,1,"ng-container",8)(8,d0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,u0,4,11,"td",67)(15,_0,3,3,"td",67)(16,g0,3,3,"td",68)(17,C0,3,3,"td",67)(18,h0,3,2,"td",67)(19,S0,3,3,"td",69)(20,y0,3,3,"td",67)(21,D0,3,4,"td",70)(22,v0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,qs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Us,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function T0(i,s){i&1&&b(0,"td",75)}function P0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function F0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function b0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function E0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function M0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function V0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function B0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function O0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function L0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function R0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,T0,1,0,"td",67)(4,P0,2,0,"td",67)(5,F0,4,6,"td",67)(6,I0,4,6,"td",67)(7,b0,4,6,"td",68)(8,E0,4,6,"td",67)(9,M0,5,6,"td",82)(10,V0,5,6,"td",69)(11,B0,5,6,"td",82)(12,O0,5,10,"td",70)(13,L0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function k0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,e0,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,t0,2,1,"th",37)(12,i0,2,0,"th",38)(13,n0,2,0,"th",39)(14,a0,2,0,"th",40)(15,o0,2,1,"th",41)(16,r0,2,0,"th",42)(17,l0,2,1,"th",43)(18,p0,2,0,"th",44)(19,m0,2,0,"th",45),a()(),n(20,"tbody"),E(21,w0,23,21,"tr",46),a(),E(22,R0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var $n=class i extends De{constructor(e,r,t,l,C,T,$e){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=$e}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Fe(Y);columnService=Fe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(tt({},this.data),{Data:e.Data.map(t=>nt(tt({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(tt({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(tt({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(tt({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Ki.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(tt({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Xr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(qe),w(We),w(z),w(Gn))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Js,3,7,"a",2),S(3,Zs,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,$s,45,36,"ng-template",null,0,O),a(),E(29,k0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Ns)),o(3),c("routerLink",M(15,As)),o(3),c("routerLink",M(16,Gs)),o(3),c("routerLink",M(17,Hs)),o(3),c("routerLink",M(18,Qs)),o(3),c("routerLink",M(19,Ys)),o(5),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,er,L,k,ae,pe,Ce,Te,Ne,fe,U,ze,oi,se,re,Z,te],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var N0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],A0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],G0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],H0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Q0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],j0=i=>({ID:i}),q0=(i,s)=>s.Name,U0=(i,s)=>s.ID;function z0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function K0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function X0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&Ut("text-align","right")}function J0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&Ut("text-align","right")}function Z0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&Ut("text-align","right")}function $0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function ec(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function tc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),F(e.Code)}}function ic(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function nc(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function ac(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function oc(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function rc(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,tc,2,3,"td",33),S(5,ic,3,5,"td",33),S(6,nc,3,5,"td",33),G(7,ac,2,1,"td",14,ji),S(9,oc,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,j0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,z0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,K0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,X0,2,2,"th",11),S(36,J0,2,2,"th",12),S(37,Z0,2,2,"th",12),G(38,$0,2,3,"th",13,q0),S(40,ec,2,0,"th",14),a()(),n(41,"tbody"),G(42,rc,10,9,"tr",15,U0),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,N0)),o(3),c("routerLink",M(17,A0)),o(3),c("routerLink",M(18,G0)),o(3),c("routerLink",M(19,H0)),o(3),c("routerLink",M(20,Q0)),o(3),c("routerLink",M(21,Y0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,fe,U,ze,Bi,Z],encapsulation:2})};var yo=Zt(Ei());var lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],sc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],cc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],dc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Zr=()=>({standalone:!0}),$r=()=>({overflow:"visible"}),uc=i=>[i],_c=i=>({ID:i});function gc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function Cc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Zr))("contentStyle",M(19,$r))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Zr))("contentStyle",M(21,$r))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function fc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function xc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function hc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function Sc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function yc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function Dc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,uc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,_c,e.ID)),o(),D(" ",e.Name," ")}}function vc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function Pc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Fc(i,s){if(i&1&&(n(0,"tr"),S(1,Dc,3,7,"td"),S(2,vc,2,1,"td"),S(3,wc,4,4,"td",29),E(4,Tc,3,4,"td",30),S(5,Pc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function Ic(i,s){i&1&&b(0,"td")}function bc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function Ec(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Mc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Bc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,Ic,1,0,"td"),S(3,bc,2,0,"td",29),S(4,Ec,3,4,"td",29),E(5,Mc,3,4,"td",30),S(6,Vc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),$e=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,$e)}_toastrService=Fe(qe);columnService=Fe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,yo.default)(this.pageData.Filter.MonthFrom),r=(0,yo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,gc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Cc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,fc,2,0,"th",11),S(34,xc,2,0,"th",12),S(35,hc,3,0,"th",13),E(36,Sc,2,1,"th",14),S(37,yc,3,0,"th",13),a()(),n(38,"tbody"),E(39,Fc,6,5,"tr",15),a(),E(40,Bc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,lc)),o(3),c("routerLink",M(20,pc)),o(3),c("routerLink",M(21,mc)),o(3),c("routerLink",M(22,sc)),o(3),c("routerLink",M(23,cc)),o(3),c("routerLink",M(24,dc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,k,ae,pe,Ce,Te,fe,U,Ir,se,ne],encapsulation:2})};var Oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],kc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Wc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ac=i=>[i],Gc=i=>({ID:i});function Hc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Qc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Yc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function jc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Yc,2,1,"th",22,j),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function qc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Uc(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Ac,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Gc,r[1])),o(),F(r[e])}}function zc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Kc(i,s){if(i&1&&(n(0,"td",11),S(1,Uc,2,7,"a",23)(2,zc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Xc(i,s){if(i&1&&(n(0,"tr",11),G(1,Kc,3,1,"td",11,j),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Hc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Qc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,jc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,qc,2,1,"th",12,j),a()(),n(40,"tbody"),G(41,Xc,3,0,"tr",11,j),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Oc)),o(3),c("routerLink",M(13,Lc)),o(3),c("routerLink",M(14,Rc)),o(3),c("routerLink",M(15,kc)),o(3),c("routerLink",M(16,Wc)),o(3),c("routerLink",M(17,Nc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,k,Te,fe,U],encapsulation:2})};var Jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Zc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],$c=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],ed=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),el=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],td=(i,s,e)=>({CategoryID:i,From:s,To:e}),id=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],tl=i=>({CategoryID:i});function nd(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ad(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function od(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,ad,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function rd(i,s){i&1&&(n(0,"th",42),p(1," Cost "),b(2,"p-treeTableSortIcon",43),a())}function ld(i,s){i&1&&(n(0,"th",44),p(1," Profit "),b(2,"p-treeTableSortIcon",45),a())}function pd(i,s){i&1&&(n(0,"th",46),p(1," % "),b(2,"p-treeTableSortIcon",47),a())}function md(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),b(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),b(6,"p-treeTableSortIcon",32),a(),E(7,rd,3,0,"th",33),n(8,"th",34),p(9," Gross "),b(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),b(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),b(16,"p-treeTableSortIcon",39),a(),E(17,ld,3,0,"th",40)(18,pd,3,0,"th",41),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function sd(i,s){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function cd(i,s){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function dd(i,s){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function ud(i,s){if(i&1&&(n(0,"td"),E(1,dd,5,11,"span",58),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function _d(i,s){if(i&1&&(n(0,"tr",48)(1,"td"),b(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,sd,6,9,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),E(33,cd,6,9,"td",55)(34,ud,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,el))("queryParams",_t(55,td,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,id))("queryParams",X(60,tl,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,el))("queryParams",X(63,tl,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function gd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Cd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function fd(i,s){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function xd(i,s){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),E(6,gd,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),E(17,Cd,3,3,"td",61)(18,fd,3,3,"td",63),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function hd(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),E(3,md,19,3,"ng-template",25)(4,_d,35,65,"ng-template",26)(5,xd,19,15,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,ed))}}var na=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,nd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,od,29,15,"ng-template",null,0,O),a(),E(19,hd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Jc)),o(3),c("routerLink",M(11,Zc)),o(3),c("routerLink",M(12,$c)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,k,ae,Te,Ne,Er,hn,Or,Mr,Vr,Br,fe,U,ze,Bn,ne,re,Z,te],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var Sd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],yd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function vd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function Td(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function Pd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Fd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function Id(i,s){if(i&1&&(n(0,"td"),S(1,Pd,2,1,"span"),S(2,Fd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function bd(i,s){if(i&1&&(n(0,"tr"),G(1,Id,3,2,"td",null,j),a()),i&2){let e=s.$implicit;o(),H(e)}}function Ed(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function Md(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,Ed,3,3,"td",null,j),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Vd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,Td,2,2,"th",19,j),a()(),n(6,"tbody"),G(7,bd,3,0,"tr",null,j),a(),S(9,Md,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var aa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let $e=t.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value,Ai=l.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare($e,Ai,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,wd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Vd,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,Sd)),o(3),c("routerLink",M(11,yd)),o(3),c("routerLink",M(12,Dd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,k,pe,Ce,Ne,fe,U,Z],encapsulation:2})};var Bd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Od=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Ld=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Rd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function kd(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var oa=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(R))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Rd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,kd,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Bd)),o(3),c("routerLink",M(9,Od)),o(3),c("routerLink",M(10,Ld)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,k,ri],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Ad(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var ra=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Nd,13,9,"ng-template",null,0,O),a(),S(8,Ad,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Wd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,k,ri,Mt,U],encapsulation:2})};function Gd(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Hd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Yd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Qd,16,15,"tr",null,j),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var la=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gd,3,0,"a",2),a(),n(3,"filters"),E(4,Hd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Yd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,k,U,se,ne,Z],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function qd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ud(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function zd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Kd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Xd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Kd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Jd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var pa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,qd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ud,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,zd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Xd,21,21,"tr",null,j),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Jd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,jd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,k,U,se,hr,ne,Z,te],encapsulation:2})};var Zd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],vo=(i,s)=>({From:i,To:s}),$d=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],eu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function tu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function iu(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ma=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(R),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),h("filterChange",function(C){return u(t),x(r.pageData.Filter,C)||(r.pageData.Filter=C),_(C)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,tu,13,11,"ng-template",null,0,O),a(),S(18,iu,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",M(11,Zd))("queryParams",ue(12,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,$d))("queryParams",ue(16,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,eu))("queryParams",ue(20,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,k,Mt,Ht,fe,U],encapsulation:2})};var ru={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ci=class i{date;dateChange=new pn;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[hi([{provide:vn,useClass:An,deps:[Dn,Fr]},{provide:wn,useValue:ru}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(C){return u(t),_(r.onDateChange(C.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Dt(4);return _(r.setMonthAndYear(C,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);Ut("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[Gt,En,wi,Fn,In,bn,Ti,Vn,Pn,Tn,Mn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
- `],encapsulation:2})};var pu=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function mu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function su(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ca=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter($e=>this.series?.name==$e?.name);let l=[],C="",T=this.point.index;return r.forEach($e=>{$e.options.stack===this.point.series.options.stack&&(l=$e.name.split(" "),C+=`
1
+ import{a as ii,b as Nr}from"./chunk-RNXOIUIO.js";import{a as Wr}from"./chunk-DPGY5YXC.js";import{a as Hr}from"./chunk-A5MP4QMZ.js";import{a as Mt,b as Ar}from"./chunk-AQQHMGYE.js";import{a as Gt,b as Gr}from"./chunk-SWPKQM2X.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as ti}from"./chunk-2MQDNPCG.js";import{a as De}from"./chunk-XORANKYI.js";import{a as ze}from"./chunk-LBQRCFLJ.js";import{a as An}from"./chunk-3PC6CTVP.js";import{a as gt}from"./chunk-2LOWEWI4.js";import{a as pr}from"./chunk-ZEKZLSGA.js";import{b as dr}from"./chunk-I5W4NCFM.js";import"./chunk-MVUVDYGQ.js";import{a as Vi}from"./chunk-5MWGLO24.js";import"./chunk-6H5P35AP.js";import{a as kr}from"./chunk-DLNZDHGS.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-5DQ4MJJT.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-R4OHTTCT.js";import{a as Tr,b as Pr}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{e as cr}from"./chunk-AUBQH6JY.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-CUULWZUF.js";import"./chunk-KHR4NBM3.js";import"./chunk-L2V3KTC6.js";import"./chunk-H7XFYY6V.js";import"./chunk-XACC6EMJ.js";import{a as ie}from"./chunk-HL3ONSX6.js";import{a as Z}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-QPOOLLKY.js";import{a as En,b as Di}from"./chunk-CSFFF2YO.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-WNZKCNMC.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-LOD3JYZW.js";import"./chunk-3KSZCJ6T.js";import"./chunk-6GLKD66N.js";import"./chunk-CBSYYTXQ.js";import{c as sr,d as Te,e as Wn}from"./chunk-GN3HVOCN.js";import"./chunk-G4IW5GPY.js";import{a as vi}from"./chunk-BWXXYBLG.js";import{a as pe,b as ge,c as lr}from"./chunk-AEXXXOEQ.js";import{a as Et,b as vr}from"./chunk-I3ABVEQL.js";import{d as Sr,f as Ce}from"./chunk-FFNEDDOO.js";import{a as yr,b as Dr,c as U}from"./chunk-TYX5PWAF.js";import{b as K}from"./chunk-T2H2XAEJ.js";import{a as me}from"./chunk-JNORDOWT.js";import{a as rr}from"./chunk-G5VELV3S.js";import"./chunk-QFON23YX.js";import"./chunk-FIUZN6JU.js";import{a as q}from"./chunk-4QM23MMO.js";import{e as A,f as Ii}from"./chunk-PKS7H624.js";import"./chunk-3FYNWZYY.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as ur}from"./chunk-VX5HH3BW.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import"./chunk-M43HNBJQ.js";import{a as _r,c as Ue}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{d as hr}from"./chunk-4U2TXFUV.js";import{b as N}from"./chunk-XNJ2P2ZO.js";import"./chunk-CS6HBROS.js";import"./chunk-JUS6LLVX.js";import{C as Rn,F as Ne,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-BA3BDB5Y.js";import{b as ne,c as hn}from"./chunk-C4WJKF7R.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-T25N3EEG.js";import{a as Mn,d as $}from"./chunk-7TBS7SPQ.js";import"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-A45GTZVV.js";import"./chunk-NWSIPELM.js";import{a as nr}from"./chunk-6SGN7MNX.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-L76WVZW6.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-O5SLP4JK.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-RNLSEEMX.js";import"./chunk-BVZ7ACQM.js";import"./chunk-7KAETFNH.js";import{a as V,d as j}from"./chunk-USJ6ILEE.js";import"./chunk-FSBKLNRT.js";import{$b as qt,$d as Ui,Ab as G,Bb as H,Bc as d,Ca as dt,Cb as c,Cc as g,Db as n,Dc as v,E as ri,Eb as a,Ec as fi,Ed as Ko,Fb as b,Hc as O,I as Qi,Ia as go,Ja as Ro,Jb as pt,Jc as Go,K as Vo,Kb as mt,Kc as xi,Lb as Wo,Lc as dn,M as Bo,Ma as ko,Mb as I,Ob as P,Oc as Ho,Pc as hi,Q as nn,Qa as Ee,Qb as m,Sa as rn,Tb as Co,Tc as un,Ub as sn,Vb as _i,Vc as Qo,Wb as gi,Wd as We,Xa as o,Xc as fo,Y as jt,Ya as ln,Yc as Yo,Yd as _n,Zc as jo,Zd as Q,_b as Dt,aa as _o,ac as ji,bc as No,be as qe,cc as qi,cd as tt,db as w,dc as p,ec as F,ed as st,ee as k,fa as Nt,fc as D,fd as it,gc as $t,hb as B,ib as ui,ic as f,jb as pn,jc as x,jd as qo,ka as Oo,kc as h,kd as Uo,la as an,lb as W,ma as di,mb as mn,md as oe,na as Zt,nb as E,o as ci,oc as Ct,od as re,pa as Pe,rd as Si,sc as Ci,t as oi,ta as u,tb as li,tc as M,td as zo,u as uo,ua as _,uc as X,vb as S,vc as fe,wc as _t,xa as on,xb as y,xc as Ut,yb as Yi,yc as cn,za as Lo,zb as Y,zc as Ao}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var C=t(944),T=t.n(C),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Gi,ht,je,Tt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!Tt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,wt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,wt,Je)):(yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Gi=mi(ee,ot,wt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(Tt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,C,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(We),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ne,Te,Ne,U,ze,gr,On,re,oe,Z,ie],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function gp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function Cp(i,s){if(i&1){let e=I();n(0,"datepicker",26),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);f("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),f("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function fp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,gp,11,4,"ng-container",13)(19,Cp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),f("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),f("ngModel",r.pageData.Filter.SalesID),o(3),f("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),f("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),f("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),f("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),f("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),f("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",r.pageData.Filter.RowCount)}}function xp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function hp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Sp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function yp(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Dp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function vp(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function wp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Tp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Pp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Fp(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Ip(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function bp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function Ep(i,s){i&1&&b(0,"br")}function Mp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Vp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Bp(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Lp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Rp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Np(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Hp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Qp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Yp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,Ep,1,0,"br",4)(7,Mp,2,1,"i",4),a(),E(8,Vp,7,8,"td",4)(9,Bp,3,6,"td",4),S(10,Op,3,4,"td"),S(11,Lp,2,1,"td"),E(12,Rp,2,1,"td",4)(13,kp,3,3,"td",68)(14,Wp,3,3,"td",69)(15,Np,3,3,"td",69)(16,Ap,3,3,"td",70)(17,Gp,3,3,"td",69)(18,Hp,3,3,"td",69)(19,Qp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function jp(i,s){i&1&&b(0,"td",79)}function qp(i,s){i&1&&b(0,"td",79)}function Up(i,s){i&1&&b(0,"td",79)}function zp(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Xp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Zp(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function $p(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function em(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function tm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,jp,1,0,"td",80)(4,qp,1,0,"td",80)(5,Up,1,0,"td",80)(6,zp,2,0,"td",81)(7,Kp,4,6,"td",68)(8,Xp,4,6,"td",69)(9,Jp,4,6,"td",69)(10,Zp,4,6,"td",70)(11,$p,4,6,"td",69)(12,em,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function im(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),E(8,xp,2,0,"th",43)(9,hp,2,0,"th",44),S(10,Sp,2,0,"th",45),S(11,yp,2,0,"th",46),E(12,Dp,2,0,"th",47)(13,vp,2,0,"th",48)(14,wp,2,0,"th",49)(15,Tp,2,0,"th",50)(16,Pp,2,0,"th",51)(17,Fp,2,0,"th",52)(18,Ip,2,0,"th",53)(19,bp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Yp,20,21,"tr",55),a(),E(22,tm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function nm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function am(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function om(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function rm(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function lm(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,im,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,nm,3,0,"span",34)(9,am,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,om,3,0,"a",36)(13,rm,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",3),a(),n(3,"filters"),E(4,fp,36,22,"ng-template",null,0,O),a(),E(6,lm,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ne,pe,ge,Ue,Te,Ne,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],sm=()=>["/menu/Products/Setup/Brand/Brand_Form"],cm=i=>({ID:i}),dm=(i,s)=>({BrandID:i,Name:s});function um(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function _m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function gm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function Cm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,Cm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,sm))("queryParams",X(12,cm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,dm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function xm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,gm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,fm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,_m,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,xm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,pm)),o(3),c("routerLink",M(9,mm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ne,pe,ge,U,se,Z,ie],encapsulation:2})};function hm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,hm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Tm=()=>["/menu/Contacts/Contact/Customers/Info"],Pm=i=>({ID:i});function Fm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Im(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function bm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Em(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Mm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Vm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Bm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Om(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Lm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Rm(i,s){if(i&1&&(n(0,"span"),G(1,Lm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function km(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Wm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function Nm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Am(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Hm(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Rm,3,0,"span"),S(6,km,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Wm,3,3,"td",34),S(11,Nm,3,3,"td",34),S(12,Am,3,3,"td",35),S(13,Gm,3,3,"td",34),S(14,Hm,3,3,"td",36),S(15,Qm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Tm))("queryParams",X(14,Pm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function jm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Ym,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function qm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,bm,2,0,"th",22),S(10,Em,2,0,"th",23),S(11,Mm,2,0,"th",24),S(12,Vm,2,0,"th",25),S(13,Bm,2,0,"th",26),S(14,Om,2,0,"th",27),a()(),S(15,jm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Fm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Im,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,qm,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Sm)),o(3),c("routerLink",M(13,ym)),o(3),c("routerLink",M(14,Dm)),o(3),c("routerLink",M(15,vm)),o(4),c("routerLink",M(16,wm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ne,pe,ge,Ue,U,ti,re,Z,ie],encapsulation:2})};var Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Zm(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function $m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function es(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ts(i,s){if(i&1&&(n(0,"tbody",22),G(1,es,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function is(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ts,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Zm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,$m,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,is,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,Um)),o(3),c("routerLink",M(12,zm)),o(3),c("routerLink",M(13,Km)),o(3),c("routerLink",M(14,Xm)),o(3),c("routerLink",M(15,Jm)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],rs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],ls=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ms(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function ss(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function cs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ds(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function us(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function _s(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function gs(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function Cs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,us,3,3,"td",23),S(4,_s,3,3,"td",23),S(5,gs,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function fs(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,ss,2,0,"th",19),S(7,cs,2,0,"th",20),S(8,ds,2,0,"th",21),a()(),n(9,"tbody",22),G(10,Cs,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ms,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,fs,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ns)),o(3),c("routerLink",M(13,as)),o(3),c("routerLink",M(14,os)),o(3),c("routerLink",M(15,rs)),o(3),c("routerLink",M(16,ls)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ie],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],vs=()=>["/menu/Contacts/Contact/Suppliers/Info"],ws=i=>({ID:i}),Ts=(i,s,e)=>({From:i,SupplierID:s,To:e});function Ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Fs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Is(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,vs))("queryParams",X(20,ws,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,Ts,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function bs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function Es(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Is,17,27,"tr",24,Y),a(),S(17,bs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Fs,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Es,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,xs)),o(3),c("routerLink",M(14,hs)),o(3),c("routerLink",M(15,Ss)),o(3),c("routerLink",M(16,ys)),o(3),c("routerLink",M(17,Ds)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ie],encapsulation:2})};var zr=Jt(bi());var Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ws=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),Ns=i=>[i],As=i=>({ID:i}),Gs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Hs=(i,s,e)=>({VariantID:i,From:s,To:e}),Qs=(i,s,e)=>({ProductID:i,From:s,To:e});function Ys(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Ws,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function js(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function qs(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Us(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function zs(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function Ks(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Xs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Js(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Zs(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function $s(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function e0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function t0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function i0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function n0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),h("ngModelChange",function(t){u(e);let l=m().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function a0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function o0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function r0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,Gs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function p0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function m0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function s0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Hs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function c0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Qs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function d0(i,s){if(i&1&&(n(0,"td",75),E(1,s0,5,16,"a",78)(2,c0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function u0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function g0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function C0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function f0(i,s){if(i&1&&(n(0,"tr",60),E(1,n0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,a0,2,1,"ng-container",8)(8,o0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,r0,4,11,"td",67)(15,l0,3,3,"td",67)(16,p0,3,3,"td",68)(17,m0,3,3,"td",67)(18,d0,3,2,"td",67)(19,u0,3,3,"td",69)(20,_0,3,3,"td",67)(21,g0,3,4,"td",70)(22,C0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,Ns,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,As,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function x0(i,s){i&1&&b(0,"td",75)}function h0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function S0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function D0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function v0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function T0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function P0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function F0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function b0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,x0,1,0,"td",67)(4,h0,2,0,"td",67)(5,S0,4,6,"td",67)(6,y0,4,6,"td",67)(7,D0,4,6,"td",68)(8,v0,4,6,"td",67)(9,w0,5,6,"td",82)(10,T0,5,6,"td",69)(11,P0,5,6,"td",82)(12,F0,5,10,"td",70)(13,I0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function E0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,Us,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,zs,2,1,"th",37)(12,Ks,2,0,"th",38)(13,Xs,2,0,"th",39)(14,Js,2,0,"th",40)(15,Zs,2,1,"th",41)(16,$s,2,0,"th",42)(17,e0,2,1,"th",43)(18,t0,2,0,"th",44)(19,i0,2,0,"th",45),a()(),n(20,"tbody"),E(21,f0,23,21,"tr",46),a(),E(22,b0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,C,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(We),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Ys,3,7,"a",2),S(3,js,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,qs,45,36,"ng-template",null,0,O),a(),E(29,E0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Vs)),o(3),c("routerLink",M(15,Bs)),o(3),c("routerLink",M(16,Os)),o(3),c("routerLink",M(17,Ls)),o(3),c("routerLink",M(18,Rs)),o(3),c("routerLink",M(19,ks)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ne,pe,ge,Te,Ne,Ce,U,ze,ti,se,oe,Z,ie],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],R0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],k0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],W0=i=>({ID:i}),N0=(i,s)=>s.Name,A0=(i,s)=>s.ID;function G0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function H0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Q0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Y0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function j0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function q0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function U0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function z0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function K0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function X0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function J0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Z0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function $0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,z0,2,3,"td",33),S(5,K0,3,5,"td",33),S(6,X0,3,5,"td",33),G(7,J0,2,1,"td",14,Yi),S(9,Z0,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,W0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,G0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,H0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,Q0,2,2,"th",11),S(36,Y0,2,2,"th",12),S(37,j0,2,2,"th",12),G(38,q0,2,3,"th",13,N0),S(40,U0,2,0,"th",14),a()(),n(41,"tbody"),G(42,$0,10,9,"tr",15,A0),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,V0)),o(3),c("routerLink",M(17,B0)),o(3),c("routerLink",M(18,O0)),o(3),c("routerLink",M(19,L0)),o(3),c("routerLink",M(20,R0)),o(3),c("routerLink",M(21,k0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ne,Te,Ne,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ac=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),rc=i=>[i],lc=i=>({ID:i});function pc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function mc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function sc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function cc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function dc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function uc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function _c(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function gc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,rc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,lc,e.ID)),o(),D(" ",e.Name," ")}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function xc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function hc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Sc(i,s){if(i&1&&(n(0,"tr"),S(1,gc,3,7,"td"),S(2,Cc,2,1,"td"),S(3,fc,4,4,"td",29),E(4,xc,3,4,"td",30),S(5,hc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function yc(i,s){i&1&&b(0,"td")}function Dc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function wc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Pc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,yc,1,0,"td"),S(3,Dc,2,0,"td",29),S(4,vc,3,4,"td",29),E(5,wc,3,4,"td",30),S(6,Tc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var $n=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,mc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,sc,2,0,"th",11),S(34,cc,2,0,"th",12),S(35,dc,3,0,"th",13),E(36,uc,2,1,"th",14),S(37,_c,3,0,"th",13),a()(),n(38,"tbody"),E(39,Sc,6,5,"tr",15),a(),E(40,Pc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,ec)),o(3),c("routerLink",M(20,tc)),o(3),c("routerLink",M(21,ic)),o(3),c("routerLink",M(22,nc)),o(3),c("routerLink",M(23,ac)),o(3),c("routerLink",M(24,oc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ne,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Bc=i=>[i],Oc=i=>({ID:i});function Lc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Rc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function kc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Wc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,kc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function Nc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Ac(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Bc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Oc,r[1])),o(),F(r[e])}}function Gc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Hc(i,s){if(i&1&&(n(0,"td",11),S(1,Ac,2,7,"a",23)(2,Gc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Qc(i,s){if(i&1&&(n(0,"tr",11),G(1,Hc,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Lc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Rc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Wc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,Nc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Qc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fc)),o(3),c("routerLink",M(13,Ic)),o(3),c("routerLink",M(14,bc)),o(3),c("routerLink",M(15,Ec)),o(3),c("routerLink",M(16,Mc)),o(3),c("routerLink",M(17,Vc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Uc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],zc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function Xc(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Jc(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Zc(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Jc,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function $c(i,s){i&1&&(n(0,"th",42),p(1," Cost "),b(2,"p-treeTableSortIcon",43),a())}function ed(i,s){i&1&&(n(0,"th",44),p(1," Profit "),b(2,"p-treeTableSortIcon",45),a())}function td(i,s){i&1&&(n(0,"th",46),p(1," % "),b(2,"p-treeTableSortIcon",47),a())}function id(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),b(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),b(6,"p-treeTableSortIcon",32),a(),E(7,$c,3,0,"th",33),n(8,"th",34),p(9," Gross "),b(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),b(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),b(16,"p-treeTableSortIcon",39),a(),E(17,ed,3,0,"th",40)(18,td,3,0,"th",41),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function nd(i,s){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function ad(i,s){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function od(i,s){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function rd(i,s){if(i&1&&(n(0,"td"),E(1,od,5,11,"span",58),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function ld(i,s){if(i&1&&(n(0,"tr",48)(1,"td"),b(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,nd,6,9,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),E(33,ad,6,9,"td",55)(34,rd,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,zc,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,Kc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function pd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function md(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function sd(i,s){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function cd(i,s){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),E(6,pd,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),E(17,md,3,3,"td",61)(18,sd,3,3,"td",63),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function dd(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),E(3,id,19,3,"ng-template",25)(4,ld,35,65,"ng-template",26)(5,cd,19,15,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,Uc))}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Zc,29,15,"ng-template",null,0,O),a(),E(19,dd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Yc)),o(3),c("routerLink",M(11,jc)),o(3),c("routerLink",M(12,qc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ne,Te,Ne,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ie],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],_d=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],gd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Cd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function fd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function xd(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function hd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Sd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function yd(i,s){if(i&1&&(n(0,"td"),S(1,hd,2,1,"span"),S(2,Sd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function Dd(i,s){if(i&1&&(n(0,"tr"),G(1,yd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function vd(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function wd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,vd,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Td(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,xd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Dd,3,0,"tr",null,Y),a(),S(9,wd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Cd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,fd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Td,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,ud)),o(3),c("routerLink",M(11,_d)),o(3),c("routerLink",M(12,gd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ne,Ce,U,Z],encapsulation:2})};var Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Fd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Id=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function bd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Ed(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,bd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Ed,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Pd)),o(3),c("routerLink",M(9,Fd)),o(3),c("routerLink",M(10,Id)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var Md=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Vd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Bd(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Vd,13,9,"ng-template",null,0,O),a(),S(8,Bd,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Md)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Od(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Ld(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Rd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function kd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Rd,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Od,3,0,"a",2),a(),n(3,"filters"),E(4,Ld,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,kd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ad(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Gd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Hd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Yd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Nd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ad,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,Gd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Qd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Yd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,Wd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ie],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function zd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Kd(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),h("filterChange",function(C){return u(t),x(r.pageData.Filter,C)||(r.pageData.Filter=C),_(C)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,zd,13,11,"ng-template",null,0,O),a(),S(18,Kd,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",M(11,jd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,qd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,Ud))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var $d={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:$d}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(C){return u(t),_(r.onDateChange(C.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Dt(4);return _(r.setMonthAndYear(C,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
+ `],encapsulation:2})};var tu=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function iu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function nu(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ma=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ze=>this.series?.name==Ze?.name);let l=[],C="",T=this.point.index;return r.forEach(Ze=>{Ze.options.stack===this.point.series.options.stack&&(l=Ze.name.split(" "),C+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
5
- ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format($e.points[T].y)}</br>
6
- `)}),C}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,mu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,su,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),c("routerLink",M(6,pu)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,k,ae,Te,Mt,ci,fe,U],encapsulation:2})};var cu=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],du=(i,s)=>({"text-success":i,"text-danger":s}),il=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function uu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function _u(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(5),f("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),f("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function gu(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function Cu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function fu(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function xu(i,s){if(i&1&&(S(0,Cu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,fu,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function hu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function Su(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function yu(i,s){if(i&1&&(S(0,hu,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,Su,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function Du(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,yu,10,20,null,null,j),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",ue(29,il,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",ue(32,il,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function vu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function wu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function Tu(i,s){if(i&1&&(S(0,vu,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,wu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function Pu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,gu,4,8,"th",21,j),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,xu,8,14,null,null,j),a()(),n(15,"tbody"),G(16,Du,18,35,"tr",23,j),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,Tu,11,23,null,null,j),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",ue(4,du,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var da=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,uu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,_u,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,Pu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,cu)),o(7),y(t.data?10:-1))},dependencies:[A,Ze,Q,$,L,k,ae,fe,U,ze,se,Rn,Sr,ne,Z],encapsulation:2})};var Fu=()=>["/menu/Reports/Sales_Report/Standard/Daily"],wo=(i,s)=>({From:i,To:s}),Iu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],bu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],nl=i=>({"is-weekend":i});function Eu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Mu(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Vu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function Bu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Ou(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Lu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function Ru(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function ku(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function Wu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Nu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Au(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Gu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Hu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,ku,3,3,"td",37),S(20,Wu,3,3,"td",33),S(21,Nu,3,3,"td",34),S(22,Au,3,4,"td",36),S(23,Gu,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,nl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,nl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Qu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function Yu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function ju(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function qu(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Uu(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function zu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,Vu,2,0,"th",26),S(17,Bu,2,0,"th",27),S(18,Ou,2,0,"th",28),S(19,Lu,2,0,"th",29),S(20,Ru,2,0,"th",30),a()(),n(21,"tbody"),G(22,Hu,24,31,"tr",31,j),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Qu,4,6,"td",33),S(45,Yu,4,6,"td",33),S(46,ju,4,6,"td",34),S(47,qu,5,10,"td",35),S(48,Uu,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ua=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Eu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,Mu,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,zu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fu))("queryParams",ue(13,wo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,Iu))("queryParams",ue(17,wo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,bu))("queryParams",ue(21,wo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,Ze,Q,$,L,k,pe,Ce,Ht,fe,U,ze,se,ne,re,Z,te],encapsulation:2})};var Ku=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Xu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Ju(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Zu(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function $u(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function e_(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function t_(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function i_(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,e_,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,t_,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function n_(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function a_(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function o_(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,Zu,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,$u,2,0,"th",20),a()(),n(20,"tbody"),E(21,i_,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,n_,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,a_,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var _a=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Xu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ju,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,o_,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Ku)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,k,ae,Te,fe,U,ze,se,Rn,ne,Z,te],encapsulation:2})};var r_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],al=(i,s)=>({From:i,To:s}),l_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],p_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function m_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function s_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ga=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(C=>`${C.getDate()} ${V.Months[C.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,m_,13,12,"ng-template",null,0,O),a(),S(18,s_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(10,r_))("queryParams",ue(11,al,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,l_))("queryParams",ue(15,al,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,p_)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,k,Mt,Ht,fe,U],encapsulation:2})};var c_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],d_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],u_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function __(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function g_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var Ca=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(C=>parseInt(C)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,__,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,g_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,c_)),o(3),c("routerLink",M(9,d_)),o(3),c("routerLink",M(10,u_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,k,Mt,fe,U],encapsulation:2})};var C_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],f_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],x_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function h_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function S_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var fa=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(R))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,h_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,S_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,C_)),o(3),c("routerLink",M(9,f_)),o(3),c("routerLink",M(10,x_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,k,ri,fe],encapsulation:2})};var To=Zt(Ei());var y_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],D_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],v_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],w_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),ol=(i,s,e)=>({ListIDs:i,From:s,To:e}),Ri=(i,s)=>({"text-danger":i,"text-success":s}),T_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],rl=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ll=(i,s)=>({"text-success":i,"text-danger":s});function P_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function F_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),f("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption)}}function I_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function b_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function E_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function M_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function V_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function B_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function O_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function L_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function R_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function k_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function W_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function N_(i,s){if(i&1&&(pt(0),E(1,W_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function A_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function G_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function H_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Q_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function Y_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function j_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function q_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function U_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function z_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",ue(2,w_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function K_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,ol,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function X_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function J_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Z_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function $_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function e1(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function t1(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function i1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function n1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",ue(4,Ri,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function a1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",ue(4,Ri,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function o1(i,s){if(i&1&&(n(0,"td",70),E(1,n1,4,7,"ng-container",78)(2,a1,3,7,"ng-template",null,1,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function r1(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function l1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function p1(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,T_))("queryParams",_t(12,ol,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function m1(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function s1(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function c1(i,s){if(i&1&&(n(0,"td",79),E(1,m1,3,4,"ng-container",78)(2,s1,1,1,"ng-template",null,2,O),a()),i&2){let e=Dt(3),r=m().$implicit;c("ngClass",ue(3,rl,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function d1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function u1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",ue(4,Ri,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function _1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",ue(4,Ri,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function g1(i,s){if(i&1&&(n(0,"td",70),E(1,u1,4,7,"ng-container",78)(2,_1,3,7,"ng-template",null,3,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function C1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function f1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,U_,2,1,"td",73)(6,z_,2,5,"td",74)(7,K_,4,9,"td",43)(8,X_,3,3,"td",43)(9,J_,3,3,"td",43)(10,Z_,3,4,"td",43)(11,$_,3,3,"td",43)(12,e1,4,3,"td",43)(13,t1,4,3,"td",43)(14,i1,3,3,"td",43),pt(15),E(16,o1,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,r1,4,3,"td",43)(20,l1,3,3,"td",51)(21,p1,7,16,"td",43)(22,c1,4,6,"td",53)(23,d1,3,3,"td",54)(24,g1,4,2,"td",43)(25,C1,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function x1(i,s){i&1&&b(0,"td",50)}function h1(i,s){i&1&&b(0,"td",50)}function S1(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function y1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function D1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function v1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function w1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function T1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function P1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function F1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function I1(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",ue(13,Ri,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function b1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(13,Ri,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function E1(i,s){if(i&1&&(n(0,"td",70),E(1,I1,7,16,"ng-container",78)(2,b1,6,16,"ng-template",null,4,O),a()),i&2){let e=Dt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function M1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function V1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function B1(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function O1(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",ue(5,rl,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function L1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function R1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(13,ll,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function k1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(13,ll,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function W1(i,s){if(i&1&&(n(0,"td",70),E(1,R1,6,16,"span",53)(2,k1,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function N1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function A1(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,I_,2,0,"th",30)(9,b_,2,0,"th",31)(10,E_,2,0,"th",32)(11,M_,2,0,"th",33)(12,V_,2,0,"th",34)(13,B_,2,0,"th",35)(14,O_,2,0,"th",36)(15,L_,2,0,"th",37)(16,R_,2,0,"th",38)(17,k_,3,0,"ng-container",39)(18,N_,4,7,"ng-container",39)(19,A_,2,0,"th",40)(20,G_,2,0,"th",41)(21,H_,2,1,"th",42)(22,Q_,2,0,"th",43)(23,Y_,2,0,"th",44)(24,j_,2,1,"th",42)(25,q_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,f1,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,x1,1,0,"td",49)(33,h1,1,0,"td",49),b(34,"td",50),E(35,S1,5,7,"td",43)(36,y1,4,6,"td",43)(37,D1,4,6,"td",43)(38,v1,4,7,"td",43)(39,w1,4,6,"td",43)(40,T1,4,6,"td",43)(41,P1,4,6,"td",43)(42,F1,4,6,"td",43),pt(43),E(44,E1,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,M1,4,6,"td",43)(48,V1,4,6,"td",51)(49,B1,5,6,"td",52)(50,O1,3,8,"td",53)(51,L1,4,6,"td",54)(52,W1,3,2,"td",43)(53,N1,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var xa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,To.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,To.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,P_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,F_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,A1,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,y_)),o(3),c("routerLink",M(11,D_)),o(3),c("routerLink",M(12,v_)),o(6),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,L,k,ae,pe,Ce,Te,fe,Bi,se,ai,ne,re,Z,te],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var G1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],H1=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],Q1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],Y1=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),pl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function j1(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function q1(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.isCompare)}}function U1(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function z1(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function K1(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function X1(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function J1(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Z1(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function $1(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",ue(2,Y1,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function eg(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",ue(4,pl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function tg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function ig(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function ng(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,Z1,2,1,"td",31),S(4,$1,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,eg,3,7,"td",34),S(24,tg,3,3,"td",35),S(25,ig,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function ag(i,s){i&1&&b(0,"td",30)}function og(i,s){i&1&&b(0,"td",30)}function rg(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",ue(5,pl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function lg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function pg(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function mg(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,U1,2,0,"th",19),S(7,z1,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,K1,2,0,"th",27),S(21,X1,2,0,"th",28),S(22,J1,2,1,"th",25),a()(),n(23,"tbody"),G(24,ng,26,25,"tr",null,j),a(),n(26,"tfoot")(27,"tr",29),S(28,ag,1,0,"td",30),S(29,og,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,rg,3,8,"td",34),S(57,lg,4,6,"td",35),S(58,pg,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var ha=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,j1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,q1,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,mg,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,G1)),o(3),c("routerLink",M(10,H1)),o(3),c("routerLink",M(11,Q1)),o(6),y(t.data?20:-1))},dependencies:[A,Ze,Q,$,J,L,k,ae,pe,Ce,Te,se,ne,Z,te],encapsulation:2})};var sg=()=>["/menu/Reports/Sales_Report/Standard/Compare"],cg=i=>({"flex-right":i});function dg(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function ug(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function _g(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,cg,e!="Outlet")),o(),D(" ",e)}}function gg(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function Cg(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function fg(i,s){if(i&1&&(n(0,"td"),S(1,gg,2,1,"div",14),S(2,Cg,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function xg(i,s){if(i&1&&(n(0,"tr"),G(1,fg,3,2,"td",null,j),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function hg(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function Sg(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,hg,3,3,"td",17,j),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function yg(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,_g,2,7,"th",13,j),a()(),n(6,"tbody"),G(7,xg,3,0,"tr",null,j),a(),S(9,Sg,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var Sa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],C)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,dg,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,ug,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,yg,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,sg)),o(6),y(t.data?9:-1))},dependencies:[A,Ze,Q,$,L,k,ae,pe,Ce,ze,Z],encapsulation:2})};var Dg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],vg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],wg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Tg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Pg=(i,s)=>({From:i,To:s}),Fg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],Ig=i=>({ID:i}),bg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Eg=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),Mg=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),Vg=i=>({SalesID:i});function Bg(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function Og(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),f("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),f("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Lg(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function Rg(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function kg(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function Wg(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function Ng(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function Ag(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Gg(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Hg(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Qg(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function Yg(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function jg(i,s){if(i&1&&(pt(0),E(1,Qg,2,0,"th",53)(2,Yg,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function qg(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function Ug(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function zg(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function Kg(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Xg(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,bg))("queryParams",dn(13,Eg,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Jg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Zg(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function $g(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function eC(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",zt(10,Mg,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function tC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function iC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function nC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function aC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function oC(i,s){if(i&1&&(pt(0),E(1,nC,3,3,"td",44)(2,aC,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function rC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function lC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function pC(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,Vg,e.ID)),o(),F(g(4,2,e.Commission))}}function mC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,Kg,2,1,"td",9)(5,Xg,6,19,"td",40)(6,Jg,3,3,"td",41),d(7,"HideSumZero"),E(8,Zg,4,3,"ng-container",9)(9,$g,3,3,"td",42),d(10,"HideSumZero"),E(11,eC,6,15,"td",40)(12,tC,3,3,"td",43)(13,iC,3,3,"td",44)(14,oC,3,2,"ng-container",9)(15,rC,3,4,"td",41)(16,lC,3,4,"td",41)(17,pC,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,Fg))("queryParams",X(22,Ig,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function sC(i,s){i&1&&b(0,"td")}function cC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function dC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function uC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function _C(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function gC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function CC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function fC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function xC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function hC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function SC(i,s){if(i&1&&(pt(0),E(1,xC,4,6,"td",44)(2,hC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function yC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function DC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function vC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function wC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,Lg,2,0,"th",27)(9,Rg,2,0,"th",28)(10,kg,2,0,"th",29),d(11,"HideSumZero"),E(12,Wg,3,0,"ng-container",9)(13,Ng,2,0,"th",30),d(14,"HideSumZero"),E(15,Ag,2,0,"th",31)(16,Gg,2,0,"th",32)(17,Hg,2,0,"th",33)(18,jg,3,2,"ng-container",9)(19,qg,2,0,"th",34)(20,Ug,2,0,"th",35)(21,zg,2,0,"th",36),a()(),n(22,"tbody"),E(23,mC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,sC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,cC,4,7,"td",40)(30,dC,4,6,"td",41),d(31,"HideSumZero"),E(32,uC,5,6,"ng-container",9)(33,_C,4,7,"td",42),d(34,"HideSumZero"),E(35,gC,4,6,"td",40)(36,CC,4,6,"td",43)(37,fC,4,6,"td",44)(38,SC,3,2,"ng-container",9)(39,yC,4,7,"td",41)(40,DC,4,7,"td",41)(41,vC,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ya=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=C}isShowCommission=!1;roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"Target":return this.compare(t.Target,l.Target,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,C);case"Commission":return this.compare(t.Commission,l.Commission,C);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(qt(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(tt({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(mr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,Bg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,Og,22,13,"ng-template",null,0,O),a(),E(25,wC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,Dg)),o(3),c("routerLink",M(19,vg)),o(3),c("routerLink",M(20,wg)),o(3),c("routerLink",M(21,Tg))("queryParams",ue(22,Pg,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,k,ae,pe,Ce,Te,U,se,ai,ne,re,Z],encapsulation:2})};var TC=()=>["/menu/Reports/Sales_Report/Standard/Person"],PC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],FC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],IC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],bC=(i,s)=>({From:i,To:s}),ml=i=>({ID:i}),sl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function EC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function MC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),c("width",100),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function VC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),f("date",e.pageData.Filter.From),c("width",100),o(2),f("date",e.pageData.Filter.To),c("width",100)}}function BC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,MC,10,6)(10,VC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),f("model",e.pageData.Filter.isCreated)}}function OC(i,s){i&1&&b(0,"app-empty-state")}function LC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function RC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function kC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,LC,2,0,"th",36),S(14,RC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ml,e.ID)),o(),ei("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function WC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);qi("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",zt(14,sl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function NC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",zt(10,sl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function AC(i,s){if(i&1&&(n(0,"td",38),S(1,WC,6,19,"div",39),S(2,NC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function GC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function HC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,AC,3,2,"td",38),S(13,GC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ml,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function QC(i,s){if(i&1&&(n(0,"tbody"),G(1,HC,14,13,"tr",null,j),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function YC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;qi("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function jC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function qC(i,s){if(i&1&&(n(0,"td",38),S(1,YC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,jC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function UC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function zC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,qC,6,11,"td",38),S(13,UC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function KC(i,s){if(i&1&&(n(0,"table",14),S(1,kC,15,7,"thead",31),S(2,QC,3,0,"tbody"),S(3,zC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function XC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,EC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,BC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,OC,1,0,"app-empty-state"),n(31,"div",13),G(32,KC,4,3,"table",14,j),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,TC)),o(3),c("routerLink",M(18,PC)),o(3),c("routerLink",M(19,FC)),o(3),c("routerLink",M(20,IC))("queryParams",ue(21,bC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Da=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,XC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,k,ae,Te,Vi,U,ze,Ar,se,re,Z,te],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var JC=()=>["/menu/Reports/Sales_Report/Standard/Person"],ZC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],$C=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],ef=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],tf=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Po=i=>({ID:i}),nf=()=>["/menu/Products/Catalog/Variants/Info"],af=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function of(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function rf(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),f("ngModel",e.pageData.Filter.SalesID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function lf(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function pf(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function mf(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function sf(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function cf(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function df(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function uf(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function _f(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function gf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function Cf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function ff(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function xf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,tf))("queryParams",X(4,Po,e.ID)),o(),F(e.Number)}}function hf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,nf))("queryParams",X(4,Po,e.VariantID)),o(),F(e.VariantName)}}function Sf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,af))("queryParams",X(4,Po,e.SalesID)),o(),F(e.SalesName)}}function yf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Df(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function vf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function wf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function Tf(i,s){if(i&1&&(n(0,"tr"),E(1,Cf,3,4,"td",21)(2,ff,2,1,"td",21)(3,xf,3,6,"td",21)(4,hf,3,6,"td",21)(5,Sf,3,6,"td",21)(6,yf,3,3,"td",27)(7,Df,3,4,"td",27)(8,vf,3,4,"td",27)(9,wf,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function Pf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Ff(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function If(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function bf(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function Ef(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Mf(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function Vf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,lf,2,0,"th",20)(5,pf,2,0,"th",20)(6,mf,2,0,"th",20)(7,sf,2,0,"th",21)(8,cf,2,0,"th",21)(9,df,2,0,"th",22)(10,uf,2,0,"th",22)(11,_f,2,0,"th",22)(12,gf,2,0,"th",22),a()(),n(13,"tbody"),E(14,Tf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,Pf,4,7,"td",27)(24,Ff,4,7,"td",27)(25,If,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,bf,3,0,"span",32)(32,Ef,3,3,"span",21),p(33),a()(),E(34,Mf,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,C);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T}roleService=Fe(Y);columnService=Fe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,of,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,rf,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,Vf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,JC)),o(3),c("routerLink",M(12,ZC)),o(3),c("routerLink",M(13,$C)),o(3),c("routerLink",M(14,ef)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,k,ae,U,ze,se,ne,re,te],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],dl=i=>({ID:i});function Bf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Of(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),f("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("model",e.pageData.Filter.NoteVisible),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Lf(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function Rf(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function kf(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function Wf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Nf(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,dl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Af(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Gf(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Hf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Gf,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Qf(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function Yf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Af,3,3,"th",50),S(17,Hf,4,4,"th",51),S(18,Qf,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function jf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function qf(i,s){if(i&1&&(n(0,"table",41),G(1,jf,8,5,"tr",null,j),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Uf(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,qf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function zf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,Wf,2,0,"span"),S(7,Nf,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,Yf,19,13,"tr",null,j),a(),S(26,Uf,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,cl))("queryParams",X(22,dl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Kf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Xf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Jf(i,s){if(i&1&&(n(0,"div",30),S(1,Kf,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Xf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function Zf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,Lf,2,1,"th",26),S(18,Rf,2,0,"th",27),S(19,kf,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,zf,27,24,"div",null,j),a()()()(),S(25,Jf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),si("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var wa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=C;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bf,3,0,"button",2),a(),n(3,"filters"),E(4,Of,32,20,"ng-template",null,0,O),a(),S(6,Zf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,k,Te,Ne,fe,U,se,re,Z,te],encapsulation:2})};var ul=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Fo=i=>({ID:i}),$f=()=>["/menu/Contacts/Contact/Suppliers/Info"];function ex(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function tx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ix(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function nx(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function ax(i,s){i&1&&(n(0,"th",15),p(1," Total Amount "),a())}function ox(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function rx(i,s){i&1&&b(0,"br")}function lx(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,ul))("queryParams",X(4,Fo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function px(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function mx(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function sx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function cx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function dx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,rx,1,0,"br"),S(7,lx,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,px,3,3,"td",21),S(18,mx,3,3,"td",22),S(19,sx,3,3,"td",21),S(20,cx,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,ul))("queryParams",X(26,Fo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,$f))("queryParams",X(29,Fo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),qi("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function ux(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function _x(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function gx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function Cx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function fx(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function xx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function hx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function Sx(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function yx(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,ex,3,0,"button",3),a(),n(3,"filters"),E(4,tx,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,ix,2,0,"th",13),S(23,nx,2,0,"th",14),S(24,ax,2,0,"th",15),S(25,ox,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,dx,23,31,"tr",null,j),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total:"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,ux,4,6,"td",21),S(41,_x,4,6,"td",22),S(42,gx,4,6,"td",21),S(43,Cx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,fx,3,0,"span",27)(51,xx,3,3,"span",28),p(52),a()(),E(53,hx,3,0,"a",29)(54,Sx,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),f("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Ta=class i extends Pi{constructor(e,r,t,l,C,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=C;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),C);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,C);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,C);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){r&1&&S(0,yx,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,Te,Ne,U,se,ne,re,Z,te],encapsulation:2})};var Dx=()=>["/menu/Contacts/Contact/Suppliers/Info"],vx=i=>({ID:i}),wx=(i,s,e)=>({SupplierID:i,From:s,To:e}),Tx=()=>["/menu/Reports/Purchases_Report/Summary"];function Px(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Fx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Ix(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function bx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,wx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,Tx)),o(3),F(g(5,9,e.Total))}}function Ex(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,bx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,Dx))("queryParams",X(10,vx,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function Mx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function Vx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function Bx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,Ix,2,0,"th",20),a()(),n(15,"tbody"),G(16,Ex,12,12,"tr",21,j),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,Mx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,Vx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var Pa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Px,3,0,"button",2),a(),n(3,"filters"),E(4,Fx,17,11,"ng-template",null,0,O),a(),S(6,Bx,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,k,pe,Ce,Ue,Et,U,re,Z,te],encapsulation:2})};var Ox=i=>[i],Lx=i=>({ID:i}),Rx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function kx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Wx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Nx(i,s){i&1&&(n(0,"th",22),p(1," Amount "),a())}function Ax(i,s){i&1&&(n(0,"th",23),p(1," Avg Cost "),a())}function Gx(i,s){if(i&1&&(n(0,"td",26)(1,"a",29),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",zt(4,Rx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),F(g(3,2,e.Total))}}function Hx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.AvgPrice)," ")}}function Qx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",28),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",26),p(9),d(10,"number"),a(),n(11,"td",26),p(12),d(13,"quantityFraction"),a(),S(14,Gx,4,9,"td",26),S(15,Hx,3,3,"td",26),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(13,Ox,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(15,Lx,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(10,9,e.Order)),o(3),F(g(13,11,e.Quantity)),o(2),y(t.roleService.product.Cost?14:-1),o(),y(t.roleService.product.Cost?15:-1)}}function Yx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Total"))," ")}}function jx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"AvgPrice"))," ")}}function qx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Name"),a(),n(10,"th",19),p(11,"Code"),a(),n(12,"th",20),p(13," Orders "),a(),n(14,"th",21),p(15," Quantity "),a(),S(16,Nx,2,0,"th",22),S(17,Ax,2,0,"th",23),a()(),n(18,"tbody"),G(19,Qx,16,17,"tr",null,j),a(),n(21,"tfoot")(22,"tr",24),b(23,"td")(24,"td",25),n(25,"td"),p(26,"Total :"),a(),n(27,"td",26),p(28),d(29,"sum"),d(30,"number"),a(),n(31,"td",26),p(32),d(33,"sum"),d(34,"quantityFraction"),a(),S(35,Yx,4,6,"td",26),S(36,jx,4,6,"td",26),a()()()(),n(37,"infinite-pagination",27),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(2),H(e.infiniteList),o(9),D(" ",g(30,15,v(29,12,e.infiniteList,"Order"))," "),o(4),D(" ",g(34,20,v(33,17,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?35:-1),o(),y(e.roleService.product.Cost?36:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Fa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=yi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=yi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","AvgPrice","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,kx,3,0,"button",2),a(),n(3,"filters"),E(4,Wx,23,15,"ng-template",null,0,O),a(),S(6,qx,38,22,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,Te,fe,U,oi,se,ne,Z,te],encapsulation:2})};var Ux=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Ia=i=>({ID:i}),zx=()=>["/menu/Products/Catalog/Variants/Info"],Kx=()=>["/menu/Contacts/Contact/Suppliers/Info"],Xx=()=>["/menu/Products/Catalog/Products/Info"];function Jx(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Zx(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function $x(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function eh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,Zx,4,2,"div",3)(12,$x,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function th(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function ih(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function nh(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function ah(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function oh(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function rh(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function lh(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function ph(i,s){i&1&&(n(0,"th",41),p(1," Measurement "),a())}function mh(i,s){i&1&&(n(0,"th",42),p(1," Cost "),a())}function sh(i,s){i&1&&(n(0,"th",43),p(1," Total Cost "),a())}function ch(i,s){i&1&&(n(0,"th",40),p(1," Item(%) "),a())}function dh(i,s){i&1&&(n(0,"th",44),p(1," Item Disc "),a())}function uh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function _h(i,s){i&1&&(n(0,"th",44),p(1," Bill Disc "),a())}function gh(i,s){if(i&1&&(n(0,"th",45),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.CurrencySymbol,") ")}}function Ch(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function fh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function xh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function hh(i,s){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,Kx))("queryParams",X(4,Ia,e.SupplierID)),o(),F(e.SupplierName)}}function Sh(i,s){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,Xx))("queryParams",X(4,Ia,e.ProductID)),o(),F(e.Name)}}function yh(i,s){if(i&1&&b(0,"td",50),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function Dh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function vh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function wh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function Th(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SumUnitPrice)," ")}}function Ph(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?e.Discount:""," ")}}function Fh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):""," ")}}function Ih(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?e.DiscountInvoice:""," ")}}function bh(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?e.OrderDiscountAmount:""," ")}}function Eh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Total)," ")}}function Mh(i,s){if(i&1&&(n(0,"tr",46),E(1,Ch,3,4,"td",3)(2,fh,2,1,"td",3),n(3,"td")(4,"a",47),p(5),a()(),E(6,xh,2,1,"td",3)(7,hh,3,6,"td",3)(8,Sh,3,6,"td",3),n(9,"td")(10,"a",47),p(11),a()(),E(12,yh,1,1,"td",48)(13,Dh,3,3,"td",35)(14,vh,3,3,"td",35)(15,wh,3,3,"td",49)(16,Th,3,3,"td",49)(17,Ph,2,1,"td",35)(18,Fh,3,3,"td",35)(19,Ih,2,1,"td",35)(20,bh,2,1,"td",35)(21,Eh,3,3,"td",35),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Ux))("queryParams",X(22,Ia,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,zx))("queryParams",X(25,Ia,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.ItemNote.selected),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",(e==null||e.Data==null?null:e.Data.VariantQuantity)>1),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.TotalCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Total.selected)}}function Vh(i,s){i&1&&b(0,"td",34)}function Bh(i,s){i&1&&b(0,"td",34)}function Oh(i,s){i&1&&b(0,"td",34)}function Lh(i,s){i&1&&b(0,"td",34)}function Rh(i,s){i&1&&(n(0,"td",51),p(1," Total : "),a())}function kh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Wh(i,s){i&1&&b(0,"td",34)}function Nh(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Total"))," ")}}function Ah(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,th,2,0,"th",22)(7,ih,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,nh,2,0,"th",24)(11,ah,2,0,"th",3)(12,oh,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,rh,2,0,"th",3)(16,lh,2,0,"th",25)(17,ph,2,0,"th",26)(18,mh,2,0,"th",27)(19,sh,2,0,"th",28)(20,ch,2,0,"th",25)(21,dh,2,0,"th",29)(22,uh,2,0,"th",25)(23,_h,2,0,"th",29)(24,gh,2,1,"th",30),a()(),n(25,"tbody"),E(26,Mh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,Vh,1,0,"td",33)(30,Bh,1,0,"td",33)(31,Oh,1,0,"td",33)(32,Lh,1,0,"td",33),b(33,"td",34),E(34,Rh,2,0,"td",35)(35,kh,4,6,"td",35)(36,Wh,1,0,"td",33)(37,Nh,4,6,"td",36),a()()()(),n(38,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.ItemNote.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.TotalCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.column.Supplier.selected),o(2),c("ngIf",e.column.Qty.selected||e.column.Total.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),c("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var ba=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C;this.matDialog=T}columnService=Fe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Fulfillment:{selected:!1},Supplier:{selected:!0},ItemNote:{selected:!1,name:"Item Note"},Qty:{selected:!0,name:"Qty"},Cost:{selected:!0,name:"Cost"},TotalCost:{selected:!1,name:"Total Cost"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},Total:{selected:!0,name:"Total (RP)"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Cost for one quantity before discount",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end","title","Cost multiplied by quantity after discount",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],["title","Cost for one quantity before discount",1,"text-end",2,"width","75px"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],[1,"text-end",2,"width","70px"],["title","Cost multiplied by quantity after discount",1,"text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Jx,3,0,"button",2),a(),n(3,"filters"),E(4,eh,28,18,"ng-template",null,0,O),a(),E(6,Ah,39,26,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,k,Te,Ne,Et,U,se,re,Z,te],encapsulation:2})};var Gh=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function Hh(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Qh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function Yh(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function jh(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function qh(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,jh,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function Uh(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function zh(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,Yh,2,0,"th",17),a()(),n(13,"tbody"),G(14,qh,11,11,"tr",18,j),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,Uh,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ea=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Hh,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,Qh,20,14,"ng-template",null,0,O),a(),S(8,zh,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Gh)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,k,ae,Te,fe,U,se,ne,re,Z,te],encapsulation:2})};var Kh=()=>["/menu/Reports/Purchases_Report/Daily"];function Xh(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function Jh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),h("selectedCategoryIDChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),f("ngModel",e.pageData.Filter.SupplierID)}}function Zh(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function $h(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function e2(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,$h,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function t2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function i2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Xh,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,Jh,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,Zh,2,0,"th",8),a()(),n(18,"tbody"),G(19,e2,7,5,"tr",9,j),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,t2,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,Kh)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var Ma=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,i2,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,k,ae,Te,Ne,fe,U,se,Z,te],encapsulation:2})};function n2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function a2(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Va=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,n2,11,8,"ng-template",null,0,O),a(),S(5,a2,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,k,Mt,fe,U],encapsulation:2})};var o2=()=>["/menu/Products/Catalog/Products/Info"],r2=i=>({ID:i});function l2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function p2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function m2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,o2))("queryParams",X(15,r2,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function s2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,m2,17,17,"tr",20,j),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ba=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,l2,3,0,"button",2),a(),n(3,"filters"),E(4,p2,17,10,"ng-template",null,0,O),a(),S(6,s2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,k,Ue,fe,U,ne,te],encapsulation:2})};var c2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],d2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],u2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),_2=(i,s,e)=>({EntityID:i,From:s,To:e}),g2=()=>["/menu/Reports/Purchases_Report/Summary"];function C2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function f2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),h("modelChange",function(t){u(e);let l=m(2);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("model",e.isCompare)}}function x2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function h2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function S2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,f2,4,1,"div"),S(11,x2,7,2,"div"),S(12,h2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),f("model",e.pageData.Filter.ExcludeComplementary)}}function y2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function D2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function v2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function w2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function T2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function P2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function F2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function I2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",ue(2,u2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function b2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function E2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function M2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function V2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,_2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,g2)),o(4),F(g(6,9,e.SalesWithTax))}}function B2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,F2,2,1,"td",38),S(4,I2,2,5,"td",40),S(5,b2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,E2,3,3,"td",38),S(10,M2,3,3,"td",39),d(11,"HideSumZero"),S(12,V2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function O2(i,s){i&1&&b(0,"td",37)}function L2(i,s){i&1&&b(0,"td",37)}function R2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function k2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function W2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function N2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function A2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,y2,2,0,"th",28),S(9,D2,2,0,"th",29),S(10,v2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,w2,2,0,"th",32),S(14,T2,2,1,"th",33),d(15,"HideSumZero"),S(16,P2,2,1,"th",34),a()(),n(17,"tbody"),G(18,B2,13,13,"tr",null,j),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,O2,1,0,"td",37),S(24,L2,1,0,"td",37),S(25,R2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,k2,4,6,"td",38),S(31,W2,4,6,"td",39),d(32,"HideSumZero"),S(33,N2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach($e=>$e.Label=$e.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Count":return V.compare(t.Count,l.Count,C);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"SalesNet":return V.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,C2,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,S2,16,10,"ng-template",null,0,O),a(),S(16,A2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,c2)),o(3),c("routerLink",M(9,d2)),o(5),y(t.data?16:-1))},dependencies:[A,Ze,Q,$,J,L,k,ae,pe,Ce,Te,fe,se,ai,ne,re,Z,te],encapsulation:2})};var G2=()=>["/menu/Reports/Purchases_Report/Outlet"],H2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Q2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),Y2=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function j2(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function q2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function U2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function z2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),h("modelChange",function(t){u(e);let l=m(3);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),f("model",e.isCompare)}}function K2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),h("modelChange",function(t){u(e);let l=m(2);return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,q2,6,2),S(6,U2,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,z2,3,1),a()()}if(i&2){let e=m(2);o(4),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function X2(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function J2(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function Z2(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function $2(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function eS(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",ue(2,Q2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function tS(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",ue(5,Y2,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function iS(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,$2,2,1,"td",22),S(4,eS,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,tS,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function nS(i,s){i&1&&b(0,"td",21)}function aS(i,s){i&1&&b(0,"td",21)}function oS(i,s){i&1&&b(0,"td")}function rS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,j2,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,K2,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,X2,2,0,"th",12),S(24,J2,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,Z2,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,iS,21,20,"tr",null,j),a(),n(39,"tfoot")(40,"tr",20),S(41,nS,1,0,"td",21),S(42,aS,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,oS,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,G2)),o(3),c("routerLink",M(47,H2)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var La=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach($e=>$e.Label=$e.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNet":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,rS,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Ze,Q,$,J,L,k,ae,pe,Ce,Te,se,ne,Z,te],encapsulation:2})};var lS=()=>["/menu/Reports/Purchases_Report/Outlet"],pS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function mS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function sS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function cS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function dS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function uS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function _S(i,s){if(i&1&&(n(0,"td"),S(1,dS,2,1,"p",17),S(2,uS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function gS(i,s){if(i&1&&(n(0,"tr"),G(1,_S,3,2,"td",null,j),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function CS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function fS(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,CS,3,3,"td",null,j),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function xS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,mS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,sS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,cS,2,2,"th",11,j),a()(),n(23,"tbody"),G(24,gS,3,0,"tr",null,j),a(),S(26,fS,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,lS)),o(3),c("routerLink",M(9,pS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Ra=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,C)=>{let T=e.direction==="asc";for(let $e=0;$e<this.data.Dataheader.length;$e++)if(e.active==this.data.Dataheader[$e])return typeof l[this.data.Dataheader[$e]]=="string"?t(l[this.data.Dataheader[$e]].toLocaleLowerCase(),C[this.data.Dataheader[$e]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[$e]],C[this.data.Dataheader[$e]],T)});function t(l,C,T){return(l<C?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,xS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,k,pe,Ce,Z],encapsulation:2})};var hS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],SS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],yS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],DS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],vS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],wS=i=>({ID:i});function TS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function PS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(4),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function FS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,wS,e.CityID)),o(),F(e.CityName)}}function IS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function bS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,FS,2,4,"a",26),S(4,IS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function ES(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,bS,11,12,"tr",null,j),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var ka=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,C);case"CityName":return this.compare(t.CityName,l.CityName,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Average":return this.compare(t.Average,l.Average,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,TS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,PS,13,6,"ng-template",null,0,O),a(),S(25,ES,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,hS)),o(3),c("routerLink",M(12,SS)),o(3),c("routerLink",M(13,yS)),o(3),c("routerLink",M(14,DS)),o(3),c("routerLink",M(15,vS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,fe,se,ne,Z,te],encapsulation:2})};var MS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],VS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],BS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],OS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],LS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function RS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function kS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function WS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function NS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function AS(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function GS(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function HS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,AS,2,3,"td",28),S(11,GS,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function QS(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function YS(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function jS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,WS,2,0,"th",20),S(17,NS,2,0,"th",20),a()(),n(18,"tbody"),G(19,HS,12,15,"tr",null,j),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,QS,4,6,"td",24),S(41,YS,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Wa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,C);case"Trans":return this.compare(t.Trans,l.Trans,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,RS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,kS,9,5,"ng-template",null,0,O),a(),S(25,jS,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,MS)),o(3),c("routerLink",M(12,VS)),o(3),c("routerLink",M(13,BS)),o(3),c("routerLink",M(14,OS)),o(3),c("routerLink",M(15,LS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,k,pe,U,se,ne,Z,te],encapsulation:2})};var qS=()=>["/menu/Reports/Sales_Report/Standard/Person"],US=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],zS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],KS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],XS=(i,s)=>({From:i,To:s});function JS(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function ZS(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function $S(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function ey(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function ty(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,ey,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function iy(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function ny(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,$S,2,0,"th",24),a()(),n(18,"tbody"),E(19,ty,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,iy,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var Na=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,JS,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,ZS,9,5,"ng-template",null,0,O),a(),E(25,ny,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,qS)),o(3),c("routerLink",M(18,US)),o(3),c("routerLink",M(19,zS)),o(3),c("routerLink",M(20,KS))("queryParams",ue(21,XS,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,k,ae,pe,U,se,ne,re,Z],encapsulation:2})};var ay=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],oy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],ry=i=>({ID:i});function ly(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,ay))}function py(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function my(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),f("date",e.pageData.Filter.From),o(3),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function sy(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function cy(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,Si(1,1,t.data.Compenents,r,e)),Ee)}}function dy(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,cy,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,oy))("queryParams",X(18,ry,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function uy(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function _y(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function gy(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Cy(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function fy(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function xy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,sy,1,1,"th",28),a()(),n(21,"tbody"),E(22,dy,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,uy,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,_y,3,0,"span",37)(41,gy,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,Cy,3,0,"a",39)(45,fy,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Aa=class i extends Pi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,ly,2,2,"a",2)(3,py,3,0,"a",3),a(),n(4,"filters"),E(5,my,18,10,"ng-template",null,0,O),a(),E(7,xy,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,U,se,Ii,ne,re,Z],encapsulation:2})};var hy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function Sy(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function yy(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function Dy(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function vy(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function wy(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function Ty(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,Si(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function Py(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,wy,3,4,"td",23),G(7,Ty,3,8,"td",18,j),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Fy(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function Iy(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function by(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,Dy,2,0,"th",17),G(9,vy,1,1,"th",18,j),a()(),n(11,"tbody"),G(12,Py,9,6,"tr",null,j),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Fy,4,7,"td",21),G(22,Iy,3,4,"td",22,j),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Ga=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,Sy,3,0,"a",3),a(),n(5,"filters"),E(6,yy,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,by,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(8,hy)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,k,ae,pe,Ce,U,se,Ii,ne],encapsulation:2})};var Ey=()=>["/menu/Products/Catalog/Variants/Info"],My=i=>({ID:i});function Vy(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function By(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID)}}function Oy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function Ly(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function Ry(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function ky(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function Wy(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Ny(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function Ay(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function Gy(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function Hy(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function Qy(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function Yy(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function jy(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function qy(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function Uy(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function zy(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function Ky(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Xy(i,s){if(i&1&&(n(0,"tr",34),E(1,Hy,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,Qy,2,1,"td",3)(6,Yy,3,4,"td",3)(7,jy,3,3,"td",36)(8,qy,3,4,"td",3)(9,Uy,3,4,"td",3)(10,zy,3,3,"td",37)(11,Ky,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,Ey))("queryParams",X(12,My,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function Jy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,Oy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,Ly,2,0,"th",18)(9,Ry,2,0,"th",19)(10,ky,2,0,"th",20)(11,Wy,2,0,"th",21)(12,Ny,2,0,"th",22)(13,Ay,2,0,"th",23)(14,Gy,2,0,"th",24),a()(),n(15,"tbody"),E(16,Xy,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Ha=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",C);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=C}roleService=Fe(Y);columnService=Fe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),C);case"number":return this.compare(t[e.active],l[e.active],C);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(tt({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Vy,3,0,"a",2),a(),n(3,"filters"),E(4,By,15,8,"ng-template",null,0,O),a(),E(6,Jy,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,k,ae,pe,Ce,fe,U,ze,ne,re,te],encapsulation:2})};function Zy(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function $y(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function eD(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function tD(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function iD(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function nD(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function aD(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,iD,3,3,"td",26),S(19,nD,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function oD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function rD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function lD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,oD,4,6,"td",29),S(18,rD,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function pD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,eD,2,0,"th",21),S(21,tD,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,aD,23,18,"tr",23,j),a(),S(27,lD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Qa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Zy,3,0,"a",2),a(),n(3,"filters"),E(4,$y,18,10,"ng-template",null,0,O),a(),S(6,pD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,k,ae,pe,Ce,Ue,Ne,fe,U,se,Z,te],encapsulation:2})};var mD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],sD=i=>({ID:i});function cD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function dD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function uD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,mD))("queryParams",X(12,sD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function _D(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,uD,14,14,"tr",14,j),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ya=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cD,3,0,"a",2),a(),n(3,"filters"),E(4,dD,12,7,"ng-template",null,0,O),a(),S(6,_D,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,k,fe,U,Z,te],encapsulation:2})};function gD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function CD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function fD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function xD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,CD,4,1,"div"),S(13,fD,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function hD(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function SD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,hD,11,8,"tr",20,j),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,gD,3,0,"a",2),a(),n(3,"filters"),E(4,xD,17,11,"ng-template",null,0,O),a(),S(6,SD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,k,Ue,Te,Ne,U,te],encapsulation:2})};var yD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],DD=i=>({ID:i});function vD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function wD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function TD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,yD))("queryParams",X(21,DD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function PD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,TD,24,23,"tr",null,j),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var qa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vD,3,0,"a",2),a(),n(3,"filters"),E(4,wD,12,6,"ng-template",null,0,O),a(),S(6,PD,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,k,Ne,U,se,re,Z,te],encapsulation:2})};var FD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],ID=i=>({ID:i});function bD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function ED(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function MD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function VD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function BD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,VD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function OD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function LD(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,BD,14,13,"tr",24,j),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,OD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,FD))("queryParams",X(28,ID,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function RD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,MD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,LD,36,30,"div",null,j),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var Ua=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,bD,3,0,"a",2),a(),n(3,"filters"),E(4,ED,12,6,"ng-template",null,0,O),a(),S(6,RD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,k,Ne,U,se,Ln,re,Z,te],encapsulation:2})};var kD=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],WD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],_l=i=>({ID:i});function ND(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function AD(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.RowCount),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),f("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),f("ngModel",e.pageData.Filter.VariantID)}}function GD(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function HD(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function QD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function YD(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function jD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,QD,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,YD,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,WD))("queryParams",X(28,_l,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,_l,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),ei(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function qD(i,s){i&1&&b(0,"td",39)}function UD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,qD,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function zD(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,GD,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,HD,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,jD,28,32,"tr",null,j),a(),S(25,UD,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var za=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=kn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,C);case"Date":return this.compare(t.Date,l.Date,C);case"Number":return this.compare(t.Number,l.Number,C);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,C);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,C);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,C);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,C);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ND,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,AD,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,zD,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,kD)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,k,ae,pe,Ce,Ue,Ne,Et,fe,U,ze,se,ne,re],encapsulation:2})};var KD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],XD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],JD=()=>["/menu/Contacts/Contact/Customers/Info"],ZD=i=>({ID:i}),gl=(i,s)=>({"text-danger":i,"text-success":s});function $D(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function ev(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function tv(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function iv(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function nv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function av(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",ue(4,gl,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function ov(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,nv,3,3,"td",36),S(10,av,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function rv(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,ov,11,9,"tr",null,j),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,JD))("queryParams",X(8,ZD,e.CustomerID)),o(),ei(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function lv(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function pv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(4,gl,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function mv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,lv,3,3,"td",41),S(10,pv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function sv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,tv,2,0,"th",27),S(19,iv,2,0,"th",28),a()(),n(20,"tbody"),G(21,rv,14,10,"tr",29,j),a(),S(23,mv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ka=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,C);case"Cost":return this.compare(t.TotalCost,l.TotalCost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,$D,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,ev,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,sv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,KD)),o(3),c("routerLink",M(11,XD)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,Ze,Q,$,J,Qe,L,k,pe,Ce,Ue,Et,Z,te],encapsulation:2})};var cv=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),dv=()=>["/menu/Reports/Sales_Report/Standard/Detail"],uv=(i,s,e)=>({From:i,To:s,TypeID:e}),Cl=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ja=(i,s)=>({"text-danger":i,"text-success":s});function _v(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function gv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function Cv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,gv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function fv(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function xv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function hv(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function Sv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function yv(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function Dv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function vv(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function wv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function Tv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Pv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Fv(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function Iv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function bv(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",ue(2,cv,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Ev(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function Mv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function Vv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Bv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,dv))("queryParams",_t(12,uv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function Ov(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",ue(4,Cl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function Lv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Rv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function kv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Wv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",ue(4,Ja,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Nv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",ue(4,Ja,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function Av(i,s){if(i&1&&(n(0,"td",29),S(1,Wv,3,7,"span",38),S(2,Nv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function Gv(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,Iv,2,1,"td",29),S(6,bv,2,5,"td",41),S(7,Ev,3,3,"td",29),S(8,Mv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,Vv,3,3,"td",36),d(13,"HideSumZero"),S(14,Bv,7,16,"td",29),S(15,Ov,3,7,"td",38),S(16,Lv,3,3,"td",39),S(17,Rv,3,3,"td",40),S(18,kv,3,3,"td",29),d(19,"HideSumZero"),S(20,Av,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function Hv(i,s){i&1&&b(0,"td",35)}function Qv(i,s){i&1&&b(0,"td",35)}function Yv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function jv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function qv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Uv(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function zv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",ue(5,Cl,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function Kv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Xv(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function Jv(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function Zv(i,s){if(i&1&&(n(0,"td",40),S(1,Xv,4,6,"span"),S(2,Jv,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function $v(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function e3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(22,Ja,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function t3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",ue(22,Ja,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function i3(i,s){if(i&1&&(n(0,"td",29),S(1,e3,9,25,"span",38),S(2,t3,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function n3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,fv,2,0,"th",22),S(10,xv,2,0,"th",23),S(11,hv,2,0,"th",24),S(12,Sv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,yv,2,0,"th",27),d(16,"HideSumZero"),S(17,Dv,2,1,"th",28),S(18,vv,2,0,"th",29),S(19,wv,2,0,"th",30),S(20,Tv,2,1,"th",28),S(21,Pv,2,0,"th",31),d(22,"HideSumZero"),S(23,Fv,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,Gv,23,28,"tr",null,j),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,Hv,1,0,"td",35),S(34,Qv,1,0,"td",35),S(35,Yv,4,7,"td",29),S(36,jv,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,qv,4,6,"td",36),d(42,"HideSumZero"),S(43,Uv,5,6,"td",37),S(44,zv,3,8,"td",38),S(45,Kv,4,6,"td",39),S(46,Zv,3,2,"td",40),S(47,$v,4,6,"td",29),d(48,"HideSumZero"),S(49,i3,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var Xa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,_v,3,0,"button",2),a(),n(3,"filters"),E(4,Cv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,n3,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,Ze,Q,$,J,L,k,ae,pe,Ce,Te,U,se,ai,ne,re,Z,te],encapsulation:2})};var fl=Zt(bo());var a3=new $t("HIGHCHARTS_LOADER"),o3=new $t("HIGHCHARTS_ROOT_MODULES"),r3=new $t("HIGHCHARTS_OPTIONS"),l3=new $t("HIGHCHARTS_CONFIG"),p3=new $t("HIGHCHARTS_TIMEOUT"),m3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Fe(a3),this.globalOptions=Fe(r3,{optional:!0}),this.globalModules=Fe(o3,{optional:!0})}loadHighchartsWithModules(r){return Qi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=on({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),s3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){un(()=>Qi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Qi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=Di("chart"),this.oneToOne=Di(!1),this.options=Di.required(),this.update=_n(),this.chartInstance=qo(),this.destroyRef=Fe(Wo),this.el=Fe(No),this.platformId=Fe(Ao),this.relativeConfig=Fe(l3,{optional:!0}),this.timeout=Fe(p3,{optional:!0}),this.highchartsChartService=Fe(m3),this.chartCreated=!1,this.constructorChart=yi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=yi(()=>Qi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,jo(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&Jo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),Ko(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=mn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Za=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[sn([{directive:s3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function d3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(5),f("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),f("ngModel",e.pageData.Filter.PriceRange)}}function u3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function _3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),ei(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function g3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,_3,11,12,"tr",null,j),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Hn(fl.default);var $a=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Highcharts=Oi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,d3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,u3,3,0,"button",2),a(),S(6,g3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,k,Ue,U,Za,ne,te],encapsulation:2})};var C3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],xl=i=>({ID:i});function f3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function x3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function h3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function S3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function y3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function D3(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function v3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function w3(i,s){if(i&1&&(b(0,"td",39),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,Si(1,1,t.data.Compenents,r,e)),Ee)}}function T3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",35),p(5),a()(),n(6,"td")(7,"a",36),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,D3,3,3,"td",37),S(15,v3,3,3,"td",38),G(16,w3,3,7,"td",39,j),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,C3))("queryParams",X(14,xl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,xl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function P3(i,s){if(i&1&&(n(0,"td",26)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function F3(i,s){if(i&1&&(n(0,"td",26)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function I3(i,s){if(i&1&&(n(0,"td",27),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function b3(i,s){if(i&1){let e=I();n(0,"span",40),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",41),p(2,"?"),a()()}}function E3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function M3(i,s){if(i&1){let e=I();n(0,"a",42),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",43),p(2," Next"),a()}}function V3(i,s){if(i&1){let e=I();n(0,"a",44),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",45),p(2," Show All"),a()}}function B3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,h3,2,0,"th",21),S(17,S3,2,0,"th",22),G(18,y3,1,1,"th",23,j),a()(),n(20,"tbody"),G(21,T3,18,18,"tr",null,j),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),S(26,P3,5,6,"td",26),S(27,F3,5,6,"td",26),G(28,I3,3,3,"td",27,j),a()()()(),n(30,"div",28)(31,"div",29)(32,"div",30),p(33),d(34,"number"),S(35,b3,3,0,"span",31),S(36,E3,3,3,"span"),p(37),a()(),n(38,"div",32),S(39,M3,3,0,"a",33),S(40,V3,3,0,"a",34),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(5),y(e.roleService.product.Cost?26:-1),o(),y(e.roleService.product.Cost?27:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(34,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:35),o(),y(e.pageData.HideStoreApiCount?36:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(e.nextPageDisabled&&!e.goToLast?39:-1),o(),y(e.nextPageDisabled&&!e.goToLast?40:-1)}}var eo=class i extends Pi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(qe),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,f3,3,0,"button",2),a(),n(3,"filters"),E(4,x3,17,10,"ng-template",null,0,O),a(),S(6,B3,41,12,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,U,se,Ii,ne,re,Z],encapsulation:2})};var O3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],L3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function R3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function k3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var to=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(We))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,R3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,k3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(7,O3)),o(3),c("routerLink",M(8,L3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,k,ri,U],encapsulation:2})};var W3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],Wi=i=>[i],hl=(i,s)=>({"text-danger":i,"text-success":s});function N3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function A3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function G3(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function H3(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function Q3(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function Y3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function j3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function q3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",ue(4,hl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function U3(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,Y3,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,j3,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,q3,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",ue(16,hl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function z3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,Wi,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function K3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,Wi,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function X3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,Wi,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function J3(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,G3,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,H3,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,Q3,2,0,"th",23),a()(),n(34,"tbody"),G(35,U3,15,19,"tr",null,j),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,z3,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,K3,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,X3,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,Wi,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,Wi,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,Wi,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var io=class i extends me{constructor(e,r,t,l,C,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=C;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],C);case"string":return this.compare(t[e.active],l[e.active],C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(Y),w(N),w(R),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,N3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,A3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,J3,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,W3)),o(6),y(t.data?9:-1))},dependencies:[A,Ze,Q,$,L,k,ae,pe,Ce,Ht,fe,U,re,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Zi=Zt(Ei());var Z3={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Ni=class i{yearCtrl=new tr(null);year=_n(null);minDate=(0,Zi.default)().subtract(100,"years");maxDate=(0,Zi.default)();constructor(){un(()=>{this.year()&&this.yearCtrl.setValue((0,Zi.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Zi.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[hi([{provide:vn,useClass:An,deps:[Dn]},{provide:wn,useValue:Z3}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let C=Dt(4);return _(C.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))}),a()()}if(e&2){let t=Dt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[Mn,Pn,Tn,Ti,Vn,wi,Fn,In,bn,Gt,Qe,L,fn,nr],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
7
- `],encapsulation:2,changeDetection:0})};var ew=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function tw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options.Currencies),o(4),f("year",e.pageData.Filter.FromYear),o(2),f("year",e.pageData.Filter.ToYear)}}function iw(i,s){if(i&1&&(n(0,"div",4),b(1,"POS-line-chart",11),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var no=class i extends me{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,C="",T=Math.abs(t[this.x]?t[this.x]:0);return T>999&&T<1e10?(C="K",l=(T/1e3).toFixed(0)):T>=1e10?(C="M",l=(T/1e6).toFixed(0)):T<999&&(l=T.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+C}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(T=>this.series?.name?.includes("Cost")?T?.name?.includes("Cost"):T?.name?.includes("Cost")==!1);let t=[],l="",C=this.point.index;return r.forEach(T=>{T.options.stack===this.point.series.options.stack&&(t=T.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
8
- ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(T.points[C]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(C=>C.Name=="Sales").map(C=>C.Amount),t=this.data.Series.filter(C=>C.Name=="Profit").map(C=>C.Amount),l=this.data.Series.filter(C=>C.Name=="Cost").map(C=>C.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y))};static \u0275cmp=B({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[W],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),E(6,tw,16,10,"ng-template",null,0,O),a(),n(8,"content"),S(9,iw,2,2,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,ew)),o(7),y(t.data?9:-1))},dependencies:[A,Q,$,L,k,ae,Mt,fe,U,Ni],encapsulation:2})};var nw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],aw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],ow=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],rw=i=>({id:i}),lw=i=>[i],Sl=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],pw=(i,s,e)=>({CategoryID:i,From:s,To:e}),yl=i=>({CategoryID:i}),mw=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function sw(i,s){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",10),p(2," Export "),a()}}function cw(i,s){if(i&1&&(n(0,"span",24),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function dw(i,s){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,cw,2,3,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Hide Zero & Negative"),a(),n(31,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",X(21,lw,X(19,rw,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.TagID),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function uw(i,s){i&1&&(n(0,"th",47),p(1," DISCOUNT "),a())}function _w(i,s){i&1&&(n(0,"th",48),p(1," DISCOUNT (%) "),a(),n(2,"th",49),p(3," DISCOUNT (AMOUNT) "),a())}function gw(i,s){i&1&&(n(0,"th",50),p(1," COST "),a())}function Cw(i,s){i&1&&(n(0,"th",51),p(1," PROFIT "),a())}function fw(i,s){i&1&&(n(0,"th",52),p(1," % "),a())}function xw(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function hw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function Sw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Percentage),"% ")}}function yw(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",53),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),n(9,"td",41)(10,"a",53),p(11),d(12,"amountFraction"),a()(),n(13,"td",41)(14,"a",53),p(15),d(16,"amountFraction"),a()(),n(17,"td",41),p(18),d(19,"amountFraction"),a(),n(20,"td",43),p(21),d(22,"amountFraction"),a(),n(23,"td",41),p(24),d(25,"amountFraction"),a(),E(26,xw,3,3,"td",44)(27,hw,3,4,"td",45)(28,Sw,3,4,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(34,Sl))("queryParams",_t(35,pw,e.ID,v(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),v(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(e.Name),o(2),F(g(8,22,e.Quantity)),o(3),c("routerLink",M(39,Sl))("queryParams",X(40,yl,e.ID)),o(),D(" ",g(12,24,e.GrossSales)," "),o(3),c("routerLink",M(42,mw))("queryParams",X(43,yl,e.ID)),o(),F(g(16,26,e.Discount)),o(3),F(g(19,28,e.Sales)),o(3),D(" ",g(22,30,e.Tax)," "),o(3),F(g(25,32,e.SalesNTax)),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit)}}function Dw(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function vw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalProfit)," ")}}function ww(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function Tw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",25)(2,"div",26)(3,"table",27),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",28)(5,"tr")(6,"th",29),p(7,"CATEGORY"),a(),n(8,"th",30),p(9," QUANTITY "),a(),n(10,"th",31),p(11," GROSS SALES "),a(),E(12,uw,2,0,"th",32)(13,_w,4,0,"ng-template",null,1,O),n(15,"th",33),p(16," NET SALES "),a(),n(17,"th",34),p(18," Tax "),a(),n(19,"th",35),p(20," Sales + Tax "),a(),E(21,gw,2,0,"th",36)(22,Cw,2,0,"th",37)(23,fw,2,0,"th",38),a()(),n(24,"tbody"),E(25,yw,29,45,"tr",39),a(),n(26,"tfoot")(27,"tr",40)(28,"td",41),p(29,"Total :"),a(),n(30,"td",41),p(31),d(32,"quantityFraction"),a(),n(33,"td",42)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",41),p(38),d(39,"amountFraction"),a(),n(40,"td",41),p(41),d(42,"amountFraction"),a(),n(43,"td",43),p(44),d(45,"amountFraction"),a(),n(46,"td",41),p(47),d(48,"amountFraction"),a(),E(49,Dw,3,3,"td",44)(50,vw,3,4,"td",45)(51,ww,3,4,"td",45),a()()()(),n(52,"POS-complex-pagination",46),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=Dt(14),r=m();o(12),c("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(2),c("ngForOf",r.data.Data),o(6),D(" ",g(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),F(g(36,19,r.data.Aggregate.TotalGross)),o(3),D(" ",g(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),D(" ",g(45,25,r.data.Aggregate.TotalTax)," "),o(3),D(" ",g(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(),c("total",r.data.Count)("pageData",r.pageData)}}var ao=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Total":return this.compare(t.Total,l.Total,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"NetSales":return this.compare(t.NetSales,l.NetSales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Percentage":return this.compare(t.Percentage,l.Percentage,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,sw,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,dw,32,23,"ng-template",null,0,O),a(),E(19,Tw,53,29,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,nw)),o(3),c("routerLink",M(11,aw)),o(3),c("routerLink",M(12,ow)),o(5),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,L,k,ae,pe,Ce,Te,Ne,Et,fe,U,ze,Bn,ne,re,Z,te],encapsulation:2})};var vl=(i,s)=>({"text-danger":i,"text-success":s}),Pw=()=>["/menu/Products/Catalog/Variants/Info"],Dl=i=>({ID:i}),Fw=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function Iw(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function bw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",14)(25,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CompareDifference),c("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.Note),o(4),f("ngModel",e.pageData.Filter.DiscountFrom),o(),f("ngModel",e.pageData.Filter.DiscountTo)}}function Ew(i,s){i&1&&(n(0,"th",26),p(1,"Cost"),a())}function Mw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.UnitCost))}}function Vw(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",38),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",38),p(10),a(),b(11,"span",39),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",33),p(16),d(17,"quantityFraction"),a(),S(18,Mw,3,3,"td",34),n(19,"td",33),p(20),d(21,"amountFraction"),a(),n(22,"td",33),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",34),p(29),d(30,"amountFraction"),a(),n(31,"td",36),p(32),d(33,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(33,Pw))("queryParams",X(34,Dl,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),c("routerLink",M(36,Fw))("queryParams",X(37,Dl,e.InvoiceID)),o(),F(e.Number),o(),c("innerHTML",e.Note,Ee),o(2),F(v(14,18,e.Date,"dd MMM yyyy")),o(3),F(g(17,21,e.Quantity)),o(2),y(r.roleService.product.Cost?18:-1),o(2),F(g(21,23,e.UnitPriceOriginal)),o(3),F(g(24,25,e.UnitPrice)),o(2),c("ngClass",ue(39,vl,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),D(" ",g(27,27,e.Discount)),o(3),D(" ",g(30,29,e.DiscountPercentage),"% "),o(3),F(g(33,31,e.Sales))}}function Bw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.data.Aggregate.TotalUnitCost))}}function Ow(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",40),P("jumpToPage",function(){u(e);let t=m(2);return _(t.getListData())})("previousPage",function(){u(e);let t=m(2);return _(t.getListData())})("nextPage",function(){u(e);let t=m(2);return _(t.getListData())}),a()}if(i&2){let e=m(2);c("total",e.data.Data.length)("pageData",e.pageData)}}function Lw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"div",17)(3,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",19)(5,"tr")(6,"th",20),p(7,"Outlet"),a(),n(8,"th",21),p(9,"Variant"),a(),n(10,"th",22),p(11,"Code"),a(),n(12,"th",23),p(13,"Number / Note"),a(),n(14,"th",24),p(15,"Date"),a(),n(16,"th",25),p(17,"Quantity"),a(),S(18,Ew,2,0,"th",26),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),G(30,Vw,34,42,"tr",null,j),a(),n(32,"tfoot")(33,"tr"),b(34,"td",32),n(35,"td",33),p(36,"Total :"),a(),n(37,"td",33),p(38),d(39,"quantityFraction"),a(),S(40,Bw,3,3,"td",34),n(41,"td",33),p(42),d(43,"amountFraction"),a(),n(44,"td",33),p(45),d(46,"amountFraction"),a(),n(47,"td",35),p(48),d(49,"amountFraction"),a(),n(50,"td",34),p(51),d(52,"amountFraction"),a(),n(53,"td",36),p(54),d(55,"amountFraction"),a()()()()(),S(56,Ow,1,2,"POS-complex-pagination",37),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(12),H(e.data.Data),o(8),F(g(39,10,e.data.Aggregate.TotalQuantity)),o(2),y(e.roleService.product.Cost?40:-1),o(2),F(g(43,12,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),F(g(46,14,e.data.Aggregate.TotalUnitPrice)),o(2),c("ngClass",ue(22,vl,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),D(" ",g(49,16,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount)),o(3),D(" ",g(52,18,e.data.Aggregate.DiscountPercentage),"% "),o(3),F(g(55,20,e.data.Aggregate.TotalNetSales)),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?56:-1)}}var oo=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=C}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,C);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,C);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,C);case"Discount":return V.compare(t.Discount,l.Discount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,C);case"Note":return V.compare(t.Note,l.Note,C);default:return 0}})}openExportModal(){this.dialog.open(K,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["colspan","4"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-success"],["api","SalesReport/TotalDiscount",3,"total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Iw,3,0,"a",2),a(),n(3,"filters"),E(4,bw,27,16,"ng-template",null,0,O),a(),S(6,Lw,57,25,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Ze,Q,$,J,Qe,L,k,pe,Ce,Ue,Ne,Et,fe,U,re,Z,te],encapsulation:2})};var Rw=()=>["/menu/Reports/Sales_Report/Standard/Person"],kw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Ww=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Nw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Aw=(i,s)=>({From:i,To:s}),Tl=i=>({ID:i}),wl=i=>[i],Gw=(i,s)=>({SalesPersonID:i,ListIDs:s}),Hw=(i,s,e,r)=>({SalesPersonID:i,ListIDs:s,From:e,To:r});function Qw(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Yw(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),c("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function jw(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",36)(7,"a",38),p(8),d(9,"number"),a()(),n(10,"td",36),p(11),d(12,"quantityFraction"),a(),n(13,"td",36),p(14),d(15,"quantityFraction"),a(),n(16,"td",36),p(17),d(18,"quantityFraction"),a(),n(19,"td",36),p(20),d(21,"amountFraction"),a(),n(22,"td",36),p(23),d(24,"amountFraction"),a(),n(25,"td",36)(26,"a",38),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",36),p(32),d(33,"quantityFraction"),a(),n(34,"td",36),p(35),d(36,"quantityFraction"),a(),n(37,"td",36),p(38),d(39,"quantityFraction"),a(),n(40,"td",36),p(41),d(42,"amountFraction"),a(),n(43,"td",36),p(44),d(45,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);o(2),c("queryParams",X(47,Tl,e.PersonID)),o(),F(e.PersonName),o(2),F(e.PersonCode),o(2),c("queryParams",ue(51,Gw,e.PersonID,X(49,wl,r.EntityID))),o(),F(g(9,17,e.CountOrder)),o(3),F(g(12,19,e.Quantity)),o(3),F(g(15,21,e.BasketSize)),o(3),F(g(18,23,e.BasketValue)),o(3),F(g(21,25,e.Sales)),o(3),F(g(24,27,e.AverageDailySales)),o(3),c("queryParams",zt(56,Hw,e.PersonID,X(54,wl,r.EntityID),v(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),v(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),D(" ",g(30,35,e.CountOrder1)),o(3),F(g(33,37,e.Quantity1)),o(3),F(g(36,39,e.BasketSize1)),o(3),F(g(39,41,e.BasketValue1)),o(3),F(g(42,43,e.Sales1)),o(3),F(g(45,45,e.AverageDailySales1))}}function qw(i,s){if(i&1&&(n(0,"table",14)(1,"thead",22)(2,"tr",23)(3,"th",24)(4,"h2")(5,"a",25),p(6),a()()()(),n(7,"tr")(8,"th",26),p(9," Sales Person"),a(),n(10,"th",27)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",28)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",29)(27,"th",30),p(28," Ordr"),a(),n(29,"th",31),p(30,"Qty"),a(),n(31,"th",31),b(32,"i",32),a(),n(33,"th",33),p(34,"Basket Value"),a(),n(35,"th",33),p(36,"Sales"),a(),n(37,"th",33),p(38,"Avg Daily"),a(),n(39,"th",34),p(40,"Ordr"),a(),n(41,"th",31),p(42,"Qty"),a(),n(43,"th",31),b(44,"i",32),a(),n(45,"th",33),p(46,"Basket Value"),a(),n(47,"th",33),p(48,"Sales"),a(),n(49,"th",33),p(50,"Avg Daily"),a()()(),n(51,"tbody"),G(52,jw,46,61,"tr",null,j),a(),n(54,"tfoot")(55,"tr",35)(56,"td"),p(57,"Total"),a(),n(58,"td",36),p(59),d(60,"sum"),d(61,"number"),a(),n(62,"td",36),p(63),d(64,"sum"),d(65,"quantityFraction"),a(),n(66,"td",36),p(67),d(68,"sum"),d(69,"quantityFraction"),a(),n(70,"td",36),p(71),d(72,"sum"),d(73,"quantityFraction"),a(),n(74,"td",36),p(75),d(76,"sum"),d(77,"amountFraction"),a(),n(78,"td",36),p(79),d(80,"sum"),d(81,"amountFraction"),a(),n(82,"td",36),p(83),d(84,"sum"),d(85,"number"),a(),n(86,"td",36),p(87),d(88,"sum"),d(89,"quantityFraction"),a(),n(90,"td",36),p(91),d(92,"sum"),d(93,"quantityFraction"),a(),n(94,"td",36),p(95),d(96,"sum"),d(97,"quantityFraction"),a(),n(98,"td",36),p(99),d(100,"sum"),d(101,"amountFraction"),a(),n(102,"td",36),p(103),d(104,"sum"),d(105,"amountFraction"),a()()()()),i&2){let e=s.$implicit,r=m(2);o(5),c("queryParams",X(90,Tl,e.EntityID)),o(),F(e.EntityName),o(6),F(v(13,18,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),F(v(17,21,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),F(v(21,24,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),F(v(25,27,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),H(e.SalesCommison),o(7),F(g(61,33,v(60,30,e.SalesCommison,"CountOrder"))),o(4),F(g(65,38,v(64,35,e.SalesCommison,"Quantity"))),o(4),F(g(69,43,v(68,40,e.SalesCommison,"BasketSize"))),o(4),F(g(73,48,v(72,45,e.SalesCommison,"BasketValue"))),o(4),F(g(77,53,v(76,50,e.SalesCommison,"Sales"))),o(4),F(g(81,58,v(80,55,e.SalesCommison,"AverageDailySales"))),o(4),F(g(85,63,v(84,60,e.SalesCommison,"CountOrder1"))),o(4),F(g(89,68,v(88,65,e.SalesCommison,"Quantity1"))),o(4),F(g(93,73,v(92,70,e.SalesCommison,"BasketSize1"))),o(4),F(g(97,78,v(96,75,e.SalesCommison,"BasketValue1"))),o(4),F(g(101,83,v(100,80,e.SalesCommison,"Sales1"))),o(4),F(g(105,88,v(104,85,e.SalesCommison,"AverageDailySales1")))}}function Uw(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,Qw,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,Yw,13,9,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12)(30,"div",13),G(31,qw,106,92,"table",14,j),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(16,Rw)),o(3),c("routerLink",M(17,kw)),o(3),c("routerLink",M(18,Ww)),o(3),c("routerLink",M(19,Nw))("queryParams",ue(20,Aw,v(22,10,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,13,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),H(e.data==null?null:e.data.Data)}}var ro=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&S(0,Uw,33,23,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,L,k,ae,Ht,U,ze,se,ne,re,Z,te],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var lo=class i{onPanelShow(){setTimeout(()=>{let s=document.querySelector(".p-multiselect-filter-container input.p-multiselect-filter");s&&(s.focus(),s.select?.())},0)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=mn({type:i,selectors:[["","autoFocusMultiselect",""]],hostBindings:function(e,r){e&1&&P("onPanelShow",function(){return r.onPanelShow()})}})};var Kw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Xw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Jw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Zw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],$w=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],eT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Pl=i=>({ID:i});function tT(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",35),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=m(2);o(2),f("model",e.pageData.Filter.ReleasedType),c("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function iT(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),S(10,tT,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",22)(14,"datepicker",23),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",24),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",25)(17,"div",26),p(18,"Number Of Interval"),a(),n(19,"div",26),p(20,"Interval Of"),a()(),n(21,"div",27)(22,"input",28),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",29)(24,"input",30),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",31),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",32),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",34),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("ngModel",e.pageData.Filter.ListTagID),c("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),y((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),f("date",e.pageData.Filter.ReleasedFrom),o(),f("date",e.pageData.Filter.ReleasedTo),o(7),f("ngModel",e.pageData.Filter.IntervalCount),o(2),f("ngModel",e.pageData.Filter.IntervalDays),o(5),c("max",1e3),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.PurchaseType),c("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.scopeFilter),o(3),f("model",e.pageData.Filter.HideZero),c("options",e.hideZeroOptions)}}function nT(i,s){if(i&1){let e=I();n(0,"button",36),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",37),p(2," Export "),a()}}function aT(i,s){if(i&1&&(n(0,"th",38),p(1),a(),n(2,"th",39),p(3," % "),a()),i&2){let e=s.$index,r=m();c("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),D(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),c("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function oT(i,s){if(i&1&&(n(0,"th",40),d(1,"date"),d(2,"date"),p(3," TOT "),a(),n(4,"th",41),d(5,"date"),d(6,"date"),p(7," % "),a()),i&2){let e=m();c("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
5
+ ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(Ze.points[T].y)}</br>
6
+ `)}),C}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,iu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,nu,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),c("routerLink",M(6,tu)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,R,ne,Te,Mt,pi,Ce,U],encapsulation:2})};var au=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ou=(i,s)=>({"text-success":i,"text-danger":s}),el=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function ru(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function lu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(5),f("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),f("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function pu(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function mu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function su(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function cu(i,s){if(i&1&&(S(0,mu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,su,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function du(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function uu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function _u(i,s){if(i&1&&(S(0,du,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,uu,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function gu(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,_u,10,20,null,null,Y),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",fe(29,el,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",fe(32,el,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function Cu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function fu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function xu(i,s){if(i&1&&(S(0,Cu,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,fu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function hu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,pu,4,8,"th",21,Y),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,cu,8,14,null,null,Y),a()(),n(15,"tbody"),G(16,gu,18,35,"tr",23,Y),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,xu,11,23,null,null,Y),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",fe(4,ou,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var sa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ru,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,lu,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,hu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,au)),o(7),y(t.data?10:-1))},dependencies:[A,tt,Q,$,L,R,ne,Ce,U,ze,se,Ln,fr,re,Z],encapsulation:2})};var Su=()=>["/menu/Reports/Sales_Report/Standard/Daily"],yo=(i,s)=>({From:i,To:s}),yu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Du=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],tl=i=>({"is-weekend":i});function vu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wu(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Tu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function Pu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Fu(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Iu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function bu(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function Eu(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function Mu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Vu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Bu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Ou(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Lu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,Eu,3,3,"td",37),S(20,Mu,3,3,"td",33),S(21,Vu,3,3,"td",34),S(22,Bu,3,4,"td",36),S(23,Ou,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,tl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,tl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Ru(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function ku(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function Wu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function Nu(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Au(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function Gu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,Tu,2,0,"th",26),S(17,Pu,2,0,"th",27),S(18,Fu,2,0,"th",28),S(19,Iu,2,0,"th",29),S(20,bu,2,0,"th",30),a()(),n(21,"tbody"),G(22,Lu,24,31,"tr",31,Y),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Ru,4,6,"td",33),S(45,ku,4,6,"td",33),S(46,Wu,4,6,"td",34),S(47,Nu,5,10,"td",35),S(48,Au,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ca=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,wu,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,Gu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Su))("queryParams",fe(13,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,yu))("queryParams",fe(17,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,Du))("queryParams",fe(21,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,L,R,pe,ge,Gt,Ce,U,ze,se,re,oe,Z,ie],encapsulation:2})};var Hu=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Qu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Yu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function ju(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function qu(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function Uu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zu(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Ku(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,Uu,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,zu,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Xu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Ju(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function Zu(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,ju,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,qu,2,0,"th",20),a()(),n(20,"tbody"),E(21,Ku,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,Xu,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,Ju,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var da=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Qu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Yu,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,Zu,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Hu)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,R,ne,Te,Ce,U,ze,se,Ln,re,Z,ie],encapsulation:2})};var $u=()=>["/menu/Reports/Sales_Report/Standard/Daily"],il=(i,s)=>({From:i,To:s}),e_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],t_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function i_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function n_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ua=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(C=>`${C.getDate()} ${V.Months[C.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,i_,13,12,"ng-template",null,0,O),a(),S(18,n_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(10,$u))("queryParams",fe(11,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,e_))("queryParams",fe(15,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,t_)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var a_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],o_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],r_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function l_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function p_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var _a=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(C=>parseInt(C)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,l_,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,p_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,a_)),o(3),c("routerLink",M(9,o_)),o(3),c("routerLink",M(10,r_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,Mt,Ce,U],encapsulation:2})};var m_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],s_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],c_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function d_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function u_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var ga=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,d_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,u_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,m_)),o(3),c("routerLink",M(9,s_)),o(3),c("routerLink",M(10,c_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,R,ii,Ce],encapsulation:2})};var Do=Jt(bi());var __=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],g_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],C_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],f_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nl=(i,s,e)=>({ListIDs:i,From:s,To:e}),Li=(i,s)=>({"text-danger":i,"text-success":s}),x_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],al=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ol=(i,s)=>({"text-success":i,"text-danger":s});function h_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function S_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),f("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption)}}function y_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function D_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function v_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function w_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function T_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function P_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function F_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function I_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function b_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function E_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function M_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function V_(i,s){if(i&1&&(pt(0),E(1,M_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function B_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function O_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function L_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function R_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function k_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function W_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function N_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function A_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",fe(2,f_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,nl,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function Q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Y_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function j_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function U_(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function z_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function K_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function X_(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function J_(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Z_(i,s){if(i&1&&(n(0,"td",70),E(1,X_,4,7,"ng-container",78)(2,J_,3,7,"ng-template",null,1,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function $_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function eg(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function tg(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,x_))("queryParams",_t(12,nl,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function ig(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function ng(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function ag(i,s){if(i&1&&(n(0,"td",79),E(1,ig,3,4,"ng-container",78)(2,ng,1,1,"ng-template",null,2,O),a()),i&2){let e=Dt(3),r=m().$implicit;c("ngClass",fe(3,al,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function og(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function rg(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function lg(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function pg(i,s){if(i&1&&(n(0,"td",70),E(1,rg,4,7,"ng-container",78)(2,lg,3,7,"ng-template",null,3,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function mg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function sg(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,A_,2,1,"td",73)(6,G_,2,5,"td",74)(7,H_,4,9,"td",43)(8,Q_,3,3,"td",43)(9,Y_,3,3,"td",43)(10,j_,3,4,"td",43)(11,q_,3,3,"td",43)(12,U_,4,3,"td",43)(13,z_,4,3,"td",43)(14,K_,3,3,"td",43),pt(15),E(16,Z_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,$_,4,3,"td",43)(20,eg,3,3,"td",51)(21,tg,7,16,"td",43)(22,ag,4,6,"td",53)(23,og,3,3,"td",54)(24,pg,4,2,"td",43)(25,mg,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function cg(i,s){i&1&&b(0,"td",50)}function dg(i,s){i&1&&b(0,"td",50)}function ug(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function _g(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function gg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function Cg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function fg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function xg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function hg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function Sg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function yg(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",fe(13,Li,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function Dg(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,Li,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function vg(i,s){if(i&1&&(n(0,"td",70),E(1,yg,7,16,"ng-container",78)(2,Dg,6,16,"ng-template",null,4,O),a()),i&2){let e=Dt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function wg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function Tg(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Pg(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function Fg(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,al,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function Ig(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function bg(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function Eg(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function Mg(i,s){if(i&1&&(n(0,"td",70),E(1,bg,6,16,"span",53)(2,Eg,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function Vg(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function Bg(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,y_,2,0,"th",30)(9,D_,2,0,"th",31)(10,v_,2,0,"th",32)(11,w_,2,0,"th",33)(12,T_,2,0,"th",34)(13,P_,2,0,"th",35)(14,F_,2,0,"th",36)(15,I_,2,0,"th",37)(16,b_,2,0,"th",38)(17,E_,3,0,"ng-container",39)(18,V_,4,7,"ng-container",39)(19,B_,2,0,"th",40)(20,O_,2,0,"th",41)(21,L_,2,1,"th",42)(22,R_,2,0,"th",43)(23,k_,2,0,"th",44)(24,W_,2,1,"th",42)(25,N_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,sg,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,cg,1,0,"td",49)(33,dg,1,0,"td",49),b(34,"td",50),E(35,ug,5,7,"td",43)(36,_g,4,6,"td",43)(37,gg,4,6,"td",43)(38,Cg,4,7,"td",43)(39,fg,4,6,"td",43)(40,xg,4,6,"td",43)(41,hg,4,6,"td",43)(42,Sg,4,6,"td",43),pt(43),E(44,vg,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,wg,4,6,"td",43)(48,Tg,4,6,"td",51)(49,Pg,5,6,"td",52)(50,Fg,3,8,"td",53)(51,Ig,4,6,"td",54)(52,Mg,3,2,"td",43)(53,Vg,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var Ca=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,h_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,S_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,Bg,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,__)),o(3),c("routerLink",M(11,g_)),o(3),c("routerLink",M(12,C_)),o(6),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ne,pe,ge,Te,Ce,Vi,se,ei,re,oe,Z,ie],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var Og=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],Lg=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],Rg=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],kg=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),rl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function Wg(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Ng(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.isCompare)}}function Ag(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function Gg(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function Hg(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function Qg(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function Yg(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function jg(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function qg(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,kg,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Ug(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,rl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function zg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kg(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function Xg(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,jg,2,1,"td",31),S(4,qg,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,Ug,3,7,"td",34),S(24,zg,3,3,"td",35),S(25,Kg,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function Jg(i,s){i&1&&b(0,"td",30)}function Zg(i,s){i&1&&b(0,"td",30)}function $g(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,rl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function e1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function t1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function i1(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,Ag,2,0,"th",19),S(7,Gg,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,Hg,2,0,"th",27),S(21,Qg,2,0,"th",28),S(22,Yg,2,1,"th",25),a()(),n(23,"tbody"),G(24,Xg,26,25,"tr",null,Y),a(),n(26,"tfoot")(27,"tr",29),S(28,Jg,1,0,"td",30),S(29,Zg,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,$g,3,8,"td",34),S(57,e1,4,6,"td",35),S(58,t1,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var fa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Wg,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,Ng,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,i1,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,Og)),o(3),c("routerLink",M(10,Lg)),o(3),c("routerLink",M(11,Rg)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,J,L,R,ne,pe,ge,Te,se,re,Z,ie],encapsulation:2})};var n1=()=>["/menu/Reports/Sales_Report/Standard/Compare"],a1=i=>({"flex-right":i});function o1(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function r1(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function l1(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,a1,e!="Outlet")),o(),D(" ",e)}}function p1(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function m1(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function s1(i,s){if(i&1&&(n(0,"td"),S(1,p1,2,1,"div",14),S(2,m1,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function c1(i,s){if(i&1&&(n(0,"tr"),G(1,s1,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function d1(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function u1(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,d1,3,3,"td",17,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function _1(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,l1,2,7,"th",13,Y),a()(),n(6,"tbody"),G(7,c1,3,0,"tr",null,Y),a(),S(9,u1,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var xa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],C)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,o1,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,r1,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,_1,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,n1)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ne,pe,ge,ze,Z],encapsulation:2})};var g1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],C1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],f1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],x1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],h1=(i,s)=>({From:i,To:s}),S1=()=>["/menu/Contacts/Contact/Sales_Person/Info"],y1=i=>({ID:i}),D1=()=>["/menu/Reports/Sales_Report/Standard/Detail"],v1=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),w1=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),T1=i=>({SalesID:i});function P1(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function F1(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),f("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),f("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function I1(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function b1(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function E1(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function M1(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function V1(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function B1(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function O1(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function L1(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function R1(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function k1(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function W1(i,s){if(i&1&&(pt(0),E(1,R1,2,0,"th",53)(2,k1,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function N1(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function A1(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function G1(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function H1(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Q1(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,D1))("queryParams",cn(13,v1,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Y1(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function j1(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function q1(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function U1(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(10,w1,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function z1(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function K1(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function X1(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function J1(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function Z1(i,s){if(i&1&&(pt(0),E(1,X1,3,3,"td",44)(2,J1,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function $1(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function eC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function tC(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,T1,e.ID)),o(),F(g(4,2,e.Commission))}}function iC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,H1,2,1,"td",9)(5,Q1,6,19,"td",40)(6,Y1,3,3,"td",41),d(7,"HideSumZero"),E(8,j1,4,3,"ng-container",9)(9,q1,3,3,"td",42),d(10,"HideSumZero"),E(11,U1,6,15,"td",40)(12,z1,3,3,"td",43)(13,K1,3,3,"td",44)(14,Z1,3,2,"ng-container",9)(15,$1,3,4,"td",41)(16,eC,3,4,"td",41)(17,tC,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,S1))("queryParams",X(22,y1,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function nC(i,s){i&1&&b(0,"td")}function aC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function oC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function rC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function lC(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function pC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function mC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function sC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function cC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function dC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function uC(i,s){if(i&1&&(pt(0),E(1,cC,4,6,"td",44)(2,dC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function _C(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function gC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function CC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function fC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,I1,2,0,"th",27)(9,b1,2,0,"th",28)(10,E1,2,0,"th",29),d(11,"HideSumZero"),E(12,M1,3,0,"ng-container",9)(13,V1,2,0,"th",30),d(14,"HideSumZero"),E(15,B1,2,0,"th",31)(16,O1,2,0,"th",32)(17,L1,2,0,"th",33)(18,W1,3,2,"ng-container",9)(19,N1,2,0,"th",34)(20,A1,2,0,"th",35)(21,G1,2,0,"th",36),a()(),n(22,"tbody"),E(23,iC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,nC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,aC,4,7,"td",40)(30,oC,4,6,"td",41),d(31,"HideSumZero"),E(32,rC,5,6,"ng-container",9)(33,lC,4,7,"td",42),d(34,"HideSumZero"),E(35,pC,4,6,"td",40)(36,mC,4,6,"td",43)(37,sC,4,6,"td",44)(38,uC,3,2,"ng-container",9)(39,_C,4,7,"td",41)(40,gC,4,7,"td",41)(41,CC,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ha=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=C}isShowCommission=!1;roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"Target":return this.compare(t.Target,l.Target,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,C);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,C);case"Commission":return this.compare(t.Commission,l.Commission,C);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(oi(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(et({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(rr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,P1,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,F1,22,13,"ng-template",null,0,O),a(),E(25,fC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,g1)),o(3),c("routerLink",M(19,C1)),o(3),c("routerLink",M(20,f1)),o(3),c("routerLink",M(21,x1))("queryParams",fe(22,h1,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ne,pe,ge,Te,U,se,ei,re,oe,Z],encapsulation:2})};var xC=()=>["/menu/Reports/Sales_Report/Standard/Person"],hC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],SC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],yC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],DC=(i,s)=>({From:i,To:s}),ll=i=>({ID:i}),pl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function vC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function wC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),h("timeChange",function(t){u(e);let l=m(3);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),c("width",100),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function TC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),f("date",e.pageData.Filter.From),c("width",100),o(2),f("date",e.pageData.Filter.To),c("width",100)}}function PC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,wC,10,6)(10,TC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),f("model",e.pageData.Filter.isCreated)}}function FC(i,s){i&1&&b(0,"app-empty-state")}function IC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function bC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function EC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,IC,2,0,"th",36),S(14,bC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ll,e.ID)),o(),$t("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function MC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);ji("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",Ut(14,pl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function VC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",Ut(10,pl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function BC(i,s){if(i&1&&(n(0,"td",38),S(1,MC,6,19,"div",39),S(2,VC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function OC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function LC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,BC,3,2,"td",38),S(13,OC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ll,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function RC(i,s){if(i&1&&(n(0,"tbody"),G(1,LC,14,13,"tr",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function kC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;ji("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function WC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function NC(i,s){if(i&1&&(n(0,"td",38),S(1,kC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,WC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function AC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function GC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,NC,6,11,"td",38),S(13,AC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function HC(i,s){if(i&1&&(n(0,"table",14),S(1,EC,15,7,"thead",31),S(2,RC,3,0,"tbody"),S(3,GC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function QC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,vC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,PC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,FC,1,0,"app-empty-state"),n(31,"div",13),G(32,HC,4,3,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,xC)),o(3),c("routerLink",M(18,hC)),o(3),c("routerLink",M(19,SC)),o(3),c("routerLink",M(20,yC))("queryParams",fe(21,DC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Sa=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,QC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,R,ne,Te,Mi,U,ze,kr,se,oe,Z,ie],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var YC=()=>["/menu/Reports/Sales_Report/Standard/Person"],jC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],qC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],UC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],zC=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vo=i=>({ID:i}),KC=()=>["/menu/Products/Catalog/Variants/Info"],XC=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function JC(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ZC(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),f("ngModel",e.pageData.Filter.SalesID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function $C(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function ef(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function tf(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function nf(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function af(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function of(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function rf(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function lf(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function pf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function mf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function sf(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function cf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,zC))("queryParams",X(4,vo,e.ID)),o(),F(e.Number)}}function df(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,KC))("queryParams",X(4,vo,e.VariantID)),o(),F(e.VariantName)}}function uf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,XC))("queryParams",X(4,vo,e.SalesID)),o(),F(e.SalesName)}}function _f(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function gf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function Cf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function ff(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function xf(i,s){if(i&1&&(n(0,"tr"),E(1,mf,3,4,"td",21)(2,sf,2,1,"td",21)(3,cf,3,6,"td",21)(4,df,3,6,"td",21)(5,uf,3,6,"td",21)(6,_f,3,3,"td",27)(7,gf,3,4,"td",27)(8,Cf,3,4,"td",27)(9,ff,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function hf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Sf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function yf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function Df(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function vf(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function wf(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function Tf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,$C,2,0,"th",20)(5,ef,2,0,"th",20)(6,tf,2,0,"th",20)(7,nf,2,0,"th",21)(8,af,2,0,"th",21)(9,of,2,0,"th",22)(10,rf,2,0,"th",22)(11,lf,2,0,"th",22)(12,pf,2,0,"th",22),a()(),n(13,"tbody"),E(14,xf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,hf,4,7,"td",27)(24,Sf,4,7,"td",27)(25,yf,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,Df,3,0,"span",32)(32,vf,3,3,"span",21),p(33),a()(),E(34,wf,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,C);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T}roleService=Pe(j);columnService=Pe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,JC,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,ZC,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,Tf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,YC)),o(3),c("routerLink",M(12,jC)),o(3),c("routerLink",M(13,qC)),o(3),c("routerLink",M(14,UC)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,R,ne,U,ze,se,re,oe,ie],encapsulation:2})};var ml=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],sl=i=>({ID:i});function Pf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Ff(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),f("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("model",e.pageData.Filter.NoteVisible),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function If(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function bf(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function Ef(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function Mf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Vf(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,ml))("queryParams",X(4,sl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Bf(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Of(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Lf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Of,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Rf(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function kf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Bf,3,3,"th",50),S(17,Lf,4,4,"th",51),S(18,Rf,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function Wf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function Nf(i,s){if(i&1&&(n(0,"table",41),G(1,Wf,8,5,"tr",null,Y),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Af(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,Nf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function Gf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,Mf,2,0,"span"),S(7,Vf,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,kf,19,13,"tr",null,Y),a(),S(26,Af,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,ml))("queryParams",X(22,sl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Hf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Qf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Yf(i,s){if(i&1&&(n(0,"div",30),S(1,Hf,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Qf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function jf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,If,2,1,"th",26),S(18,bf,2,0,"th",27),S(19,Ef,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,Gf,27,24,"div",null,Y),a()()()(),S(25,Yf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),li("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var Da=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=C;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Pf,3,0,"button",2),a(),n(3,"filters"),E(4,Ff,32,20,"ng-template",null,0,O),a(),S(6,jf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,Te,Ne,Ce,U,se,oe,Z,ie],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],wo=i=>({ID:i}),qf=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Uf(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function zf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Kf(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function Xf(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function Jf(i,s){i&1&&(n(0,"th",15),p(1," Total Amount "),a())}function Zf(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function $f(i,s){i&1&&b(0,"br")}function ex(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,wo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function tx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function ix(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function nx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function ax(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function ox(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,$f,1,0,"br"),S(7,ex,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,tx,3,3,"td",21),S(18,ix,3,3,"td",22),S(19,nx,3,3,"td",21),S(20,ax,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,cl))("queryParams",X(26,wo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,qf))("queryParams",X(29,wo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),ji("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function rx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function lx(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function px(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function mx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function sx(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function cx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function ux(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function _x(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Uf,3,0,"button",3),a(),n(3,"filters"),E(4,zf,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,Kf,2,0,"th",13),S(23,Xf,2,0,"th",14),S(24,Jf,2,0,"th",15),S(25,Zf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,ox,23,31,"tr",null,Y),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total:"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,rx,4,6,"td",21),S(41,lx,4,6,"td",22),S(42,px,4,6,"td",21),S(43,mx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,sx,3,0,"span",27)(51,cx,3,3,"span",28),p(52),a()(),E(53,dx,3,0,"a",29)(54,ux,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),f("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=C;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),C);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,C);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,C);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){r&1&&S(0,_x,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,R,ne,pe,ge,Ue,Te,Ne,U,se,re,oe,Z,ie],encapsulation:2})};var gx=()=>["/menu/Contacts/Contact/Suppliers/Info"],Cx=i=>({ID:i}),fx=(i,s,e)=>({SupplierID:i,From:s,To:e}),xx=()=>["/menu/Reports/Purchases_Report/Summary"];function hx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Sx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function yx(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function Dx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,fx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,xx)),o(3),F(g(5,9,e.Total))}}function vx(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,Dx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,gx))("queryParams",X(10,Cx,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function wx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function Tx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function Px(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,yx,2,0,"th",20),a()(),n(15,"tbody"),G(16,vx,12,12,"tr",21,Y),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,wx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,Tx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var wa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,hx,3,0,"button",2),a(),n(3,"filters"),E(4,Sx,17,11,"ng-template",null,0,O),a(),S(6,Px,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,Et,U,oe,Z,ie],encapsulation:2})};var Fx=i=>[i],Ix=i=>({ID:i}),bx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function Ex(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Mx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Vx(i,s){i&1&&(n(0,"th",22),p(1," Amount "),a())}function Bx(i,s){i&1&&(n(0,"th",23),p(1," Avg Cost "),a())}function Ox(i,s){if(i&1&&(n(0,"td",26)(1,"a",29),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(4,bx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),F(g(3,2,e.Total))}}function Lx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.AvgPrice)," ")}}function Rx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",28),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",26),p(9),d(10,"number"),a(),n(11,"td",26),p(12),d(13,"quantityFraction"),a(),S(14,Ox,4,9,"td",26),S(15,Lx,3,3,"td",26),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(13,Fx,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(15,Ix,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(10,9,e.Order)),o(3),F(g(13,11,e.Quantity)),o(2),y(t.roleService.product.Cost?14:-1),o(),y(t.roleService.product.Cost?15:-1)}}function kx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Total"))," ")}}function Wx(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"AvgPrice"))," ")}}function Nx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Name"),a(),n(10,"th",19),p(11,"Code"),a(),n(12,"th",20),p(13," Orders "),a(),n(14,"th",21),p(15," Quantity "),a(),S(16,Vx,2,0,"th",22),S(17,Bx,2,0,"th",23),a()(),n(18,"tbody"),G(19,Rx,16,17,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",24),b(23,"td")(24,"td",25),n(25,"td"),p(26,"Total :"),a(),n(27,"td",26),p(28),d(29,"sum"),d(30,"number"),a(),n(31,"td",26),p(32),d(33,"sum"),d(34,"quantityFraction"),a(),S(35,kx,4,6,"td",26),S(36,Wx,4,6,"td",26),a()()()(),n(37,"infinite-pagination",27),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(2),H(e.infiniteList),o(9),D(" ",g(30,15,v(29,12,e.infiniteList,"Order"))," "),o(4),D(" ",g(34,20,v(33,17,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?35:-1),o(),y(e.roleService.product.Cost?36:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=xi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=xi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","AvgPrice","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ex,3,0,"button",2),a(),n(3,"filters"),E(4,Mx,23,15,"ng-template",null,0,O),a(),S(6,Nx,38,22,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Te,Ce,U,ti,se,re,Z,ie],encapsulation:2})};var Ax=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Pa=i=>({ID:i}),Gx=()=>["/menu/Products/Catalog/Variants/Info"],Hx=()=>["/menu/Contacts/Contact/Suppliers/Info"],Qx=()=>["/menu/Products/Catalog/Products/Info"];function Yx(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function jx(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function qx(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function Ux(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,jx,4,2,"div",3)(12,qx,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),f("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function zx(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function Kx(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function Xx(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function Jx(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function Zx(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function $x(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function eh(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function th(i,s){i&1&&(n(0,"th",41),p(1," Measurement "),a())}function ih(i,s){i&1&&(n(0,"th",42),p(1," Cost "),a())}function nh(i,s){i&1&&(n(0,"th",43),p(1," Total Cost "),a())}function ah(i,s){i&1&&(n(0,"th",40),p(1," Item(%) "),a())}function oh(i,s){i&1&&(n(0,"th",44),p(1," Item Disc "),a())}function rh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function lh(i,s){i&1&&(n(0,"th",44),p(1," Bill Disc "),a())}function ph(i,s){if(i&1&&(n(0,"th",45),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.CurrencySymbol,") ")}}function mh(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function sh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function ch(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function dh(i,s){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,Hx))("queryParams",X(4,Pa,e.SupplierID)),o(),F(e.SupplierName)}}function uh(i,s){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,Qx))("queryParams",X(4,Pa,e.ProductID)),o(),F(e.Name)}}function _h(i,s){if(i&1&&b(0,"td",50),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function gh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Ch(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function fh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function xh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SumUnitPrice)," ")}}function hh(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?e.Discount:""," ")}}function Sh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):""," ")}}function yh(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?e.DiscountInvoice:""," ")}}function Dh(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?e.OrderDiscountAmount:""," ")}}function vh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Total)," ")}}function wh(i,s){if(i&1&&(n(0,"tr",46),E(1,mh,3,4,"td",3)(2,sh,2,1,"td",3),n(3,"td")(4,"a",47),p(5),a()(),E(6,ch,2,1,"td",3)(7,dh,3,6,"td",3)(8,uh,3,6,"td",3),n(9,"td")(10,"a",47),p(11),a()(),E(12,_h,1,1,"td",48)(13,gh,3,3,"td",35)(14,Ch,3,3,"td",35)(15,fh,3,3,"td",49)(16,xh,3,3,"td",49)(17,hh,2,1,"td",35)(18,Sh,3,3,"td",35)(19,yh,2,1,"td",35)(20,Dh,2,1,"td",35)(21,vh,3,3,"td",35),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Ax))("queryParams",X(22,Pa,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,Gx))("queryParams",X(25,Pa,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.ItemNote.selected),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",(e==null||e.Data==null?null:e.Data.VariantQuantity)>1),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.TotalCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Total.selected)}}function Th(i,s){i&1&&b(0,"td",34)}function Ph(i,s){i&1&&b(0,"td",34)}function Fh(i,s){i&1&&b(0,"td",34)}function Ih(i,s){i&1&&b(0,"td",34)}function bh(i,s){i&1&&(n(0,"td",51),p(1," Total : "),a())}function Eh(i,s){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Mh(i,s){i&1&&b(0,"td",34)}function Vh(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Total"))," ")}}function Bh(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,zx,2,0,"th",22)(7,Kx,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,Xx,2,0,"th",24)(11,Jx,2,0,"th",3)(12,Zx,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,$x,2,0,"th",3)(16,eh,2,0,"th",25)(17,th,2,0,"th",26)(18,ih,2,0,"th",27)(19,nh,2,0,"th",28)(20,ah,2,0,"th",25)(21,oh,2,0,"th",29)(22,rh,2,0,"th",25)(23,lh,2,0,"th",29)(24,ph,2,1,"th",30),a()(),n(25,"tbody"),E(26,wh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,Th,1,0,"td",33)(30,Ph,1,0,"td",33)(31,Fh,1,0,"td",33)(32,Ih,1,0,"td",33),b(33,"td",34),E(34,bh,2,0,"td",35)(35,Eh,4,6,"td",35)(36,Mh,1,0,"td",33)(37,Vh,4,6,"td",36),a()()()(),n(38,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.ItemNote.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.TotalCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.column.Supplier.selected),o(2),c("ngIf",e.column.Qty.selected||e.column.Total.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),c("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C;this.matDialog=T}columnService=Pe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Fulfillment:{selected:!1},Supplier:{selected:!0},ItemNote:{selected:!1,name:"Item Note"},Qty:{selected:!0,name:"Qty"},Cost:{selected:!0,name:"Cost"},TotalCost:{selected:!1,name:"Total Cost"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},Total:{selected:!0,name:"Total (RP)"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Cost for one quantity before discount",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end","title","Cost multiplied by quantity after discount",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],["title","Cost for one quantity before discount",1,"text-end",2,"width","75px"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],[1,"text-end",2,"width","70px"],["title","Cost multiplied by quantity after discount",1,"text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Yx,3,0,"button",2),a(),n(3,"filters"),E(4,Ux,28,18,"ng-template",null,0,O),a(),E(6,Bh,39,26,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,Te,Ne,Et,U,se,oe,Z,ie],encapsulation:2})};var Oh=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function Lh(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Rh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function kh(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function Wh(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function Nh(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,Wh,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function Ah(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function Gh(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,kh,2,0,"th",17),a()(),n(13,"tbody"),G(14,Nh,11,11,"tr",18,Y),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,Ah,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ia=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Lh,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,Rh,20,14,"ng-template",null,0,O),a(),S(8,Gh,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Oh)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,R,ne,Te,Ce,U,se,re,oe,Z,ie],encapsulation:2})};var Hh=()=>["/menu/Reports/Purchases_Report/Daily"];function Qh(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function Yh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),h("selectedCategoryIDChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),f("ngModel",e.pageData.Filter.SupplierID)}}function jh(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function qh(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function Uh(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,qh,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function zh(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function Kh(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Qh,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,Yh,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,jh,2,0,"th",8),a()(),n(18,"tbody"),G(19,Uh,7,5,"tr",9,Y),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,zh,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,Hh)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var ba=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,Kh,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,ne,Te,Ne,Ce,U,se,Z,ie],encapsulation:2})};function Xh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function Jh(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Ea=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,Xh,11,8,"ng-template",null,0,O),a(),S(5,Jh,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,R,Mt,Ce,U],encapsulation:2})};var Zh=()=>["/menu/Products/Catalog/Products/Info"],$h=i=>({ID:i});function e2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function t2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),f("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function i2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,Zh))("queryParams",X(15,$h,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function n2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,i2,17,17,"tr",20,Y),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ma=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,e2,3,0,"button",2),a(),n(3,"filters"),E(4,t2,17,10,"ng-template",null,0,O),a(),S(6,n2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,R,Ue,Ce,U,re,ie],encapsulation:2})};var a2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],o2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],r2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),l2=(i,s,e)=>({EntityID:i,From:s,To:e}),p2=()=>["/menu/Reports/Purchases_Report/Summary"];function m2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function s2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),h("modelChange",function(t){u(e);let l=m(2);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("model",e.isCompare)}}function c2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function d2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function u2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,s2,4,1,"div"),S(11,c2,7,2,"div"),S(12,d2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),f("model",e.pageData.Filter.ExcludeComplementary)}}function _2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function g2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function C2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function f2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function x2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function h2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function S2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function y2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,r2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function D2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function v2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function w2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function T2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,l2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,p2)),o(4),F(g(6,9,e.SalesWithTax))}}function P2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,S2,2,1,"td",38),S(4,y2,2,5,"td",40),S(5,D2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,v2,3,3,"td",38),S(10,w2,3,3,"td",39),d(11,"HideSumZero"),S(12,T2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function F2(i,s){i&1&&b(0,"td",37)}function I2(i,s){i&1&&b(0,"td",37)}function b2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function E2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function M2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function V2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function B2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,_2,2,0,"th",28),S(9,g2,2,0,"th",29),S(10,C2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,f2,2,0,"th",32),S(14,x2,2,1,"th",33),d(15,"HideSumZero"),S(16,h2,2,1,"th",34),a()(),n(17,"tbody"),G(18,P2,13,13,"tr",null,Y),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,F2,1,0,"td",37),S(24,I2,1,0,"td",37),S(25,b2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,E2,4,6,"td",38),S(31,M2,4,6,"td",39),d(32,"HideSumZero"),S(33,V2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Va=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Count":return V.compare(t.Count,l.Count,C);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"SalesNet":return V.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,C);case"Tax":return V.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,m2,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,u2,16,10,"ng-template",null,0,O),a(),S(16,B2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,a2)),o(3),c("routerLink",M(9,o2)),o(5),y(t.data?16:-1))},dependencies:[A,tt,Q,$,J,L,R,ne,pe,ge,Te,Ce,se,ei,re,oe,Z,ie],encapsulation:2})};var O2=()=>["/menu/Reports/Purchases_Report/Outlet"],L2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],R2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),k2=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function W2(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function N2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),h("dateChange",function(t){u(e);let l=m(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function A2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),h("ngModelChange",function(t){u(e);let l=m(3);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function G2(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),h("modelChange",function(t){u(e);let l=m(3);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),f("model",e.isCompare)}}function H2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),h("modelChange",function(t){u(e);let l=m(2);return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,N2,6,2),S(6,A2,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,G2,3,1),a()()}if(i&2){let e=m(2);o(4),f("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function Q2(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function Y2(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function j2(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function q2(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function U2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,R2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function z2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",fe(5,k2,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function K2(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,q2,2,1,"td",22),S(4,U2,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,z2,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function X2(i,s){i&1&&b(0,"td",21)}function J2(i,s){i&1&&b(0,"td",21)}function Z2(i,s){i&1&&b(0,"td")}function $2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,W2,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,H2,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,Q2,2,0,"th",12),S(24,Y2,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,j2,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,K2,21,20,"tr",null,Y),a(),n(39,"tfoot")(40,"tr",20),S(41,X2,1,0,"td",21),S(42,J2,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,Z2,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,O2)),o(3),c("routerLink",M(47,L2)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var Ba=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"SalesNet":return this.compare(t.Sales,l.Sales,C);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,$2,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,tt,Q,$,J,L,R,ne,pe,ge,Te,se,re,Z,ie],encapsulation:2})};var eS=()=>["/menu/Reports/Purchases_Report/Outlet"],tS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function iS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function nS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function aS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function oS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function rS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function lS(i,s){if(i&1&&(n(0,"td"),S(1,oS,2,1,"p",17),S(2,rS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function pS(i,s){if(i&1&&(n(0,"tr"),G(1,lS,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function mS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function sS(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,mS,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function cS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,iS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,nS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,aS,2,2,"th",11,Y),a()(),n(23,"tbody"),G(24,pS,3,0,"tr",null,Y),a(),S(26,sS,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,eS)),o(3),c("routerLink",M(9,tS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,C)=>{let T=e.direction==="asc";for(let Ze=0;Ze<this.data.Dataheader.length;Ze++)if(e.active==this.data.Dataheader[Ze])return typeof l[this.data.Dataheader[Ze]]=="string"?t(l[this.data.Dataheader[Ze]].toLocaleLowerCase(),C[this.data.Dataheader[Ze]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[Ze]],C[this.data.Dataheader[Ze]],T)});function t(l,C,T){return(l<C?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,cS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,pe,ge,Z],encapsulation:2})};var dS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],uS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],_S=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],gS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],CS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],fS=i=>({ID:i});function xS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function hS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(4),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function SS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,fS,e.CityID)),o(),F(e.CityName)}}function yS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function DS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,SS,2,4,"a",26),S(4,yS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function vS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,DS,11,12,"tr",null,Y),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var La=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,C);case"CityName":return this.compare(t.CityName,l.CityName,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Average":return this.compare(t.Average,l.Average,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,xS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,hS,13,6,"ng-template",null,0,O),a(),S(25,vS,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,dS)),o(3),c("routerLink",M(12,uS)),o(3),c("routerLink",M(13,_S)),o(3),c("routerLink",M(14,gS)),o(3),c("routerLink",M(15,CS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Ce,se,re,Z,ie],encapsulation:2})};var wS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],TS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],PS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],FS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],IS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function bS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function ES(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function MS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function VS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function BS(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function OS(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function LS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,BS,2,3,"td",28),S(11,OS,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function RS(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function kS(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function WS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,MS,2,0,"th",20),S(17,VS,2,0,"th",20),a()(),n(18,"tbody"),G(19,LS,12,15,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,RS,4,6,"td",24),S(41,kS,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Ra=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,C);case"Trans":return this.compare(t.Trans,l.Trans,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,bS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ES,9,5,"ng-template",null,0,O),a(),S(25,WS,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,wS)),o(3),c("routerLink",M(12,TS)),o(3),c("routerLink",M(13,PS)),o(3),c("routerLink",M(14,FS)),o(3),c("routerLink",M(15,IS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,R,pe,U,se,re,Z,ie],encapsulation:2})};var NS=()=>["/menu/Reports/Sales_Report/Standard/Person"],AS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],GS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],HS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],QS=(i,s)=>({From:i,To:s});function YS(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function jS(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function qS(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function US(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function zS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,US,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function KS(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function XS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,qS,2,0,"th",24),a()(),n(18,"tbody"),E(19,zS,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,KS,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var ka=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,YS,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,jS,9,5,"ng-template",null,0,O),a(),E(25,XS,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,NS)),o(3),c("routerLink",M(18,AS)),o(3),c("routerLink",M(19,GS)),o(3),c("routerLink",M(20,HS))("queryParams",fe(21,QS,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ne,pe,U,se,re,oe,Z],encapsulation:2})};var JS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],ZS=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],$S=i=>({ID:i});function ey(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,JS))}function ty(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function iy(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),f("date",e.pageData.Filter.From),o(3),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function ny(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function ay(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function oy(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,ay,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,ZS))("queryParams",X(18,$S,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function ry(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function ly(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function py(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function my(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function sy(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function cy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,ny,1,1,"th",28),a()(),n(21,"tbody"),E(22,oy,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,ry,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,ly,3,0,"span",37)(41,py,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,my,3,0,"a",39)(45,sy,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Wa=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,ey,2,2,"a",2)(3,ty,3,0,"a",3),a(),n(4,"filters"),E(5,iy,18,10,"ng-template",null,0,O),a(),E(7,cy,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,R,ne,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var dy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function uy(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function _y(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function gy(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function Cy(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function fy(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function xy(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,fi(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function hy(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,fy,3,4,"td",23),G(7,xy,3,8,"td",18,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Sy(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function yy(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function Dy(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,gy,2,0,"th",17),G(9,Cy,1,1,"th",18,Y),a()(),n(11,"tbody"),G(12,hy,9,6,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Sy,4,7,"td",21),G(22,yy,3,4,"td",22,Y),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Na=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,uy,3,0,"a",3),a(),n(5,"filters"),E(6,_y,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,Dy,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(8,dy)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,R,ne,pe,ge,U,se,Fi,re],encapsulation:2})};var vy=()=>["/menu/Products/Catalog/Variants/Info"],wy=i=>({ID:i});function Ty(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Py(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID)}}function Fy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function Iy(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function by(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function Ey(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function My(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Vy(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function By(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function Oy(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function Ly(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function Ry(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function ky(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function Wy(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function Ny(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function Ay(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function Gy(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function Hy(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Qy(i,s){if(i&1&&(n(0,"tr",34),E(1,Ly,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,Ry,2,1,"td",3)(6,ky,3,4,"td",3)(7,Wy,3,3,"td",36)(8,Ny,3,4,"td",3)(9,Ay,3,4,"td",3)(10,Gy,3,3,"td",37)(11,Hy,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,vy))("queryParams",X(12,wy,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function Yy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,Fy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,Iy,2,0,"th",18)(9,by,2,0,"th",19)(10,Ey,2,0,"th",20)(11,My,2,0,"th",21)(12,Vy,2,0,"th",22)(13,By,2,0,"th",23)(14,Oy,2,0,"th",24),a()(),n(15,"tbody"),E(16,Qy,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Aa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",C);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=C}roleService=Pe(j);columnService=Pe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),C);case"number":return this.compare(t[e.active],l[e.active],C);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(et({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Ty,3,0,"a",2),a(),n(3,"filters"),E(4,Py,15,8,"ng-template",null,0,O),a(),E(6,Yy,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ne,pe,ge,Ce,U,ze,re,oe,ie],encapsulation:2})};function jy(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function qy(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Uy(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function zy(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function Ky(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function Xy(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function Jy(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,Ky,3,3,"td",26),S(19,Xy,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function Zy(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function $y(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function eD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,Zy,4,6,"td",29),S(18,$y,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function tD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,Uy,2,0,"th",21),S(21,zy,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,Jy,23,18,"tr",23,Y),a(),S(27,eD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Ga=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,jy,3,0,"a",2),a(),n(3,"filters"),E(4,qy,18,10,"ng-template",null,0,O),a(),S(6,tD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,ne,pe,ge,Ue,Ne,Ce,U,se,Z,ie],encapsulation:2})};var iD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],nD=i=>({ID:i});function aD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function oD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function rD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,iD))("queryParams",X(12,nD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function lD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,rD,14,14,"tr",14,Y),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ha=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,aD,3,0,"a",2),a(),n(3,"filters"),E(4,oD,12,7,"ng-template",null,0,O),a(),S(6,lD,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ce,U,Z,ie],encapsulation:2})};function pD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function mD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function sD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),f("ngModel",e.pageData.Filter.ProductID)}}function cD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,mD,4,1,"div"),S(13,sD,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function dD(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function uD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,dD,11,8,"tr",20,Y),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var Qa=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,pD,3,0,"a",2),a(),n(3,"filters"),E(4,cD,17,11,"ng-template",null,0,O),a(),S(6,uD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,Te,Ne,U,ie],encapsulation:2})};var _D=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],gD=i=>({ID:i});function CD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function fD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function xD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,_D))("queryParams",X(21,gD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function hD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,xD,24,23,"tr",null,Y),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var Ya=class i extends me{constructor(e,r,t,l,C,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,CD,3,0,"a",2),a(),n(3,"filters"),E(4,fD,12,6,"ng-template",null,0,O),a(),S(6,hD,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ne,U,se,oe,Z,ie],encapsulation:2})};var SD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],yD=i=>({ID:i});function DD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function vD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),f("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function wD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function TD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function PD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,TD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function FD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function ID(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,PD,14,13,"tr",24,Y),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,FD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,SD))("queryParams",X(28,yD,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function bD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,wD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,ID,36,30,"div",null,Y),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,DD,3,0,"a",2),a(),n(3,"filters"),E(4,vD,12,6,"ng-template",null,0,O),a(),S(6,bD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ne,U,se,On,oe,Z,ie],encapsulation:2})};var ED=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],MD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],dl=i=>({ID:i});function VD(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function BD(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.RowCount),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),f("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),f("ngModel",e.pageData.Filter.VariantID)}}function OD(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function LD(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function RD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function kD(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function WD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,RD,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,kD,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,MD))("queryParams",X(28,dl,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,dl,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),$t(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function ND(i,s){i&1&&b(0,"td",39)}function AD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,ND,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function GD(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,OD,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,LD,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,WD,28,32,"tr",null,Y),a(),S(25,AD,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var qa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=C}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,C);case"Date":return this.compare(t.Date,l.Date,C);case"Number":return this.compare(t.Number,l.Number,C);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,C);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,C);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,C);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,C);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(We),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,VD,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,BD,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,GD,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,ED)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,R,ne,pe,ge,Ue,Ne,Et,Ce,U,ze,se,re,oe],encapsulation:2})};var HD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],QD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],YD=()=>["/menu/Contacts/Contact/Customers/Info"],jD=i=>({ID:i}),ul=(i,s)=>({"text-danger":i,"text-success":s});function qD(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function UD(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function zD(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function KD(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function XD(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function JD(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,ul,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function ZD(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,XD,3,3,"td",36),S(10,JD,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function $D(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,ZD,11,9,"tr",null,Y),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,YD))("queryParams",X(8,jD,e.CustomerID)),o(),$t(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function ev(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function tv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(4,ul,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function iv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,ev,3,3,"td",41),S(10,tv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function nv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,zD,2,0,"th",27),S(19,KD,2,0,"th",28),a()(),n(20,"tbody"),G(21,$D,14,10,"tr",29,Y),a(),S(23,iv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ua=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,C);case"Cost":return this.compare(t.TotalCost,l.TotalCost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,qD,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,UD,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,nv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,HD)),o(3),c("routerLink",M(11,QD)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Et,Z,ie],encapsulation:2})};var av=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),ov=()=>["/menu/Reports/Sales_Report/Standard/Detail"],rv=(i,s,e)=>({From:i,To:s,TypeID:e}),_l=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ka=(i,s)=>({"text-danger":i,"text-success":s});function lv(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function pv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),f("ngModel",e.Year),c("items",e.Years),o(2),f("ngModel",e.Month),c("items",e.Months)}}function mv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,pv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function sv(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function cv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function dv(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function uv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function _v(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function gv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Cv(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function fv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function xv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function hv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Sv(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function yv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function Dv(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,av,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function vv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function wv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function Tv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Pv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,ov))("queryParams",_t(12,rv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function Fv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,_l,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function Iv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function bv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function Ev(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Mv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Vv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function Bv(i,s){if(i&1&&(n(0,"td",29),S(1,Mv,3,7,"span",38),S(2,Vv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function Ov(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,yv,2,1,"td",29),S(6,Dv,2,5,"td",41),S(7,vv,3,3,"td",29),S(8,wv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,Tv,3,3,"td",36),d(13,"HideSumZero"),S(14,Pv,7,16,"td",29),S(15,Fv,3,7,"td",38),S(16,Iv,3,3,"td",39),S(17,bv,3,3,"td",40),S(18,Ev,3,3,"td",29),d(19,"HideSumZero"),S(20,Bv,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function Lv(i,s){i&1&&b(0,"td",35)}function Rv(i,s){i&1&&b(0,"td",35)}function kv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function Wv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Nv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Av(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function Gv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,_l,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function Hv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Qv(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function Yv(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function jv(i,s){if(i&1&&(n(0,"td",40),S(1,Qv,4,6,"span"),S(2,Yv,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function qv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function Uv(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function zv(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function Kv(i,s){if(i&1&&(n(0,"td",29),S(1,Uv,9,25,"span",38),S(2,zv,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function Xv(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,sv,2,0,"th",22),S(10,cv,2,0,"th",23),S(11,dv,2,0,"th",24),S(12,uv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,_v,2,0,"th",27),d(16,"HideSumZero"),S(17,gv,2,1,"th",28),S(18,Cv,2,0,"th",29),S(19,fv,2,0,"th",30),S(20,xv,2,1,"th",28),S(21,hv,2,0,"th",31),d(22,"HideSumZero"),S(23,Sv,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,Ov,23,28,"tr",null,Y),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,Lv,1,0,"td",35),S(34,Rv,1,0,"td",35),S(35,kv,4,7,"td",29),S(36,Wv,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,Nv,4,6,"td",36),d(42,"HideSumZero"),S(43,Av,5,6,"td",37),S(44,Gv,3,8,"td",38),S(45,Hv,4,6,"td",39),S(46,jv,3,2,"td",40),S(47,qv,4,6,"td",29),d(48,"HideSumZero"),S(49,Kv,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var za=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Count":return this.compare(t.Count,l.Count,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Gross":return this.compare(t.Gross,l.Gross,C);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,C);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,C);case"Expense":return this.compare(t.Expense,l.Expense,C);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,C);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,C);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,C);case"Achievement":return this.compare(t.Achievement,l.Achievement,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,lv,3,0,"button",2),a(),n(3,"filters"),E(4,mv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,Xv,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,tt,Q,$,J,L,R,ne,pe,ge,Te,U,se,ei,re,oe,Z,ie],encapsulation:2})};var gl=Jt(Po());var Jv=new Zt("HIGHCHARTS_LOADER"),Zv=new Zt("HIGHCHARTS_ROOT_MODULES"),$v=new Zt("HIGHCHARTS_OPTIONS"),e3=new Zt("HIGHCHARTS_CONFIG"),t3=new Zt("HIGHCHARTS_TIMEOUT"),i3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Pe(Jv),this.globalOptions=Pe($v,{optional:!0}),this.globalModules=Pe(Zv,{optional:!0})}loadHighchartsWithModules(r){return Hi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=an({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),n3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){dn(()=>Hi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Hi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=hi("chart"),this.oneToOne=hi(!1),this.options=hi.required(),this.update=un(),this.chartInstance=Ho(),this.destroyRef=Pe(Lo),this.el=Pe(Ro),this.platformId=Pe(ko),this.relativeConfig=Pe(e3,{optional:!0}),this.timeout=Pe(t3,{optional:!0}),this.highchartsChartService=Pe(i3),this.chartCreated=!1,this.constructorChart=xi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=xi(()=>Hi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,Go(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&zo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),jo(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=pn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Xa=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[mn([{directive:n3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function o3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),f("ngModel",e.pageData.Filter.ListIDs),o(5),f("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),f("ngModel",e.pageData.Filter.PriceRange)}}function r3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function l3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),$t(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function p3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,l3,11,12,"tr",null,Y),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Gn(gl.default);var Ja=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}Highcharts=Bi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,o3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,r3,3,0,"button",2),a(),S(6,p3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,U,Xa,re,ie],encapsulation:2})};var m3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Cl=i=>({ID:i});function s3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function c3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function d3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function u3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function _3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function g3(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function C3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function f3(i,s){if(i&1&&(b(0,"td",39),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function x3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",35),p(5),a()(),n(6,"td")(7,"a",36),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,g3,3,3,"td",37),S(15,C3,3,3,"td",38),G(16,f3,3,7,"td",39,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,m3))("queryParams",X(14,Cl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,Cl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function h3(i,s){if(i&1&&(n(0,"td",26)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function S3(i,s){if(i&1&&(n(0,"td",26)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function y3(i,s){if(i&1&&(n(0,"td",27),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function D3(i,s){if(i&1){let e=I();n(0,"span",40),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",41),p(2,"?"),a()()}}function v3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function w3(i,s){if(i&1){let e=I();n(0,"a",42),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",43),p(2," Next"),a()}}function T3(i,s){if(i&1){let e=I();n(0,"a",44),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",45),p(2," Show All"),a()}}function P3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,d3,2,0,"th",21),S(17,u3,2,0,"th",22),G(18,_3,1,1,"th",23,Y),a()(),n(20,"tbody"),G(21,x3,18,18,"tr",null,Y),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),S(26,h3,5,6,"td",26),S(27,S3,5,6,"td",26),G(28,y3,3,3,"td",27,Y),a()()()(),n(30,"div",28)(31,"div",29)(32,"div",30),p(33),d(34,"number"),S(35,D3,3,0,"span",31),S(36,v3,3,3,"span"),p(37),a()(),n(38,"div",32),S(39,w3,3,0,"a",33),S(40,T3,3,0,"a",34),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(5),y(e.roleService.product.Cost?26:-1),o(),y(e.roleService.product.Cost?27:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(34,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:35),o(),y(e.pageData.HideStoreApiCount?36:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(e.nextPageDisabled&&!e.goToLast?39:-1),o(),y(e.nextPageDisabled&&!e.goToLast?40:-1)}}var Za=class i extends vi{constructor(e,r,t,l,C,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=C;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Number":return this.compare(t.Number,l.Number,C);case"Date":return this.compare(t.Date,l.Date,C);case"Tax":return this.compare(t.Tax,l.Tax,C);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,s3,3,0,"button",2),a(),n(3,"filters"),E(4,c3,17,10,"ng-template",null,0,O),a(),S(6,P3,41,12,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,ne,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var F3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],I3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function b3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function E3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $a=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(We))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,b3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,E3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(7,F3)),o(3),c("routerLink",M(8,I3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,R,ii,U],encapsulation:2})};var M3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],ki=i=>[i],fl=(i,s)=>({"text-danger":i,"text-success":s});function V3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function B3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function O3(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function L3(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function R3(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function k3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function W3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function N3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,fl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function A3(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,k3,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,W3,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,N3,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",fe(16,fl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function G3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function H3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function Q3(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function Y3(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,O3,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,L3,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,R3,2,0,"th",23),a()(),n(34,"tbody"),G(35,A3,15,19,"tr",null,Y),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,G3,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,H3,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,Q3,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,ki,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,ki,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,ki,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var eo=class i extends me{constructor(e,r,t,l,C,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=C;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],C);case"string":return this.compare(t[e.active],l[e.active],C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(j),w(N),w(k),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,V3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,B3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,Y3,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,M3)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ne,pe,ge,Gt,Ce,U,oe,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Ji=Jt(bi());var j3={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Wi=class i{yearCtrl=new Zo(null);year=un(null);minDate=(0,Ji.default)().subtract(100,"years");maxDate=(0,Ji.default)();constructor(){dn(()=>{this.year()&&this.yearCtrl.setValue((0,Ji.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Ji.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn]},{provide:Dn,useValue:j3}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let C=Dt(4);return _(C.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))}),a()()}if(e&2){let t=Dt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[bn,wn,vn,Di,En,yi,Tn,Pn,Fn,At,Qe,L,gn,er],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
7
+ `],encapsulation:2,changeDetection:0})};var U3=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function z3(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),h("yearChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options.Currencies),o(4),f("year",e.pageData.Filter.FromYear),o(2),f("year",e.pageData.Filter.ToYear)}}function K3(i,s){if(i&1&&(n(0,"div",4),b(1,"POS-line-chart",11),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var to=class i extends me{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,C="",T=Math.abs(t[this.x]?t[this.x]:0);return T>999&&T<1e10?(C="K",l=(T/1e3).toFixed(0)):T>=1e10?(C="M",l=(T/1e6).toFixed(0)):T<999&&(l=T.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+C}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(T=>this.series?.name?.includes("Cost")?T?.name?.includes("Cost"):T?.name?.includes("Cost")==!1);let t=[],l="",C=this.point.index;return r.forEach(T=>{T.options.stack===this.point.series.options.stack&&(t=T.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
8
+ ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(T.points[C]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(C=>C.Name=="Sales").map(C=>C.Amount),t=this.data.Series.filter(C=>C.Name=="Profit").map(C=>C.Amount),l=this.data.Series.filter(C=>C.Name=="Cost").map(C=>C.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j))};static \u0275cmp=B({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[W],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),E(6,z3,16,10,"ng-template",null,0,O),a(),n(8,"content"),S(9,K3,2,2,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,U3)),o(7),y(t.data?9:-1))},dependencies:[A,Q,$,L,R,ne,Mt,Ce,U,Wi],encapsulation:2})};var X3=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],J3=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Z3=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],$3=i=>({id:i}),ew=i=>[i],xl=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],tw=(i,s,e)=>({CategoryID:i,From:s,To:e}),hl=i=>({CategoryID:i}),iw=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function nw(i,s){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",10),p(2," Export "),a()}}function aw(i,s){if(i&1&&(n(0,"span",24),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function ow(i,s){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,aw,2,3,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Hide Zero & Negative"),a(),n(31,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",X(21,ew,X(19,$3,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.TagID),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function rw(i,s){i&1&&(n(0,"th",47),p(1," DISCOUNT "),a())}function lw(i,s){i&1&&(n(0,"th",48),p(1," DISCOUNT (%) "),a(),n(2,"th",49),p(3," DISCOUNT (AMOUNT) "),a())}function pw(i,s){i&1&&(n(0,"th",50),p(1," COST "),a())}function mw(i,s){i&1&&(n(0,"th",51),p(1," PROFIT "),a())}function sw(i,s){i&1&&(n(0,"th",52),p(1," % "),a())}function cw(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function dw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function uw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Percentage),"% ")}}function _w(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",53),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),n(9,"td",41)(10,"a",53),p(11),d(12,"amountFraction"),a()(),n(13,"td",41)(14,"a",53),p(15),d(16,"amountFraction"),a()(),n(17,"td",41),p(18),d(19,"amountFraction"),a(),n(20,"td",43),p(21),d(22,"amountFraction"),a(),n(23,"td",41),p(24),d(25,"amountFraction"),a(),E(26,cw,3,3,"td",44)(27,dw,3,4,"td",45)(28,uw,3,4,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(34,xl))("queryParams",_t(35,tw,e.ID,v(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),v(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(e.Name),o(2),F(g(8,22,e.Quantity)),o(3),c("routerLink",M(39,xl))("queryParams",X(40,hl,e.ID)),o(),D(" ",g(12,24,e.GrossSales)," "),o(3),c("routerLink",M(42,iw))("queryParams",X(43,hl,e.ID)),o(),F(g(16,26,e.Discount)),o(3),F(g(19,28,e.Sales)),o(3),D(" ",g(22,30,e.Tax)," "),o(3),F(g(25,32,e.SalesNTax)),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit)}}function gw(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Cw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalProfit)," ")}}function fw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function xw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",25)(2,"div",26)(3,"table",27),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",28)(5,"tr")(6,"th",29),p(7,"CATEGORY"),a(),n(8,"th",30),p(9," QUANTITY "),a(),n(10,"th",31),p(11," GROSS SALES "),a(),E(12,rw,2,0,"th",32)(13,lw,4,0,"ng-template",null,1,O),n(15,"th",33),p(16," NET SALES "),a(),n(17,"th",34),p(18," Tax "),a(),n(19,"th",35),p(20," Sales + Tax "),a(),E(21,pw,2,0,"th",36)(22,mw,2,0,"th",37)(23,sw,2,0,"th",38),a()(),n(24,"tbody"),E(25,_w,29,45,"tr",39),a(),n(26,"tfoot")(27,"tr",40)(28,"td",41),p(29,"Total :"),a(),n(30,"td",41),p(31),d(32,"quantityFraction"),a(),n(33,"td",42)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",41),p(38),d(39,"amountFraction"),a(),n(40,"td",41),p(41),d(42,"amountFraction"),a(),n(43,"td",43),p(44),d(45,"amountFraction"),a(),n(46,"td",41),p(47),d(48,"amountFraction"),a(),E(49,gw,3,3,"td",44)(50,Cw,3,4,"td",45)(51,fw,3,4,"td",45),a()()()(),n(52,"POS-complex-pagination",46),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=Dt(14),r=m();o(12),c("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(2),c("ngForOf",r.data.Data),o(6),D(" ",g(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),F(g(36,19,r.data.Aggregate.TotalGross)),o(3),D(" ",g(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),D(" ",g(45,25,r.data.Aggregate.TotalTax)," "),o(3),D(" ",g(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(),c("total",r.data.Count)("pageData",r.pageData)}}var io=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Total":return this.compare(t.Total,l.Total,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Discount":return this.compare(t.Discount,l.Discount,C);case"NetSales":return this.compare(t.NetSales,l.NetSales,C);case"Cost":return this.compare(t.Cost,l.Cost,C);case"Profit":return this.compare(t.Profit,l.Profit,C);case"Percentage":return this.compare(t.Percentage,l.Percentage,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,C);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,nw,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,ow,32,23,"ng-template",null,0,O),a(),E(19,xw,53,29,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,X3)),o(3),c("routerLink",M(11,J3)),o(3),c("routerLink",M(12,Z3)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ne,pe,ge,Te,Ne,Et,Ce,U,ze,Mn,re,oe,Z,ie],encapsulation:2})};var yl=(i,s)=>({"text-danger":i,"text-success":s}),hw=()=>["/menu/Products/Catalog/Variants/Info"],Sl=i=>({ID:i}),Sw=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function yw(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Dw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(17,"div",11)(18,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",14)(25,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CompareDifference),c("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),f("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.Note),o(4),f("ngModel",e.pageData.Filter.DiscountFrom),o(),f("ngModel",e.pageData.Filter.DiscountTo)}}function vw(i,s){i&1&&(n(0,"th",26),p(1,"Cost"),a())}function ww(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.UnitCost))}}function Tw(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",38),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",38),p(10),a(),b(11,"span",39),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",33),p(16),d(17,"quantityFraction"),a(),S(18,ww,3,3,"td",34),n(19,"td",33),p(20),d(21,"amountFraction"),a(),n(22,"td",33),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",34),p(29),d(30,"amountFraction"),a(),n(31,"td",36),p(32),d(33,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(33,hw))("queryParams",X(34,Sl,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),c("routerLink",M(36,Sw))("queryParams",X(37,Sl,e.InvoiceID)),o(),F(e.Number),o(),c("innerHTML",e.Note,Ee),o(2),F(v(14,18,e.Date,"dd MMM yyyy")),o(3),F(g(17,21,e.Quantity)),o(2),y(r.roleService.product.Cost?18:-1),o(2),F(g(21,23,e.UnitPriceOriginal)),o(3),F(g(24,25,e.UnitPrice)),o(2),c("ngClass",fe(39,yl,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),D(" ",g(27,27,e.Discount)),o(3),D(" ",g(30,29,e.DiscountPercentage),"% "),o(3),F(g(33,31,e.Sales))}}function Pw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.data.Aggregate.TotalUnitCost))}}function Fw(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",40),P("jumpToPage",function(){u(e);let t=m(2);return _(t.getListData())})("previousPage",function(){u(e);let t=m(2);return _(t.getListData())})("nextPage",function(){u(e);let t=m(2);return _(t.getListData())}),a()}if(i&2){let e=m(2);c("total",e.data.Data.length)("pageData",e.pageData)}}function Iw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"div",17)(3,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",19)(5,"tr")(6,"th",20),p(7,"Outlet"),a(),n(8,"th",21),p(9,"Variant"),a(),n(10,"th",22),p(11,"Code"),a(),n(12,"th",23),p(13,"Number / Note"),a(),n(14,"th",24),p(15,"Date"),a(),n(16,"th",25),p(17,"Quantity"),a(),S(18,vw,2,0,"th",26),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),G(30,Tw,34,42,"tr",null,Y),a(),n(32,"tfoot")(33,"tr"),b(34,"td",32),n(35,"td",33),p(36,"Total :"),a(),n(37,"td",33),p(38),d(39,"quantityFraction"),a(),S(40,Pw,3,3,"td",34),n(41,"td",33),p(42),d(43,"amountFraction"),a(),n(44,"td",33),p(45),d(46,"amountFraction"),a(),n(47,"td",35),p(48),d(49,"amountFraction"),a(),n(50,"td",34),p(51),d(52,"amountFraction"),a(),n(53,"td",36),p(54),d(55,"amountFraction"),a()()()()(),S(56,Fw,1,2,"POS-complex-pagination",37),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(12),H(e.data.Data),o(8),F(g(39,10,e.data.Aggregate.TotalQuantity)),o(2),y(e.roleService.product.Cost?40:-1),o(2),F(g(43,12,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),F(g(46,14,e.data.Aggregate.TotalUnitPrice)),o(2),c("ngClass",fe(22,yl,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),D(" ",g(49,16,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount)),o(3),D(" ",g(52,18,e.data.Aggregate.DiscountPercentage),"% "),o(3),F(g(55,20,e.data.Aggregate.TotalNetSales)),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?56:-1)}}var no=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=C}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),C);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Number":return V.compare(t.Number,l.Number,C);case"Date":return V.compare(t.Date,l.Date,C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,C);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,C);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,C);case"Discount":return V.compare(t.Discount,l.Discount,C);case"Sales":return V.compare(t.Sales,l.Sales,C);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,C);case"Note":return V.compare(t.Note,l.Note,C);default:return 0}})}openExportModal(){this.dialog.open(K,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(We),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["colspan","4"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-success"],["api","SalesReport/TotalDiscount",3,"total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,yw,3,0,"a",2),a(),n(3,"filters"),E(4,Dw,27,16,"ng-template",null,0,O),a(),S(6,Iw,57,25,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Ne,Et,Ce,U,oe,Z,ie],encapsulation:2})};var bw=()=>["/menu/Reports/Sales_Report/Standard/Person"],Ew=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Mw=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Vw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Bw=(i,s)=>({From:i,To:s}),vl=i=>({ID:i}),Dl=i=>[i],Ow=(i,s)=>({SalesPersonID:i,ListIDs:s}),Lw=(i,s,e,r)=>({SalesPersonID:i,ListIDs:s,From:e,To:r});function Rw(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function kw(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),c("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function Ww(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",36)(7,"a",38),p(8),d(9,"number"),a()(),n(10,"td",36),p(11),d(12,"quantityFraction"),a(),n(13,"td",36),p(14),d(15,"quantityFraction"),a(),n(16,"td",36),p(17),d(18,"quantityFraction"),a(),n(19,"td",36),p(20),d(21,"amountFraction"),a(),n(22,"td",36),p(23),d(24,"amountFraction"),a(),n(25,"td",36)(26,"a",38),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",36),p(32),d(33,"quantityFraction"),a(),n(34,"td",36),p(35),d(36,"quantityFraction"),a(),n(37,"td",36),p(38),d(39,"quantityFraction"),a(),n(40,"td",36),p(41),d(42,"amountFraction"),a(),n(43,"td",36),p(44),d(45,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);o(2),c("queryParams",X(47,vl,e.PersonID)),o(),F(e.PersonName),o(2),F(e.PersonCode),o(2),c("queryParams",fe(51,Ow,e.PersonID,X(49,Dl,r.EntityID))),o(),F(g(9,17,e.CountOrder)),o(3),F(g(12,19,e.Quantity)),o(3),F(g(15,21,e.BasketSize)),o(3),F(g(18,23,e.BasketValue)),o(3),F(g(21,25,e.Sales)),o(3),F(g(24,27,e.AverageDailySales)),o(3),c("queryParams",Ut(56,Lw,e.PersonID,X(54,Dl,r.EntityID),v(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),v(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),D(" ",g(30,35,e.CountOrder1)),o(3),F(g(33,37,e.Quantity1)),o(3),F(g(36,39,e.BasketSize1)),o(3),F(g(39,41,e.BasketValue1)),o(3),F(g(42,43,e.Sales1)),o(3),F(g(45,45,e.AverageDailySales1))}}function Nw(i,s){if(i&1&&(n(0,"table",14)(1,"thead",22)(2,"tr",23)(3,"th",24)(4,"h2")(5,"a",25),p(6),a()()()(),n(7,"tr")(8,"th",26),p(9," Sales Person"),a(),n(10,"th",27)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",28)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",29)(27,"th",30),p(28," Ordr"),a(),n(29,"th",31),p(30,"Qty"),a(),n(31,"th",31),b(32,"i",32),a(),n(33,"th",33),p(34,"Basket Value"),a(),n(35,"th",33),p(36,"Sales"),a(),n(37,"th",33),p(38,"Avg Daily"),a(),n(39,"th",34),p(40,"Ordr"),a(),n(41,"th",31),p(42,"Qty"),a(),n(43,"th",31),b(44,"i",32),a(),n(45,"th",33),p(46,"Basket Value"),a(),n(47,"th",33),p(48,"Sales"),a(),n(49,"th",33),p(50,"Avg Daily"),a()()(),n(51,"tbody"),G(52,Ww,46,61,"tr",null,Y),a(),n(54,"tfoot")(55,"tr",35)(56,"td"),p(57,"Total"),a(),n(58,"td",36),p(59),d(60,"sum"),d(61,"number"),a(),n(62,"td",36),p(63),d(64,"sum"),d(65,"quantityFraction"),a(),n(66,"td",36),p(67),d(68,"sum"),d(69,"quantityFraction"),a(),n(70,"td",36),p(71),d(72,"sum"),d(73,"quantityFraction"),a(),n(74,"td",36),p(75),d(76,"sum"),d(77,"amountFraction"),a(),n(78,"td",36),p(79),d(80,"sum"),d(81,"amountFraction"),a(),n(82,"td",36),p(83),d(84,"sum"),d(85,"number"),a(),n(86,"td",36),p(87),d(88,"sum"),d(89,"quantityFraction"),a(),n(90,"td",36),p(91),d(92,"sum"),d(93,"quantityFraction"),a(),n(94,"td",36),p(95),d(96,"sum"),d(97,"quantityFraction"),a(),n(98,"td",36),p(99),d(100,"sum"),d(101,"amountFraction"),a(),n(102,"td",36),p(103),d(104,"sum"),d(105,"amountFraction"),a()()()()),i&2){let e=s.$implicit,r=m(2);o(5),c("queryParams",X(90,vl,e.EntityID)),o(),F(e.EntityName),o(6),F(v(13,18,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),F(v(17,21,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),F(v(21,24,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),F(v(25,27,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),H(e.SalesCommison),o(7),F(g(61,33,v(60,30,e.SalesCommison,"CountOrder"))),o(4),F(g(65,38,v(64,35,e.SalesCommison,"Quantity"))),o(4),F(g(69,43,v(68,40,e.SalesCommison,"BasketSize"))),o(4),F(g(73,48,v(72,45,e.SalesCommison,"BasketValue"))),o(4),F(g(77,53,v(76,50,e.SalesCommison,"Sales"))),o(4),F(g(81,58,v(80,55,e.SalesCommison,"AverageDailySales"))),o(4),F(g(85,63,v(84,60,e.SalesCommison,"CountOrder1"))),o(4),F(g(89,68,v(88,65,e.SalesCommison,"Quantity1"))),o(4),F(g(93,73,v(92,70,e.SalesCommison,"BasketSize1"))),o(4),F(g(97,78,v(96,75,e.SalesCommison,"BasketValue1"))),o(4),F(g(101,83,v(100,80,e.SalesCommison,"Sales1"))),o(4),F(g(105,88,v(104,85,e.SalesCommison,"AverageDailySales1")))}}function Aw(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=m();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,Rw,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,kw,13,9,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12)(30,"div",13),G(31,Nw,106,92,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(16,bw)),o(3),c("routerLink",M(17,Ew)),o(3),c("routerLink",M(18,Mw)),o(3),c("routerLink",M(19,Vw))("queryParams",fe(20,Bw,v(22,10,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,13,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),H(e.data==null?null:e.data.Data)}}var ao=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(We))};static \u0275cmp=B({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&S(0,Aw,33,23,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,L,R,ne,Gt,U,ze,se,re,oe,Z,ie],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var oo=class i{onPanelShow(){setTimeout(()=>{let s=document.querySelector(".p-multiselect-filter-container input.p-multiselect-filter");s&&(s.focus(),s.select?.())},0)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=pn({type:i,selectors:[["","autoFocusMultiselect",""]],hostBindings:function(e,r){e&1&&P("onPanelShow",function(){return r.onPanelShow()})}})};var Hw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Qw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Yw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],jw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],qw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Uw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],wl=i=>({ID:i});function zw(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",35),h("modelChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=m(2);o(2),f("model",e.pageData.Filter.ReleasedType),c("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function Kw(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),S(10,zw,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",22)(14,"datepicker",23),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",24),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",25)(17,"div",26),p(18,"Number Of Interval"),a(),n(19,"div",26),p(20,"Interval Of"),a()(),n(21,"div",27)(22,"input",28),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",29)(24,"input",30),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",31),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",32),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",33),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",34),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("ngModel",e.pageData.Filter.ListTagID),c("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),y((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),f("date",e.pageData.Filter.ReleasedFrom),o(),f("date",e.pageData.Filter.ReleasedTo),o(7),f("ngModel",e.pageData.Filter.IntervalCount),o(2),f("ngModel",e.pageData.Filter.IntervalDays),o(5),c("max",1e3),f("ngModel",e.pageData.Filter.RowCount),o(3),f("model",e.pageData.Filter.PurchaseType),c("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),f("model",e.pageData.Filter.GroupByProduct),c("options",e.scopeFilter),o(3),f("model",e.pageData.Filter.HideZero),c("options",e.hideZeroOptions)}}function Xw(i,s){if(i&1){let e=I();n(0,"button",36),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",37),p(2," Export "),a()}}function Jw(i,s){if(i&1&&(n(0,"th",38),p(1),a(),n(2,"th",39),p(3," % "),a()),i&2){let e=s.$index,r=m();c("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),D(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),c("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function Zw(i,s){if(i&1&&(n(0,"th",40),d(1,"date"),d(2,"date"),p(3," TOT "),a(),n(4,"th",41),d(5,"date"),d(6,"date"),p(7," % "),a()),i&2){let e=m();c("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
9
9
  `+v(1,2,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(2,5,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):"")),o(4),c("matTooltip","Total Percentage items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
10
- `+v(5,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(6,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function rT(i,s){}function lT(i,s){i&1&&b(0,"img",44)}function pT(i,s){if(i&1&&(n(0,"a",47),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,Pl,e.ID)),o(),F(e.Name)}}function mT(i,s){if(i&1&&(n(0,"a",48),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,Pl,e.ID)),o(),F(e.Name)}}function sT(i,s){if(i&1&&(n(0,"td",51)(1,"span",53),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",52)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=s.$implicit;o(),c("matTooltip","From : "+v(2,3,e.From,"dd MMM yyyy")+`
11
- To : `+v(3,6,e.To,"dd MMM yyyy")),o(3),D(" ",g(5,9,e.Value)," "),o(4),D(" ",v(9,11,e.Percentage,"1.0-0"),"%")}}function cT(i,s){if(i&1&&(n(0,"td",51)(1,"span"),p(2),d(3,"number"),a()(),n(4,"td",54)(5,"small"),p(6),d(7,"number"),a()()),i&2){let e=m(2).$implicit;o(2),F(g(3,2,e==null?null:e.IntervalTotal)),o(4),D("",v(7,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function dT(i,s){if(i&1&&S(0,cT,8,7),i&2){let e=m().$implicit;y((e==null||e.Intervals==null?null:e.Intervals.length)>0?0:-1)}}function uT(i,s){if(i&1){let e=I();n(0,"tr")(1,"td")(2,"div",42)(3,"div",43),S(4,rT,0,0)(5,lT,1,0,"img",44),n(6,"img",45),P("click",function(t){u(e);let l=m();return _(l.onZoomImage(t,t))}),a()(),n(7,"div",46),S(8,pT,2,4,"a",47)(9,mT,2,4,"a",48),n(10,"small",49),p(11),a()()()(),n(12,"td")(13,"div",46)(14,"div"),p(15),d(16,"date"),a(),n(17,"small",50),d(18,"date"),d(19,"date"),p(20),d(21,"number"),a()()(),n(22,"td",51),p(23),d(24,"number"),a(),G(25,sT,10,14,null,null,ji),n(27,"td",51)(28,"span"),p(29),d(30,"number"),a()(),n(31,"td",52)(32,"small"),p(33),d(34,"number"),a()(),S(35,dT,1,1),n(36,"td",51),p(37),d(38,"number"),a()()}if(i&2){let e=s.$implicit,r=m();o(4),y(e.ThumbnailUrl?4:5),o(2),c("src",Ct(e.ThumbnailUrl),ln),o(2),y(!(r.pageData==null||r.pageData.Filter==null)&&r.pageData.Filter.GroupByProduct?8:9),o(3),F(e.Code),o(4),D(" ",v(16,13,e.Released,"dd MMM yyyy")," "),o(2),c("matTooltip",v(18,16,e.Released,"dd MMM yyyy")+" - "+v(19,19,r.today,"dd MMM yyyy")),o(3),D("",g(21,22,e.ReleasedDays)," days"),o(3),F(g(24,24,e.Purchased)),o(2),H(e==null?null:e.Intervals),o(4),F(g(30,26,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),D(" ",v(34,28,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),y((e==null||e.Intervals==null?null:e.Intervals.length)>0?35:-1),o(2),F(g(38,31,e.Inventory))}}function _T(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",55),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()}if(i&2){let e=m();c("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var po=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=C;this.dialog=T}intervalDays=dt(30);today=new Date;defaultReleasedType=dt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((C,T)=>(t[`Interval${T}`]=C.Value,C.Percentage=this.calculatePercentage(C.Value,t.Purchased),t[`Percentage${T}`]=C.Percentage,C)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((C,T)=>C+T.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=V.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}openExportModal(){this.dialog.open(K,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(We),w(Gn),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[W],decls:53,vars:23,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],["api","Report/ProductTagsCount",3,"total","pageData"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","","autoFocusMultiselect","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,iT,39,24,"ng-template",null,0,O),a(),n(4,"actions"),S(5,nT,3,0,"button",2),n(6,"div",3)(7,"button",4),p(8," More "),a(),n(9,"ul",5)(10,"li")(11,"a",6),p(12," Product Sold "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",6),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",6),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",6),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",6),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",7)(30,"div",8)(31,"table",9),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(32,"thead",10)(33,"tr")(34,"th",11),p(35,"Name"),a(),n(36,"th",12),p(37," Released "),a(),n(38,"th",13),p(39," Purchased "),a(),G(40,aT,4,5,null,null,ji),n(42,"th",14),p(43),a(),n(44,"th",15),p(45," % "),a(),S(46,oT,8,14),n(47,"th",16),p(48," On Hand "),a()()(),n(49,"tbody"),G(50,uT,39,33,"tr",null,j),a()()(),S(52,_T,1,2,"POS-complex-pagination",17),a()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("hideSearchBox",!0),o(5),y(!(t.role==null||t.role.global==null)&&t.role.global.Export?5:-1),o(6),c("routerLink",M(17,Kw)),o(3),c("routerLink",M(18,Xw)),o(3),c("routerLink",M(19,Jw)),o(3),c("routerLink",M(20,Zw)),o(3),c("routerLink",M(21,$w)),o(3),c("routerLink",M(22,eT)),o(14),H(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),c("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),D(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),c("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),y((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0?46:-1),o(4),H(t.data==null?null:t.data.Data),o(2),y((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?52:-1))},dependencies:[A,Q,J,Qe,ir,L,k,ae,pe,Ce,Ue,Te,Et,fe,U,wr,lo,ne,re],encapsulation:2})};var gT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],CT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],fT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],xT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],hT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],ST=()=>["/menu/Contacts/Contact/Customers/Info"],yT=i=>({ID:i}),DT=()=>["/menu/Reports/Sales_Report/Standard/Summary"],vT=i=>({CustomerID:i});function wT(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function TT(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function PT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",19),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",19),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(19,ST))("queryParams",X(20,yT,e.CustomerID)),o(),F(e.Name),o(2),F(e.Mobile),o(2),F(v(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),F(v(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),F(e.Days),o(2),c("routerLink",M(22,DT))("queryParams",X(23,vT,e.CustomerID)),o(),F(e.Orders),o(2),F(g(19,17,e.Amount))}}function FT(i,s){if(i&1&&(n(0,"tbody",11),G(1,PT,20,25,"tr",null,j),a()),i&2){let e=m();o(),H(e.data.Data)}}var mo=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=C}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(K,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(z),w(re),w(Y))};static \u0275cmp=B({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[W],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,wT,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),E(23,TT,10,6,"ng-template",null,0,O),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),S(44,FT,3,0,"tbody",11),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,gT)),o(3),c("routerLink",M(12,CT)),o(3),c("routerLink",M(13,fT)),o(3),c("routerLink",M(14,xT)),o(3),c("routerLink",M(15,hT)),o(24),y(t.data?44:-1))},dependencies:[A,Q,J,L,k,ae,U,ne,re],encapsulation:2})};var Qt=Zt(Ei());var IT=["outletSelectorRef"],bT=(i,s)=>s.Key;function ET(i,s){if(i&1){let e=I();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=m();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),b(4,"i",12),a()()}if(i&2){let e=s.$implicit;o(2),F(e.Value)}}var so=class i{constructor(s){this._dialogRef=s;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=Ki.Success,this.pageData.set(this.data.pageData)}modalConfig=new Fi;data=Fe(ii);pageData=dt(null);injector=Fe(rn);variant$;#e=Fe(R);listVariantSelected=dt([]);toastr=Fe(qe);route=Fe(We);outletSelector;itemHashMap=new Map;router=Fe(Cn);productOrVarariantAPIURL=dt("");minDateFrom=dt((0,Qt.default)().subtract(90,"days"));maxDateFrom=dt((0,Qt.default)().subtract(2,"days"));minDateTo=dt((0,Qt.default)().subtract(90,"days"));maxDateTo=dt((0,Qt.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){xn(this.pageData,{injector:this.injector}).pipe(mi(s=>!!s),an(),At(s=>{let e=s.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(At(s=>{s.keys.length>0?this.pageData.update(e=>nt(tt({},e),{Filter:nt(tt({},e.Filter),{From:s.get("From"),To:s.get("To"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[],ListVariantID:s.get("ListVariantID")?s.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(s.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Qt.default)().subtract(2,"days")),this.minDateFrom.set((0,Qt.default)().subtract(90,"days")),this.pageData.update(e=>nt(tt({},e),{Filter:nt(tt({},e.Filter),{From:(0,Qt.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(s,e,r){let t=[...s,...e];return Array.from(new Set(t.map(C=>C[r]))).map(C=>t.find(T=>T[r]===C))}fetchVariantItems(){this.route.queryParamMap.pipe(mi(s=>s&&s.keys.length>0),Lo(s=>{let r=[...s.get("ListVariantID").split(","),s.get("ID")].filter(C=>C),t=JSON.parse(s.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(s.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Yi(()=>_i(null)))}),mi(s=>!!s),At(s=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),s,"Key"))})).subscribe()}onVariantSelected(s){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(s).Key]};this.#e.post(e,r).pipe(Yi(()=>_i(null)),At(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(s){this.pageData.update(e=>nt(tt({},e),{Filter:nt(tt({},e.Filter),{GroupByVariant:s})})),this.listVariantSelected.set([])}onRemoveHandler(s){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==s.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",Ki.Warning);return}this.pageData.update(e=>nt(tt({},e),{Filter:nt(tt({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:tt({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Qt.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Qt.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(w(ti))};static \u0275cmp=B({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&cn(IT,5),e&2){let t;fi(t=xi())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),h("ngModelChange",function(l){return x(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),G(12,ET,5,1,"mat-chip",null,bT),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),h("dateChange",function(l){return x(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),h("dateChange",function(l){return x(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(c("config",r.modalConfig),o(6),c("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),f("ngModel",r.pageData().Filter.ListIDs),o(4),c("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),H(r.listVariantSelected()),o(5),c("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),f("date",r.pageData().Filter.From),o(),c("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),f("date",r.pageData().Filter.To),o(3),c("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[Gt,L,k,bi,On,ni,U,Mi,J,Nr,kr,Rr,Wr,Nn,Te,Wn,Ne,yn,ae],styles:["[_nghost-%COMP%]{display:block}"]})};var li=Zt(Ei()),Fl=Zt(bo());var MT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],VT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],BT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],OT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],LT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],RT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function kT(i,s){}Hn(Fl.default);var co=class i{constructor(s,e,r,t,l,C,T,$e,Ai){this.route=s;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=C;this.cdr=T;this.injector=$e;this.router=Ai}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=dt(null);Highcharts=dt(Oi);variantOrProductItems=dt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,li.default)(e).isSame((0,li.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,li.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,li.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,li.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(Nt(1))}parseQueryParams(s){let e=s.get("ID")?[s.get("ID")]:s.get("ListVariantID")?[...s.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(s.get("GroupByVariant")||"false"),From:(0,li.default)(s.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,li.default)(s.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(s,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:s}).pipe(mi(t=>!!t),qt(t=>({Key:t.Key,Value:t.Value})),Nt(1))}fetchChartQuantitySold(s){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",s).pipe(qt(e=>nt(tt({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>nt(tt({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),At(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Yi(e=>_i(null)),Nt(1))}handleVariantOrProductItems(){let s=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(s);this.fetchVariantOrProductItems(e,r).pipe(At(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(Ro(100),Co(s=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(s.Filter)}),Nt(1)),go([this.chartData$,this.pageSetupService.menu$]).pipe(qt(([s,e])=>({chartData:s,menu:nt(tt({},e),{H:s.FullPageTitle,T:e.T.replace("undefined",s.FullPageTitle)})})),At(({chartData:s,menu:e})=>{this.menu$=_i(e),this.seriesData.set(s.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(s){let e=document.cookie.match(new RegExp("(?:^|; )"+s.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){xn(this.seriesData,{injector:this.injector}).pipe(mi(s=>!!s),an(),At(s=>Oi.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Oi.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(s.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:s.Series.map((e,r)=>nt(tt({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){go([this.loader$]).pipe(qt(([s])=>({loader:s})),Co(({loader:s})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=nt(tt({},s),{Filter:nt(tt({},s.Filter),{From:e?e.from:s.Filter.From,To:e?e.to:s.Filter.To})});return this.matDialog.open(so,{data:{pageData:r}}).afterClosed()}),At(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(w(We),w(R),w(N),w(z),w(qe),w(Zo),w(Uo),w(rn),w(Cn))};static \u0275cmp=B({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),d(1,"async"),pt(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),b(5,"i",5)(6,"i",6),a()(),mt(),pt(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),mt(),pt(30,12),E(31,kT,0,0,"ng-template",null,0,O),mt(),n(33,"content"),b(34,"div",13),a()()}e&2&&(c("pageData",g(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),c("routerLink",M(11,MT)),o(3),c("routerLink",M(12,VT)),o(3),c("routerLink",M(13,BT)),o(3),c("routerLink",M(14,OT)),o(3),c("routerLink",M(15,LT)),o(3),c("routerLink",M(16,RT)))},dependencies:[vi,zi,Q,bi,A,Mi,Gt,gn],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var WT=[{path:"Sales_Report/Standard/Detail",component:Yn},{path:"Sales_Report/Standard/Summary",component:qn},{path:"Sales_Report/Standard/Top_Brand",component:Un},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:to},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:Ka},{path:"Sales_Report/Standard/Top_Customers",component:Kn},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:mo},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:Xn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Jn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Zn},{path:"Sales_Report/Standard/Top_Customers/City",component:ka},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:Wa},{path:"Sales_Report/Standard/Products_Sold",component:$n},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:co},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:po},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:ea},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:ta},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:ia},{path:"Sales_Report/Standard/Category_Sold",component:ao},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:na},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:aa},{path:"Sales_Report/Standard/Category_Sold/Category",component:oa},{path:"Sales_Report/Standard/Peak",component:ra},{path:"Sales_Report/Standard/Peak/Peak",component:pa},{path:"Sales_Report/Standard/Daily",component:ma},{path:"Sales_Report/Standard/Daily/Daily_Table",component:ua},{path:"Sales_Report/Standard/Monthly",component:ca},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:_a},{path:"Sales_Report/Standard/Yearly",component:no},{path:"Sales_Report/Standard/Yearly/Comparison",component:da},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:ga},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:Ca},{path:"Sales_Report/Standard/Outlet_Performance",component:xa},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:fa},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:ha},{path:"Sales_Report/Standard/Sales_Order_Tag",component:Xa},{path:"Sales_Report/Standard/Person",component:ya},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:ro},{path:"Sales_Report/Standard/Person/Commission_Report",component:Da},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:va},{path:"Sales_Report/Standard/Person/Sales_Group",component:Na},{path:"Sales_Report/Standard/Discounted_Sales",component:oo},{path:"Purchases_Report/Detail",component:wa},{path:"Purchases_Report/Summary",component:Ta},{path:"Purchases_Report/Supplier",component:Pa},{path:"Purchases_Report/Product",component:Fa},{path:"Purchases_Report/History",component:ba},{path:"Purchases_Report/Daily",component:Ea},{path:"Purchases_Report/Daily/Monthly",component:Ma},{path:"Purchases_Report/Volume",component:Va},{path:"Purchases_Report/Sales",component:Ba},{path:"Purchases_Report/Tax",component:eo},{path:"Purchases_Report/Outlet",component:Oa},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:La},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:Ra},{path:"Sales_Report/Standard/Compare",component:io},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:Sa},{path:"Sales_Report/Advanced/Tax_Report",component:Aa},{path:"Sales_Report/Advanced/Visitor",component:la},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Ga},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Ha},{path:"Sales_Report/Advanced/Product_Profit",component:Qa},{path:"Sales_Report/Advanced/Exchanged_Sales",component:Ya},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:ja},{path:"Sales_Report/Advanced/Logistics_Service",component:Yr},{path:"Return/Sales_Return",component:qa},{path:"Return/Purchase_Return",component:Ua},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:za},{path:"Sales_Report/Standard/Price_Analysis",component:$a},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],uo=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Ci({type:i});static \u0275inj=gi({imports:[zi.forChild(WT),zi]})};var Il=`
10
+ `+v(5,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(6,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function $w(i,s){}function eT(i,s){i&1&&b(0,"img",44)}function tT(i,s){if(i&1&&(n(0,"a",47),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,wl,e.ID)),o(),F(e.Name)}}function iT(i,s){if(i&1&&(n(0,"a",48),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,wl,e.ID)),o(),F(e.Name)}}function nT(i,s){if(i&1&&(n(0,"td",51)(1,"span",53),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",52)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=s.$implicit;o(),c("matTooltip","From : "+v(2,3,e.From,"dd MMM yyyy")+`
11
+ To : `+v(3,6,e.To,"dd MMM yyyy")),o(3),D(" ",g(5,9,e.Value)," "),o(4),D(" ",v(9,11,e.Percentage,"1.0-0"),"%")}}function aT(i,s){if(i&1&&(n(0,"td",51)(1,"span"),p(2),d(3,"number"),a()(),n(4,"td",54)(5,"small"),p(6),d(7,"number"),a()()),i&2){let e=m(2).$implicit;o(2),F(g(3,2,e==null?null:e.IntervalTotal)),o(4),D("",v(7,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function oT(i,s){if(i&1&&S(0,aT,8,7),i&2){let e=m().$implicit;y((e==null||e.Intervals==null?null:e.Intervals.length)>0?0:-1)}}function rT(i,s){if(i&1){let e=I();n(0,"tr")(1,"td")(2,"div",42)(3,"div",43),S(4,$w,0,0)(5,eT,1,0,"img",44),n(6,"img",45),P("click",function(t){u(e);let l=m();return _(l.onZoomImage(t,t))}),a()(),n(7,"div",46),S(8,tT,2,4,"a",47)(9,iT,2,4,"a",48),n(10,"small",49),p(11),a()()()(),n(12,"td")(13,"div",46)(14,"div"),p(15),d(16,"date"),a(),n(17,"small",50),d(18,"date"),d(19,"date"),p(20),d(21,"number"),a()()(),n(22,"td",51),p(23),d(24,"number"),a(),G(25,nT,10,14,null,null,Yi),n(27,"td",51)(28,"span"),p(29),d(30,"number"),a()(),n(31,"td",52)(32,"small"),p(33),d(34,"number"),a()(),S(35,oT,1,1),n(36,"td",51),p(37),d(38,"number"),a()()}if(i&2){let e=s.$implicit,r=m();o(4),y(e.ThumbnailUrl?4:5),o(2),c("src",Ct(e.ThumbnailUrl),rn),o(2),y(!(r.pageData==null||r.pageData.Filter==null)&&r.pageData.Filter.GroupByProduct?8:9),o(3),F(e.Code),o(4),D(" ",v(16,13,e.Released,"dd MMM yyyy")," "),o(2),c("matTooltip",v(18,16,e.Released,"dd MMM yyyy")+" - "+v(19,19,r.today,"dd MMM yyyy")),o(3),D("",g(21,22,e.ReleasedDays)," days"),o(3),F(g(24,24,e.Purchased)),o(2),H(e==null?null:e.Intervals),o(4),F(g(30,26,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),D(" ",v(34,28,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),y((e==null||e.Intervals==null?null:e.Intervals.length)>0?35:-1),o(2),F(g(38,31,e.Inventory))}}function lT(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",55),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()}if(i&2){let e=m();c("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ro=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=C;this.dialog=T}intervalDays=dt(30);today=new Date;defaultReleasedType=dt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((C,T)=>(t[`Interval${T}`]=C.Value,C.Percentage=this.calculatePercentage(C.Value,t.Purchased),t[`Percentage${T}`]=C.Percentage,C)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((C,T)=>C+T.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=V.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";return this.compare(t[e.active],l[e.active],C)})}openExportModal(){this.dialog.open(K,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(We),w(An),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[W],decls:53,vars:23,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],["api","Report/ProductTagsCount",3,"total","pageData"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","","autoFocusMultiselect","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,Kw,39,24,"ng-template",null,0,O),a(),n(4,"actions"),S(5,Xw,3,0,"button",2),n(6,"div",3)(7,"button",4),p(8," More "),a(),n(9,"ul",5)(10,"li")(11,"a",6),p(12," Product Sold "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",6),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",6),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",6),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",6),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",7)(30,"div",8)(31,"table",9),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(32,"thead",10)(33,"tr")(34,"th",11),p(35,"Name"),a(),n(36,"th",12),p(37," Released "),a(),n(38,"th",13),p(39," Purchased "),a(),G(40,Jw,4,5,null,null,Yi),n(42,"th",14),p(43),a(),n(44,"th",15),p(45," % "),a(),S(46,Zw,8,14),n(47,"th",16),p(48," On Hand "),a()()(),n(49,"tbody"),G(50,rT,39,33,"tr",null,Y),a()()(),S(52,lT,1,2,"POS-complex-pagination",17),a()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("hideSearchBox",!0),o(5),y(!(t.role==null||t.role.global==null)&&t.role.global.Export?5:-1),o(6),c("routerLink",M(17,Hw)),o(3),c("routerLink",M(18,Qw)),o(3),c("routerLink",M(19,Yw)),o(3),c("routerLink",M(20,jw)),o(3),c("routerLink",M(21,qw)),o(3),c("routerLink",M(22,Uw)),o(14),H(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),c("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),D(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),c("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),y((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0?46:-1),o(4),H(t.data==null?null:t.data.Data),o(2),y((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?52:-1))},dependencies:[A,Q,J,Qe,$o,L,R,ne,pe,ge,Ue,Te,Et,Ce,U,yr,oo,re,oe],encapsulation:2})};var pT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],mT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],sT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],cT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],dT=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],uT=()=>["/menu/Contacts/Contact/Customers/Info"],_T=i=>({ID:i}),gT=()=>["/menu/Reports/Sales_Report/Standard/Summary"],CT=i=>({CustomerID:i});function fT(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function xT(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function hT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",19),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",19),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(19,uT))("queryParams",X(20,_T,e.CustomerID)),o(),F(e.Name),o(2),F(e.Mobile),o(2),F(v(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),F(v(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),F(e.Days),o(2),c("routerLink",M(22,gT))("queryParams",X(23,CT,e.CustomerID)),o(),F(e.Orders),o(2),F(g(19,17,e.Amount))}}function ST(i,s){if(i&1&&(n(0,"tbody",11),G(1,hT,20,25,"tr",null,Y),a()),i&2){let e=m();o(),H(e.data.Data)}}var lo=class i extends De{constructor(e,r,t,l,C){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=C}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(K,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(z),w(oe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[W],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,fT,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),E(23,xT,10,6,"ng-template",null,0,O),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),S(44,ST,3,0,"tbody",11),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,pT)),o(3),c("routerLink",M(12,mT)),o(3),c("routerLink",M(13,sT)),o(3),c("routerLink",M(14,cT)),o(3),c("routerLink",M(15,dT)),o(24),y(t.data?44:-1))},dependencies:[A,Q,J,L,R,ne,U,re,oe],encapsulation:2})};var Ht=Jt(bi());var yT=["outletSelectorRef"],DT=(i,s)=>s.Key;function vT(i,s){if(i&1){let e=I();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=m();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),b(4,"i",12),a()()}if(i&2){let e=s.$implicit;o(2),F(e.Value)}}var po=class i{constructor(s){this._dialogRef=s;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=zi.Success,this.pageData.set(this.data.pageData)}modalConfig=new Vn;data=Pe(Ti);pageData=dt(null);injector=Pe(on);variant$;#e=Pe(k);listVariantSelected=dt([]);toastr=Pe(qe);route=Pe(We);outletSelector;itemHashMap=new Map;router=Pe(_n);productOrVarariantAPIURL=dt("");minDateFrom=dt((0,Ht.default)().subtract(90,"days"));maxDateFrom=dt((0,Ht.default)().subtract(2,"days"));minDateTo=dt((0,Ht.default)().subtract(90,"days"));maxDateTo=dt((0,Ht.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){Cn(this.pageData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>{let e=s.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(Nt(s=>{s.keys.length>0?this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:s.get("From"),To:s.get("To"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[],ListVariantID:s.get("ListVariantID")?s.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(s.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Ht.default)().subtract(2,"days")),this.minDateFrom.set((0,Ht.default)().subtract(90,"days")),this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{From:(0,Ht.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(s,e,r){let t=[...s,...e];return Array.from(new Set(t.map(C=>C[r]))).map(C=>t.find(T=>T[r]===C))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(s=>s&&s.keys.length>0),Vo(s=>{let r=[...s.get("ListVariantID").split(","),s.get("ID")].filter(C=>C),t=JSON.parse(s.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(s.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Qi(()=>ci(null)))}),ri(s=>!!s),Nt(s=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),s,"Key"))})).subscribe()}onVariantSelected(s){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(s).Key]};this.#e.post(e,r).pipe(Qi(()=>ci(null)),Nt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(s){this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{GroupByVariant:s})})),this.listVariantSelected.set([])}onRemoveHandler(s){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==s.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",zi.Warning);return}this.pageData.update(e=>nt(et({},e),{Filter:nt(et({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:et({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Ht.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Ht.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(w(wi))};static \u0275cmp=B({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&sn(yT,5),e&2){let t;_i(t=gi())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),h("ngModelChange",function(l){return x(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),G(12,vT,5,1,"mat-chip",null,DT),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),h("dateChange",function(l){return x(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),h("dateChange",function(l){return x(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(c("config",r.modalConfig),o(6),c("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),f("ngModel",r.pageData().Filter.ListIDs),o(4),c("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),H(r.listVariantSelected()),o(5),c("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),f("date",r.pageData().Filter.From),o(),c("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),f("date",r.pageData().Filter.To),o(3),c("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[At,L,R,Ii,Bn,Pi,U,Ei,J,Rr,Or,Br,Lr,Wn,Te,kn,Ne,hn,ne],styles:["[_nghost-%COMP%]{display:block}"]})};var ni=Jt(bi()),Tl=Jt(Po());var wT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],TT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],PT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],FT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],IT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function ET(i,s){}Gn(Tl.default);var mo=class i{constructor(s,e,r,t,l,C,T,Ze,Ni){this.route=s;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=C;this.cdr=T;this.injector=Ze;this.router=Ni}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=dt(null);Highcharts=dt(Bi);variantOrProductItems=dt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,ni.default)(e).isSame((0,ni.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,ni.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ni.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(jt(1))}parseQueryParams(s){let e=s.get("ID")?[s.get("ID")]:s.get("ListVariantID")?[...s.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(s.get("GroupByVariant")||"false"),From:(0,ni.default)(s.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(s.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:s.get("ListIDs")?s.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(s,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:s}).pipe(ri(t=>!!t),oi(t=>({Key:t.Key,Value:t.Value})),jt(1))}fetchChartQuantitySold(s){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",s).pipe(oi(e=>nt(et({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>nt(et({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),Nt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Qi(e=>ci(null)),jt(1))}handleVariantOrProductItems(){let s=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(s);this.fetchVariantOrProductItems(e,r).pipe(Nt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(Bo(100),_o(s=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(s.Filter)}),jt(1)),uo([this.chartData$,this.pageSetupService.menu$]).pipe(oi(([s,e])=>({chartData:s,menu:nt(et({},e),{H:s.FullPageTitle,T:e.T.replace("undefined",s.FullPageTitle)})})),Nt(({chartData:s,menu:e})=>{this.menu$=ci(e),this.seriesData.set(s.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(s){let e=document.cookie.match(new RegExp("(?:^|; )"+s.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){Cn(this.seriesData,{injector:this.injector}).pipe(ri(s=>!!s),nn(),Nt(s=>Bi.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Bi.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(s.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:s.Series.map((e,r)=>nt(et({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){uo([this.loader$]).pipe(oi(([s])=>({loader:s})),_o(({loader:s})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=nt(et({},s),{Filter:nt(et({},s.Filter),{From:e?e.from:s.Filter.From,To:e?e.to:s.Filter.To})});return this.matDialog.open(po,{data:{pageData:r}}).afterClosed()}),Nt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(w(We),w(k),w(N),w(z),w(qe),w(Ko),w(Qo),w(on),w(_n))};static \u0275cmp=B({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),d(1,"async"),pt(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),b(5,"i",5)(6,"i",6),a()(),mt(),pt(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),mt(),pt(30,12),E(31,ET,0,0,"ng-template",null,0,O),mt(),n(33,"content"),b(34,"div",13),a()()}e&2&&(c("pageData",g(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),c("routerLink",M(11,wT)),o(3),c("routerLink",M(12,TT)),o(3),c("routerLink",M(13,PT)),o(3),c("routerLink",M(14,FT)),o(3),c("routerLink",M(15,IT)),o(3),c("routerLink",M(16,bT)))},dependencies:[Si,Ui,Q,Ii,A,Ei,At,Uo],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var MT=[{path:"Sales_Report/Standard/Detail",component:Hn},{path:"Sales_Report/Standard/Summary",component:Yn},{path:"Sales_Report/Standard/Top_Brand",component:jn},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:$a},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:Ua},{path:"Sales_Report/Standard/Top_Customers",component:Un},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:lo},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:zn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Kn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Xn},{path:"Sales_Report/Standard/Top_Customers/City",component:La},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:Ra},{path:"Sales_Report/Standard/Products_Sold",component:Jn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:mo},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:ro},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Zn},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:$n},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:ea},{path:"Sales_Report/Standard/Category_Sold",component:io},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:ta},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:ia},{path:"Sales_Report/Standard/Category_Sold/Category",component:na},{path:"Sales_Report/Standard/Peak",component:aa},{path:"Sales_Report/Standard/Peak/Peak",component:ra},{path:"Sales_Report/Standard/Daily",component:la},{path:"Sales_Report/Standard/Daily/Daily_Table",component:ca},{path:"Sales_Report/Standard/Monthly",component:ma},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:da},{path:"Sales_Report/Standard/Yearly",component:to},{path:"Sales_Report/Standard/Yearly/Comparison",component:sa},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:ua},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:_a},{path:"Sales_Report/Standard/Outlet_Performance",component:Ca},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:ga},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:fa},{path:"Sales_Report/Standard/Sales_Order_Tag",component:za},{path:"Sales_Report/Standard/Person",component:ha},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:ao},{path:"Sales_Report/Standard/Person/Commission_Report",component:Sa},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:ya},{path:"Sales_Report/Standard/Person/Sales_Group",component:ka},{path:"Sales_Report/Standard/Discounted_Sales",component:no},{path:"Purchases_Report/Detail",component:Da},{path:"Purchases_Report/Summary",component:va},{path:"Purchases_Report/Supplier",component:wa},{path:"Purchases_Report/Product",component:Ta},{path:"Purchases_Report/History",component:Fa},{path:"Purchases_Report/Daily",component:Ia},{path:"Purchases_Report/Daily/Monthly",component:ba},{path:"Purchases_Report/Volume",component:Ea},{path:"Purchases_Report/Sales",component:Ma},{path:"Purchases_Report/Tax",component:Za},{path:"Purchases_Report/Outlet",component:Va},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:Ba},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:Oa},{path:"Sales_Report/Standard/Compare",component:eo},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:xa},{path:"Sales_Report/Advanced/Tax_Report",component:Wa},{path:"Sales_Report/Advanced/Visitor",component:oa},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Na},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Aa},{path:"Sales_Report/Advanced/Product_Profit",component:Ga},{path:"Sales_Report/Advanced/Exchanged_Sales",component:Ha},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Qa},{path:"Sales_Report/Advanced/Logistics_Service",component:Hr},{path:"Return/Sales_Return",component:Ya},{path:"Return/Purchase_Return",component:ja},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:qa},{path:"Sales_Report/Standard/Price_Analysis",component:Ja},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],so=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ui({type:i});static \u0275inj=di({imports:[Ui.forChild(MT),Ui]})};var Pl=`
12
12
  .p-toggleswitch {
13
13
  display: inline-block;
14
14
  width: dt('toggleswitch.width');
@@ -122,10 +122,10 @@ import{a as ri,b as Gr}from"./chunk-RNXOIUIO.js";import{a as Yr}from"./chunk-ZSW
122
122
  .p-toggleswitch.p-disabled .p-toggleswitch-handle {
123
123
  background: dt('toggleswitch.handle.disabled.background');
124
124
  }
125
- `;var NT=["handle"],AT=["input"],GT=i=>({checked:i});function HT(i,s){i&1&&Ho(0)}function QT(i,s){if(i&1&&E(0,HT,1,0,"ng-container",3),i&2){let e=m();c("ngTemplateOutlet",e.handleTemplate||e._handleTemplate)("ngTemplateOutletContext",X(2,GT,e.checked()))}}var YT=`
126
- ${Il}
125
+ `;var VT=["handle"],BT=["input"],OT=i=>({checked:i});function LT(i,s){i&1&&Wo(0)}function RT(i,s){if(i&1&&E(0,LT,1,0,"ng-container",3),i&2){let e=m();c("ngTemplateOutlet",e.handleTemplate||e._handleTemplate)("ngTemplateOutletContext",X(2,OT,e.checked()))}}var kT=`
126
+ ${Pl}
127
127
 
128
128
  p-toggleswitch.ng-invalid.ng-dirty > .p-toggleswitch-slider {
129
129
  border-color: dt('toggleswitch.invalid.border.color');
130
130
  }
131
- `,jT={root:{position:"relative"}},qT={root:({instance:i})=>["p-toggleswitch p-component",{"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.$disabled(),"p-invalid":i.invalid()}],input:"p-toggleswitch-input",slider:"p-toggleswitch-slider",handle:"p-toggleswitch-handle"},bl=(()=>{class i extends ar{name="toggleswitch";style=YT;classes=qT;inlineStyles=jT;static \u0275fac=(()=>{let e;return function(t){return(e||(e=fo(i)))(t||i)}})();static \u0275prov=on({token:i,factory:i.\u0275fac})}return i})();var El=new $t("TOGGLESWITCH_INSTANCE"),UT={provide:$o,useExisting:ko(()=>Ml),multi:!0},Ml=(()=>{class i extends lr{$pcToggleSwitch=Fe(El,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=Fe(Xi,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}styleClass;tabindex;inputId;readonly;trueValue=!0;falseValue=!1;ariaLabel;size=Di();ariaLabelledBy;autofocus;onChange=new pn;input;handleTemplate;_handleTemplate;focused=!1;_componentStyle=Fe(bl);templates;onHostClick(e){this.onClick(e)}onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"handle":this._handleTemplate=e.template;break;default:this._handleTemplate=e.template;break}})}onClick(e){!this.$disabled()&&!this.readonly&&(this.writeModelValue(this.checked()?this.falseValue:this.trueValue),this.onModelChange(this.modelValue()),this.onChange.emit({originalEvent:e,checked:this.modelValue()}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}checked(){return this.modelValue()===this.trueValue}writeControlValue(e,r){r(e),this.cd.markForCheck()}static \u0275fac=(()=>{let e;return function(t){return(e||(e=fo(i)))(t||i)}})();static \u0275cmp=B({type:i,selectors:[["p-toggleswitch"],["p-toggleSwitch"],["p-toggle-switch"]],contentQueries:function(r,t,l){if(r&1&&(xo(l,NT,4),xo(l,hn,4)),r&2){let C;fi(C=xi())&&(t.handleTemplate=C.first),fi(C=xi())&&(t.templates=C)}},viewQuery:function(r,t){if(r&1&&cn(AT,5),r&2){let l;fi(l=xi())&&(t.input=l.first)}},hostVars:5,hostBindings:function(r,t){r&1&&P("click",function(C){return t.onHostClick(C)}),r&2&&(si("data-pc-name","toggleswitch"),Qo(t.sx("root")),Ui(t.cn(t.cx("root"),t.styleClass)))},inputs:{styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",zo],inputId:"inputId",readonly:[2,"readonly","readonly",ho],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",size:[1,"size"],ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",ho]},outputs:{onChange:"onChange"},features:[hi([UT,bl,{provide:El,useExisting:i},{provide:or,useExisting:i}]),sn([Xi]),W],decls:5,vars:20,consts:[["input",""],["type","checkbox","role","switch",3,"focus","blur","checked","pAutoFocus","pBind"],[3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,t){if(r&1){let l=I();n(0,"input",1,0),P("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a(),n(2,"div",2)(3,"div",2),S(4,QT,1,4,"ng-container"),a()()}r&2&&(Ui(t.cx("input")),c("checked",t.checked())("pAutoFocus",t.autofocus)("pBind",t.ptm("input")),si("id",t.inputId)("required",t.required()?"":void 0)("disabled",t.$disabled()?"":void 0)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name())("tabindex",t.tabindex),o(2),Ui(t.cx("slider")),c("pBind",t.ptm("slider")),o(),Ui(t.cx("handle")),c("pBind",t.ptm("handle")),o(),y(t.handleTemplate||t._handleTemplate?4:-1))},dependencies:[vi,Xo,rr,Sn,pr,Xi],encapsulation:2,changeDetection:0})}return i})(),Vl=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Ci({type:i});static \u0275inj=gi({imports:[Ml,Sn,Sn]})}return i})();var Bl=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Ci({type:i});static \u0275inj=gi({providers:[re],imports:[bi,yr,vi,uo,$,Mi,Gt,fn,wi,En,ur,Ti,dr,_r,yn,gr,Cr,$,sr,cr,fr,On,Nn,Gr,Hr,Wn,Pr,Qr,K,Vi,ci,Lr,ci,fe,U,vr,ze,oi,Vl,Dr,Za,Bi,Ni,Tr,br]})};export{Bl as ReportsModule};
131
+ `,WT={root:{position:"relative"}},NT={root:({instance:i})=>["p-toggleswitch p-component",{"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.$disabled(),"p-invalid":i.invalid()}],input:"p-toggleswitch-input",slider:"p-toggleswitch-slider",handle:"p-toggleswitch-handle"},Fl=(()=>{class i extends tr{name="toggleswitch";style=kT;classes=NT;inlineStyles=WT;static \u0275fac=(()=>{let e;return function(t){return(e||(e=go(i)))(t||i)}})();static \u0275prov=an({token:i,factory:i.\u0275fac})}return i})();var Il=new Zt("TOGGLESWITCH_INSTANCE"),AT={provide:Xo,useExisting:Oo(()=>bl),multi:!0},bl=(()=>{class i extends ar{$pcToggleSwitch=Pe(Il,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=Pe(Ki,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}styleClass;tabindex;inputId;readonly;trueValue=!0;falseValue=!1;ariaLabel;size=hi();ariaLabelledBy;autofocus;onChange=new ln;input;handleTemplate;_handleTemplate;focused=!1;_componentStyle=Pe(Fl);templates;onHostClick(e){this.onClick(e)}onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"handle":this._handleTemplate=e.template;break;default:this._handleTemplate=e.template;break}})}onClick(e){!this.$disabled()&&!this.readonly&&(this.writeModelValue(this.checked()?this.falseValue:this.trueValue),this.onModelChange(this.modelValue()),this.onChange.emit({originalEvent:e,checked:this.modelValue()}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}checked(){return this.modelValue()===this.trueValue}writeControlValue(e,r){r(e),this.cd.markForCheck()}static \u0275fac=(()=>{let e;return function(t){return(e||(e=go(i)))(t||i)}})();static \u0275cmp=B({type:i,selectors:[["p-toggleswitch"],["p-toggleSwitch"],["p-toggle-switch"]],contentQueries:function(r,t,l){if(r&1&&(Co(l,VT,4),Co(l,fn,4)),r&2){let C;_i(C=gi())&&(t.handleTemplate=C.first),_i(C=gi())&&(t.templates=C)}},viewQuery:function(r,t){if(r&1&&sn(BT,5),r&2){let l;_i(l=gi())&&(t.input=l.first)}},hostVars:5,hostBindings:function(r,t){r&1&&P("click",function(C){return t.onHostClick(C)}),r&2&&(li("data-pc-name","toggleswitch"),No(t.sx("root")),qi(t.cn(t.cx("root"),t.styleClass)))},inputs:{styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",Yo],inputId:"inputId",readonly:[2,"readonly","readonly",fo],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",size:[1,"size"],ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",fo]},outputs:{onChange:"onChange"},features:[Ci([AT,Fl,{provide:Il,useExisting:i},{provide:ir,useExisting:i}]),mn([Ki]),W],decls:5,vars:20,consts:[["input",""],["type","checkbox","role","switch",3,"focus","blur","checked","pAutoFocus","pBind"],[3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,t){if(r&1){let l=I();n(0,"input",1,0),P("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a(),n(2,"div",2)(3,"div",2),S(4,RT,1,4,"ng-container"),a()()}r&2&&(qi(t.cx("input")),c("checked",t.checked())("pAutoFocus",t.autofocus)("pBind",t.ptm("input")),li("id",t.inputId)("required",t.required()?"":void 0)("disabled",t.$disabled()?"":void 0)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name())("tabindex",t.tabindex),o(2),qi(t.cx("slider")),c("pBind",t.ptm("slider")),o(),qi(t.cx("handle")),c("pBind",t.ptm("handle")),o(),y(t.handleTemplate||t._handleTemplate?4:-1))},dependencies:[Si,qo,nr,xn,or,Ki],encapsulation:2,changeDetection:0})}return i})(),El=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=ui({type:i});static \u0275inj=di({imports:[bl,xn,xn]})}return i})();var Ml=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ui({type:i});static \u0275inj=di({providers:[oe],imports:[Ii,xr,Si,so,$,Ei,At,gn,yi,In,sr,Di,mr,cr,hn,dr,ur,$,lr,pr,_r,Bn,Wn,Nr,Ar,kn,vr,Gr,K,Mi,pi,Vr,pi,Ce,U,Sr,ze,ti,El,hr,Xa,Vi,Wi,Dr,Pr]})};export{Ml as ReportsModule};