dealpos 26.12.3 → 26.13.1

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 (216) hide show
  1. package/browser/{chunk-CAIHCBNV.js → chunk-24Y2K7K4.js} +1 -1
  2. package/browser/{chunk-YWAAVL5W.js → chunk-2OZQZYOP.js} +1 -1
  3. package/browser/chunk-2P5MBIQF.js +1 -0
  4. package/browser/{chunk-YNN6O35C.js → chunk-2TTBB5BU.js} +1 -1
  5. package/browser/{chunk-F66YPL2H.js → chunk-352QJGQF.js} +1 -1
  6. package/browser/{chunk-333D3A3T.js → chunk-3CVEITNL.js} +2 -2
  7. package/browser/{chunk-2HW6GBWT.js → chunk-4S3UISXS.js} +3 -3
  8. package/browser/chunk-4SLZF44V.js +1 -0
  9. package/browser/chunk-4TO3QVDD.js +1 -0
  10. package/browser/{chunk-EBOKFOYU.js → chunk-4VQ6MXVC.js} +1 -1
  11. package/browser/{chunk-FXBLX3BN.js → chunk-4WAHADHP.js} +1 -1
  12. package/browser/chunk-4XVMMORY.js +1 -0
  13. package/browser/chunk-56XGQIOG.js +1 -0
  14. package/browser/{chunk-IQCJNOY2.js → chunk-5DHP2OZI.js} +2 -2
  15. package/browser/chunk-5OJRC6OM.js +1 -0
  16. package/browser/chunk-5T4QGO34.js +1 -1
  17. package/browser/{chunk-AQTXP2ZS.js → chunk-5WCEBC3I.js} +1 -1
  18. package/browser/chunk-6344D64Q.js +1 -1
  19. package/browser/chunk-64B36JL7.js +1 -1
  20. package/browser/chunk-65SJSV5B.js +1 -0
  21. package/browser/chunk-6CP7UIMQ.js +1 -1
  22. package/browser/{chunk-4ZDCYADT.js → chunk-6LUN425R.js} +1 -1
  23. package/browser/chunk-6PFQZUFE.js +4 -0
  24. package/browser/{chunk-235H46SC.js → chunk-6R334P6I.js} +1 -1
  25. package/browser/chunk-6X6UVFTU.js +1 -1
  26. package/browser/chunk-7G4G3EXO.js +1 -1
  27. package/browser/chunk-7GXSBWLU.js +1 -0
  28. package/browser/{chunk-YJBMNJKV.js → chunk-7T2FWNWR.js} +2 -2
  29. package/browser/chunk-7VIM5TWU.js +1 -0
  30. package/browser/chunk-7XHYWG7A.js +1 -0
  31. package/browser/{chunk-E2SXI3RR.js → chunk-A64HOXAN.js} +1 -1
  32. package/browser/chunk-AAXHA3ZZ.js +1 -1
  33. package/browser/chunk-ACSURBCB.js +1 -1
  34. package/browser/chunk-AD4Y2ZRA.js +1 -0
  35. package/browser/{chunk-ZPIO26WT.js → chunk-ADEIZ5VI.js} +1 -1
  36. package/browser/chunk-ANISRDEI.js +149 -0
  37. package/browser/chunk-AYDAK7L4.js +1 -0
  38. package/browser/{chunk-Q3IG4BKG.js → chunk-B6E6ZO24.js} +1 -1
  39. package/browser/{chunk-JPEWEWUZ.js → chunk-B7UE3WB3.js} +1 -1
  40. package/browser/{chunk-ZBY2NCQ5.js → chunk-BB2DOMM2.js} +1 -1
  41. package/browser/chunk-BIZEPM2U.js +1 -1
  42. package/browser/chunk-BJKDKDPY.js +1 -0
  43. package/browser/chunk-BLSG6YK7.js +1 -0
  44. package/browser/{chunk-YAQ7HN62.js → chunk-C6EUPRLD.js} +1 -1
  45. package/browser/{chunk-AMT6MYPE.js → chunk-CNRUDXQR.js} +1 -1
  46. package/browser/{chunk-HSRFFLOA.js → chunk-CSSHW7GG.js} +1 -1
  47. package/browser/chunk-CTP6QQZM.js +1 -0
  48. package/browser/chunk-DAVBQ2SY.js +1 -0
  49. package/browser/chunk-DQGWDGL6.js +1 -1
  50. package/browser/{chunk-EYLLUPWY.js → chunk-EQ5GVHN7.js} +1 -1
  51. package/browser/chunk-EYCKSDX7.js +1 -0
  52. package/browser/chunk-F2CXQF62.js +1 -1
  53. package/browser/chunk-FFAEF63R.js +9 -0
  54. package/browser/chunk-FSKVW7SD.js +1 -0
  55. package/browser/{chunk-H33UAJNQ.js → chunk-FYDWLEL6.js} +1 -1
  56. package/browser/{chunk-DI6O34LC.js → chunk-FZZZG6IR.js} +1 -1
  57. package/browser/{chunk-U3SEFXFE.js → chunk-G2I3BPT4.js} +1 -1
  58. package/browser/{chunk-YUN7ZFJX.js → chunk-GG2PUBDA.js} +1 -1
  59. package/browser/{chunk-O22T2MUP.js → chunk-GGV5VB6F.js} +1 -1
  60. package/browser/chunk-GMKCQXEM.js +1 -0
  61. package/browser/chunk-GPQD2PY3.js +4 -0
  62. package/browser/chunk-GWUIRQ42.js +1 -0
  63. package/browser/chunk-GZZJ2KF5.js +1 -0
  64. package/browser/{chunk-DRJTE7NS.js → chunk-H4KXYKGD.js} +1 -1
  65. package/browser/chunk-HBTFL7TN.js +1 -0
  66. package/browser/chunk-HQQZZQUW.js +1 -0
  67. package/browser/chunk-HQWMPP7N.js +1 -1
  68. package/browser/chunk-I2IET7HI.js +1 -1
  69. package/browser/chunk-I3BWRIIL.js +1 -0
  70. package/browser/{chunk-WX33PSXU.js → chunk-IEHSJWAD.js} +1 -1
  71. package/browser/chunk-II4WRSNG.js +1 -1
  72. package/browser/chunk-IQGAK4L6.js +1 -1
  73. package/browser/chunk-IQZIVQYD.js +1 -0
  74. package/browser/{chunk-3JWPRCRZ.js → chunk-JDZPL3KU.js} +1 -1
  75. package/browser/chunk-JFAUJMBJ.js +1 -0
  76. package/browser/chunk-JNATFPTX.js +1 -0
  77. package/browser/{chunk-HXG6PZYH.js → chunk-JX7TU3SH.js} +1 -1
  78. package/browser/{chunk-6XECXOQL.js → chunk-KJQCEAY2.js} +1 -1
  79. package/browser/{chunk-7UNJPSM2.js → chunk-KNWJMSJU.js} +1 -1
  80. package/browser/chunk-KT3EQE7A.js +1 -0
  81. package/browser/chunk-KUUVVDBL.js +1 -1
  82. package/browser/{chunk-LG6PCRTI.js → chunk-L3DZP263.js} +1 -1
  83. package/browser/{chunk-UP7I53TO.js → chunk-L5YCNYA2.js} +1 -1
  84. package/browser/chunk-LH5ORRMK.js +1 -0
  85. package/browser/chunk-LVDBJPVZ.js +28 -0
  86. package/browser/chunk-MD56QYUN.js +1 -0
  87. package/browser/chunk-MMIOVTIV.js +1 -1
  88. package/browser/chunk-MQI5FVOD.js +1 -0
  89. package/browser/chunk-MXXCZLFT.js +1 -0
  90. package/browser/{chunk-AXEDRWB7.js → chunk-NEDBMGEE.js} +1 -1
  91. package/browser/chunk-NELDNRRS.js +1 -1
  92. package/browser/{chunk-YPGYFTSY.js → chunk-NMV2UP7G.js} +2 -2
  93. package/browser/{chunk-QZMWGVUE.js → chunk-NNXT3U7A.js} +1 -1
  94. package/browser/{chunk-MILJHWMZ.js → chunk-NZHQDHQR.js} +1 -1
  95. package/browser/chunk-O5ALNDM3.js +1 -1
  96. package/browser/chunk-OAYF5ZL3.js +1 -0
  97. package/browser/{chunk-COD2FOFZ.js → chunk-OB5TZKLB.js} +1 -1
  98. package/browser/{chunk-A2TCJSEQ.js → chunk-OJTX4WE7.js} +1 -1
  99. package/browser/{chunk-E3BPLA63.js → chunk-OZOJZZ7F.js} +4 -4
  100. package/browser/chunk-PAKEDI5F.js +1 -0
  101. package/browser/chunk-PDWB3BKO.js +1 -1
  102. package/browser/chunk-PGXNVUGQ.js +1 -1
  103. package/browser/{chunk-E5GILQOX.js → chunk-PMT7F3HV.js} +1 -1
  104. package/browser/{chunk-AARZF6LB.js → chunk-PW4NVFDN.js} +1 -1
  105. package/browser/chunk-PX7WSX67.js +1 -0
  106. package/browser/{chunk-NMZX3UAS.js → chunk-Q35RQNII.js} +4 -4
  107. package/browser/{chunk-VXD57PJW.js → chunk-Q3UK7KXA.js} +1 -1
  108. package/browser/chunk-QIU4DALL.js +1 -0
  109. package/browser/{chunk-RNIKYGQB.js → chunk-RGBBE5KH.js} +1 -1
  110. package/browser/chunk-RNC4JPI5.js +1 -0
  111. package/browser/{chunk-PFB6AB4J.js → chunk-S3R5BA6S.js} +2 -2
  112. package/browser/{chunk-YYHEROE6.js → chunk-S42ZE3AJ.js} +1 -1
  113. package/browser/{chunk-GRY3K2BE.js → chunk-SOTIBFLE.js} +1 -1
  114. package/browser/chunk-SVQELY2C.js +1 -0
  115. package/browser/{chunk-SPJ5EOQX.js → chunk-SZ5LTRZF.js} +1 -1
  116. package/browser/{chunk-HZAXI3KO.js → chunk-T35BG6KB.js} +1 -1
  117. package/browser/chunk-TS4BCNNG.js +1 -1
  118. package/browser/chunk-TWYEJPGQ.js +24 -0
  119. package/browser/{chunk-QOUSVJ3Y.js → chunk-UCN3DJ2E.js} +1 -1
  120. package/browser/{chunk-MFCDS575.js → chunk-UD4O5YZ4.js} +1 -1
  121. package/browser/chunk-UITAQDDZ.js +1 -0
  122. package/browser/chunk-US6LUSZG.js +1 -0
  123. package/browser/{chunk-MD7BOYRH.js → chunk-VFF44WVF.js} +1 -1
  124. package/browser/{chunk-2JF55OLP.js → chunk-VHP72BC3.js} +2 -2
  125. package/browser/{chunk-GJVEYPOG.js → chunk-VI67RJKM.js} +1 -1
  126. package/browser/{chunk-N7PNWDFM.js → chunk-VJMZ3HB7.js} +1 -1
  127. package/browser/chunk-VNWUBXCA.js +1 -0
  128. package/browser/chunk-VNWXTBSN.js +1 -0
  129. package/browser/{chunk-2TB4DWSF.js → chunk-VSVO3UAK.js} +1 -1
  130. package/browser/{chunk-BAIIWASY.js → chunk-WBKKG5B3.js} +9 -9
  131. package/browser/{chunk-34NY6CAC.js → chunk-WCSEG525.js} +1 -1
  132. package/browser/chunk-WD53MMKQ.js +1 -1
  133. package/browser/chunk-WEBZO46M.js +1 -0
  134. package/browser/chunk-WR3VFQS5.js +1 -1
  135. package/browser/chunk-WSBL32PC.js +1 -0
  136. package/browser/chunk-WX7P5INI.js +1 -0
  137. package/browser/chunk-X2HYZDJK.js +1 -0
  138. package/browser/chunk-X5VP2RMN.js +1 -0
  139. package/browser/{chunk-MIIB3ACP.js → chunk-XB3RXKJO.js} +1 -1
  140. package/browser/chunk-XHM3373K.js +1 -0
  141. package/browser/chunk-XOXPGG4Y.js +1 -1
  142. package/browser/{chunk-4O6HVKVE.js → chunk-XRGN77S6.js} +1 -1
  143. package/browser/chunk-Y57IIWQV.js +1 -1
  144. package/browser/chunk-Y5SDP5WS.js +1 -1
  145. package/browser/chunk-YFJCEIYN.js +1 -0
  146. package/browser/{chunk-2OOAFLWG.js → chunk-YJBQEOH5.js} +1 -1
  147. package/browser/{chunk-OO4PRLRJ.js → chunk-YJXKVHKE.js} +1 -1
  148. package/browser/chunk-YRNKIYM4.js +1 -0
  149. package/browser/{chunk-ZZOKMXLH.js → chunk-YT4CXYHK.js} +1 -1
  150. package/browser/{chunk-LEE7ZT44.js → chunk-YY5JT5ON.js} +1 -1
  151. package/browser/chunk-Z5NRX2FR.js +1 -0
  152. package/browser/{chunk-2XCPI5BA.js → chunk-ZGAIYTXM.js} +1 -1
  153. package/browser/{chunk-QLPTLBJ7.js → chunk-ZNHJSBKW.js} +1 -1
  154. package/browser/{chunk-SO4T7NZ5.js → chunk-ZNWQM4MP.js} +1 -1
  155. package/browser/{chunk-P3G47PAU.js → chunk-ZSZHL4H5.js} +1 -1
  156. package/browser/index.html +2 -2
  157. package/browser/{main-QCKQK6HC.js → main-K527HST4.js} +2 -2
  158. package/browser/{styles-J4GU5MZO.css → styles-X4W6FVF3.css} +1 -1
  159. package/package.json +1 -1
  160. package/browser/chunk-26XUUMVY.js +0 -1
  161. package/browser/chunk-2F3Z5UVP.js +0 -1
  162. package/browser/chunk-2MV4HJAQ.js +0 -1
  163. package/browser/chunk-32EIT4L7.js +0 -1
  164. package/browser/chunk-3CV2GAF3.js +0 -4
  165. package/browser/chunk-4XTPBEVJ.js +0 -1
  166. package/browser/chunk-4ZILSEIO.js +0 -1
  167. package/browser/chunk-5ZBFKXNC.js +0 -1
  168. package/browser/chunk-6KBEDAMW.js +0 -1
  169. package/browser/chunk-C3DQQRQ2.js +0 -1
  170. package/browser/chunk-CIWWM25R.js +0 -1
  171. package/browser/chunk-D2YW4MOW.js +0 -1
  172. package/browser/chunk-D67EMTMT.js +0 -1
  173. package/browser/chunk-DXLXJYRF.js +0 -8
  174. package/browser/chunk-DY42ZAIE.js +0 -1
  175. package/browser/chunk-E6A2RCBH.js +0 -1
  176. package/browser/chunk-EAPPQ75J.js +0 -1
  177. package/browser/chunk-EGZPBG6X.js +0 -1
  178. package/browser/chunk-FHOWMLGX.js +0 -1
  179. package/browser/chunk-FJNAUI6P.js +0 -1
  180. package/browser/chunk-GK743C7B.js +0 -24
  181. package/browser/chunk-HBIWQ5HQ.js +0 -1
  182. package/browser/chunk-HKEMKEUQ.js +0 -1
  183. package/browser/chunk-I6U65CYP.js +0 -1
  184. package/browser/chunk-IYOATZ3Q.js +0 -1
  185. package/browser/chunk-J5IPFKP4.js +0 -1
  186. package/browser/chunk-JLKSUWTD.js +0 -1
  187. package/browser/chunk-JMTLU7VX.js +0 -1
  188. package/browser/chunk-KIJEHC7Q.js +0 -1
  189. package/browser/chunk-KYORZNNN.js +0 -1
  190. package/browser/chunk-L3CQDLDO.js +0 -1
  191. package/browser/chunk-L677US7E.js +0 -1
  192. package/browser/chunk-M6DPR5GG.js +0 -1
  193. package/browser/chunk-MGOVDU5I.js +0 -1
  194. package/browser/chunk-P343WMVC.js +0 -1
  195. package/browser/chunk-PLDVH5EY.js +0 -1
  196. package/browser/chunk-Q3UN4JZJ.js +0 -1
  197. package/browser/chunk-QG4ZLB7N.js +0 -1
  198. package/browser/chunk-QTQKDVS3.js +0 -1
  199. package/browser/chunk-RQXB2SX3.js +0 -1
  200. package/browser/chunk-TDROH2E6.js +0 -1
  201. package/browser/chunk-TOUCJZBH.js +0 -1
  202. package/browser/chunk-TUMNDAML.js +0 -1
  203. package/browser/chunk-TUWWMIPL.js +0 -1
  204. package/browser/chunk-U232JTFQ.js +0 -1
  205. package/browser/chunk-UNLLLNH4.js +0 -1
  206. package/browser/chunk-UUS6BQMC.js +0 -1
  207. package/browser/chunk-UZXEKOES.js +0 -1
  208. package/browser/chunk-WRP5SNSH.js +0 -1
  209. package/browser/chunk-WUNLLRAA.js +0 -1
  210. package/browser/chunk-WXT6UMYF.js +0 -1
  211. package/browser/chunk-WZVFFBZM.js +0 -1
  212. package/browser/chunk-XIYFCT7T.js +0 -1
  213. package/browser/chunk-YTEPHUKY.js +0 -28
  214. package/browser/chunk-Z2I6VEVK.js +0 -1
  215. package/browser/chunk-ZA2KKEWR.js +0 -152
  216. package/browser/chunk-ZT7GHEZD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ti,b as fr}from"./chunk-2PDAUDPI.js";import{a as xr}from"./chunk-QZMWGVUE.js";import{a as hr}from"./chunk-VXD57PJW.js";import{a as Ft,b as Sr}from"./chunk-2P63LSN3.js";import{a as Lt}from"./chunk-72SBQH3S.js";import{b as yr}from"./chunk-YZP54ECO.js";import{a as wi}from"./chunk-JI2IJDXQ.js";import{a as ve}from"./chunk-HZAXI3KO.js";import{a as ze}from"./chunk-NRCV4GQO.js";import{a as bn}from"./chunk-LHAFSZF7.js";import{a as En,b as li}from"./chunk-AVOTGRPZ.js";import{a as st}from"./chunk-Y5WAQBUZ.js";import{a as Go}from"./chunk-3NFVXRWB.js";import{b as jo}from"./chunk-37PZPWZY.js";import"./chunk-TTZUIFLN.js";import{a as vi}from"./chunk-N7PNWDFM.js";import"./chunk-7GRHNPNY.js";import{a as ur,b as _r,d as Cr,g as gr}from"./chunk-MTMTZLMY.js";import{a as Di}from"./chunk-F5OC2EXS.js";import{a as or,b as rr}from"./chunk-UOCGL3EW.js";import"./chunk-DIAV4K3S.js";import"./chunk-2JPZMGCJ.js";import"./chunk-5GHN24QS.js";import{e as Qo}from"./chunk-EMLV5DDD.js";import{a as Ti}from"./chunk-3KHNPM76.js";import"./chunk-JEJGTRFJ.js";import{a as ei,b as ar,c as Fn,d as X}from"./chunk-6C7NKVRP.js";import{c as xn,d as fn,e as Sn,m as Ci}from"./chunk-6TWTQLKB.js";import{a as cn,b as un,c as _n,d as hn}from"./chunk-SASYAFMF.js";import{b as Dn,c as gi}from"./chunk-QP7B4347.js";import"./chunk-STYLBZL4.js";import"./chunk-XLS7AM5H.js";import{c as yn}from"./chunk-U7XVI26F.js";import{a as Z}from"./chunk-5WULCQQ4.js";import{c as Yo,d as we}from"./chunk-ALUJK3AI.js";import{a as ne}from"./chunk-PHNI4ZJ6.js";import"./chunk-B3U3BHLU.js";import{a as Zt}from"./chunk-JPEWEWUZ.js";import{b as le,c as ge,d as Ao}from"./chunk-C5SH4ACM.js";import{a as Pt,b as nr}from"./chunk-ZIWP67C5.js";import{b as $o,c as er,e as ce}from"./chunk-O22T2MUP.js";import{a as lr,b as pr,c as mr,e as sr,f as dr,g as cr}from"./chunk-DRJTE7NS.js";import"./chunk-OER3SUOJ.js";import"./chunk-EYLLUPWY.js";import"./chunk-ZFPL5GZZ.js";import"./chunk-X7XTDK26.js";import"./chunk-RRTVC6Y2.js";import{a as U}from"./chunk-HXG6PZYH.js";import{b as tr,c as ir}from"./chunk-3JWPRCRZ.js";import{b as z}from"./chunk-FZGFUOJQ.js";import"./chunk-UJPQDPFC.js";import{a as pe}from"./chunk-UP7I53TO.js";import{a as No}from"./chunk-OO4PRLRJ.js";import"./chunk-RHZ4SE3E.js";import{a as q}from"./chunk-E6MKUJD5.js";import{f as H,g as yi}from"./chunk-EBOKFOYU.js";import"./chunk-Z3I6U6KT.js";import"./chunk-235H46SC.js";import"./chunk-LSV7QXYU.js";import"./chunk-3GIDLGOV.js";import"./chunk-JJFV542H.js";import"./chunk-QGI3QC76.js";import{c as qo}from"./chunk-HB5JT7XV.js";import"./chunk-JBO3R4W5.js";import"./chunk-SFKCZ7DL.js";import"./chunk-PPNXP25T.js";import"./chunk-MHPH7T32.js";import"./chunk-UNAPWUZC.js";import"./chunk-35ECO23I.js";import"./chunk-G2UNSH3R.js";import{a as Ke}from"./chunk-VIKIXIX5.js";import"./chunk-IFLLAVLK.js";import{d as Zo}from"./chunk-ZA2KKEWR.js";import"./chunk-A3HVDWQA.js";import{a as G}from"./chunk-XIYFCT7T.js";import"./chunk-3GZUX2TV.js";import"./chunk-LWCDPG6P.js";import"./chunk-3TFWTYY2.js";import"./chunk-IOBYB6AV.js";import{b as wn,e as Ge,f as Pn}from"./chunk-YWAAVL5W.js";import{d as Cn,g as gn,n as Ho}from"./chunk-52KMSRYQ.js";import"./chunk-STIMAG44.js";import"./chunk-EKGQU5OA.js";import{a as ie,b as dn}from"./chunk-JFS6EFNT.js";import"./chunk-YNQPX5G6.js";import{A as Tn,B as Jo,C as $t,K as hi,N as Xo,g as me,o as Ko,s as vn,z as zo}from"./chunk-WZVFFBZM.js";import"./chunk-QU45SEX2.js";import"./chunk-QYSFCWV7.js";import{a as Si,b as Uo,d as $}from"./chunk-ZRBKLF75.js";import"./chunk-VBXYBASD.js";import{a as xi,b as fi,c as K}from"./chunk-CPHICIOL.js";import{b as mn}from"./chunk-GCPQTFRO.js";import"./chunk-NFVNHSX5.js";import"./chunk-Z6KYVNJQ.js";import"./chunk-4NWLXS6M.js";import"./chunk-OEFF3O4P.js";import"./chunk-ZLJTB3SO.js";import"./chunk-OG6UIE5Q.js";import"./chunk-LYYPWLC4.js";import{a as ki,b as sn,c as Xt}from"./chunk-N4STXFCX.js";import{va as Wo}from"./chunk-4CLMG36L.js";import{E as Gt,F as pn,b as Lo,c as Ye,h as k,l as Oo,o as W,q as Ro,s as ko}from"./chunk-DHBFOXIN.js";import"./chunk-YYHEROE6.js";import"./chunk-LG6PCRTI.js";import"./chunk-VFWU5XQ6.js";import{b as j}from"./chunk-WXT6UMYF.js";import{a as M}from"./chunk-3DEA4WWC.js";import"./chunk-RNIKYGQB.js";import{n as Ue,q as N}from"./chunk-2WBWJI4D.js";import{Ba as vo,Bb as C,Bc as en,Bd as Vo,Cc as I,Db as g,Dc as J,Eb as Bi,Ec as xe,F as ri,Fa as at,Fb as R,Fc as mt,Gb as V,Gc as Ut,Ha as Ui,Hb as B,Hc as tn,Ib as c,Ic as Fo,J as Mi,Jb as n,Kb as a,Kc as d,L as ho,La as To,Lb as E,Lc as x,Mc as v,N as yo,Nc as ui,Nd as Bo,Oa as wo,Pb as kt,Qb as Wt,Qc as A,R as Qi,Rd as Ae,Sa as be,Sc as bo,Tc as Oi,Td as ln,Ua as Ki,Ub as b,Ud as Q,Wd as Ri,Xb as P,Xc as nn,Yc as _i,Z as jt,Za as o,Zb as m,ad as an,ba as io,bc as Xi,cc as Zi,dc as $i,dd as Eo,eb as w,ga as Rt,hc as Jt,ib as O,ic as qt,jb as zi,jc as Li,kb as Ji,mb as Po,mc as p,md as $e,na as Do,nb as Y,nc as F,o as di,oa as ji,ob as L,oc as D,od as Io,pa as ci,pc as Nt,pd as on,ra as Me,rc as f,sc as S,sd as Mo,tc as h,u as oi,ud as oe,v as to,va as u,wa as _,wd as re,xb as Vi,xc as dt,za as qi,zd as rn}from"./chunk-2ERDZXCS.js";import"./chunk-WFMAM73Y.js";import{a as Xe,b as Ze,f as _l,h as At,k as si}from"./chunk-SNAKHGZS.js";var _o=_l((Wi,uo)=>{(function(i,s){typeof Wi=="object"&&typeof uo=="object"?uo.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 Wi=="object"?Wi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})("u"<typeof window?Wi:window,(i,s)=>(()=>{"use strict";var e={944:he=>{he.exports=i},984:he=>{he.exports=s}},r={};function t(he){var te=r[he];if(te!==void 0)return te.exports;var Oe=r[he]={exports:{}};return e[he](Oe,Oe.exports,t),Oe.exports}t.n=he=>{var te=he&&he.__esModule?()=>he.default:()=>he;return t.d(te,{a:te}),te},t.d=(he,te)=>{for(var Oe in te)t.o(te,Oe)&&!t.o(he,Oe)&&Object.defineProperty(he,Oe,{enumerable:!0,get:te[Oe]})},t.o=(he,te)=>Object.prototype.hasOwnProperty.call(he,te);var l={};t.d(l,{default:()=>ul});var y=t(944),T=t.n(y),je=t(984),vt=t.n(je);let ni={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 Ai(he,te,Oe,Ie,et,ee){let Be=(ee-te)*(Oe-he)-(Ie-te)*(et-he);return Be>0||!(Be<0)}function Gi(he,te,Oe,Ie,et,ee,Be,ke){return Ai(he,te,et,ee,Be,ke)!==Ai(Oe,Ie,et,ee,Be,ke)&&Ai(he,te,Oe,Ie,et,ee)!==Ai(he,te,Oe,Ie,Be,ke)}let{animObject:eo}=T(),{format:ol}=vt(),{setOptions:rl}=T(),{composed:ll}=T(),{boxIntersectLine:Co,intersectRect:pl}={boxIntersectLine:function(he,te,Oe,Ie,et,ee,Be,ke){return Gi(he,te,he+Oe,te,et,ee,Be,ke)||Gi(he+Oe,te,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te+Ie,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te,he,te+Ie,et,ee,Be,ke)},intersectRect:function(he,te){return!(te.left>he.right||te.right<he.left||te.top>he.bottom||te.bottom<he.top)}},{addEvent:go,extend:xo,fireEvent:ml,isNumber:Hi,pick:Kt,pushUnique:sl,syncTimeout:dl}=T();function pi(he,te,Oe,Ie,et){let ee=he.chart,Be=he.options.label||{},ke=Kt(Be.onArea,!!he.area),tt=ke||Be.connectorAllowed,ct=ee.boxesToAvoid,St=Number.MAX_VALUE,ut=Number.MAX_VALUE,Ct,ht,It,Tt,ot,rt,Le;for(rt=0;ct&&rt<ct.length;rt+=1)if(pl(ct[rt],{left:te,right:te+Ie.width,top:Oe,bottom:Oe+Ie.height}))return!1;for(rt=0;rt<ee.series.length;rt+=1){let ft=ee.series[rt],De=ft.interpolatedPoints&&[...ft.interpolatedPoints];if(ft.visible&&De){let lt=ee.plotHeight/10;for(let pt=ee.plotTop;pt<=ee.plotTop+ee.plotHeight;pt+=lt)De.unshift({chartX:ee.plotLeft,chartY:pt}),De.push({chartX:ee.plotLeft+ee.plotWidth,chartY:pt});for(Le=1;Le<De.length;Le+=1){if(De[Le].chartX>=te-16&&De[Le-1].chartX<=te+Ie.width+16){if(Co(te,Oe,Ie.width,Ie.height,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))return!1;he===ft&&!It&&et&&(It=Co(te-16,Oe-16,Ie.width+32,Ie.height+32,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))}(tt||It)&&(he!==ft||ke)&&(St=Math.min(St,(Tt=te+Ie.width/2-De[Le].chartX)*Tt+(ot=Oe+Ie.height/2-De[Le].chartY)*ot))}if(!ke&&tt&&he===ft&&(et&&!It||St<Math.pow(Be.connectorNeighbourDistance||1,2))){for(Le=1;Le<De.length;Le+=1)(Ct=Math.min(Math.pow(te+Ie.width/2-De[Le].chartX,2)+Math.pow(Oe+Ie.height/2-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2)))<ut&&(ut=Ct,ht=De[Le]);It=!0}}}return(!et||!!It)&&{x:te,y:Oe,weight:St-(ht?ut:0),connectorPoint:ht}}function fo(he){if(this.renderer){let te=this,Oe=eo(te.renderer.globalAnimation).duration;te.labelSeries=[],te.labelSeriesMaxSum=0,te.seriesLabelTimer&&T().clearTimeout(te.seriesLabelTimer),te.series.forEach(function(Ie){let et=Ie.options.label||{},ee=Ie.labelBySeries,Be=ee&&ee.closest,ke=Ie.getColumn("y");et.enabled&&Ie.visible&&(Ie.graph||Ie.area)&&!Ie.boosted&&te.labelSeries&&(te.labelSeries.push(Ie),et.minFontSize&&et.maxFontSize&&ke.length&&(Ie.sum=ke.reduce((tt,ct)=>(tt||0)+(ct||0),0),te.labelSeriesMaxSum=Math.max(te.labelSeriesMaxSum||0,Ie.sum||0)),he.type==="load"&&(Oe=Math.max(Oe,eo(Ie.options.animation).duration)),Be&&(Be[0].plotX!==void 0?ee.animate({x:Be[0].plotX+Be[1],y:Be[0].plotY+Be[2]}):ee.attr({opacity:0})))}),te.seriesLabelTimer=dl(function(){let Ie,et;te.series&&te.labelSeries&&(te.boxesToAvoid=[],Ie=te.labelSeries||[],et=te.boxesToAvoid,te.series.forEach(ee=>(ee.points||[]).forEach(Be=>(Be.dataLabels||[]).forEach(ke=>{let{width:tt,height:ct}=ke.getBBox(),St=(ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),ut=(ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);et.push({left:St,top:ut,right:St+tt,bottom:ut+ct})}))),Ie.forEach(function(ee){let Be=ee.options.label||{};ee.interpolatedPoints=(function(ke){let tt,ct,St,ut,Ct;if(!ke.xAxis&&!ke.yAxis)return;let ht=ke.points,It=[],Tt=ke.graph||ke.area,ot=Tt&&Tt.element,rt=ke.chart.inverted,Le=ke.xAxis,ft=ke.yAxis,De=rt?ft.pos:Le.pos,lt=rt?Le.pos:ft.pos,pt=rt?Le.len:ft.len,Ii=rt?ft.len:Le.len,_t=Kt((ke.options.label||{}).onArea,!!ke.area),qe=ft.getThreshold(ke.options.threshold),yt={},zt=rt?"chartCenterX":"chartCenterY";function ai(it){let gt=Math.round((it.plotX||0)/8)+","+Math.round((it.plotY||0)/8);yt[gt]||(yt[gt]=1,It.push(it))}if(ke.getPointSpline&&ot&&ot.getPointAtLength&&!_t&&ht.length<(ke.chart.plotSizeX||0)/16){let it=Tt.toD&&Tt.attr("d");for(Tt.toD&&Tt.attr({d:Tt.toD}),St=ot.getTotalLength(),tt=0;tt<St;tt+=16){let Mt=ot.getPointAtLength(tt),Vt=rt?Ii-Mt.y:Mt.x,Bt=rt?pt-Mt.x:Mt.y;ai({chartX:De+Vt,chartY:lt+Bt,plotX:Vt,plotY:Bt})}it&&Tt.attr({d:it});let gt=ht[ht.length-1].pos();ai({chartX:De+(gt?.[0]||0),chartY:lt+(gt?.[1]||0)})}else{let it;for(tt=0,St=ht.length;tt<St;tt+=1){let gt=ht[tt],[Mt,Vt]=gt.pos()||[],{plotHigh:Bt}=gt;if(Hi(Mt)&&Hi(Vt)){let wt={plotX:Mt,plotY:Vt,chartX:De+Mt,chartY:lt+Vt};if(_t&&(Bt&&(wt.plotY=Bt,wt.chartY=lt+Bt),rt?wt.chartCenterX=De+Ii-((Bt||gt.plotY||0)+Kt(gt.yBottom,qe))/2:wt.chartCenterY=lt+((Bt||Vt)+Kt(gt.yBottom,qe))/2),it&&(ct=Math.max(Math.abs(wt.chartX-it.chartX),Math.abs(wt.chartY-it.chartY)))>16&&ct<999)for(Ct=1,ut=Math.ceil(ct/16);Ct<ut;Ct+=1)ai({chartX:it.chartX+(wt.chartX-it.chartX)*(Ct/ut),chartY:it.chartY+(wt.chartY-it.chartY)*(Ct/ut),[zt]:(it[zt]||0)+((wt[zt]||0)-(it[zt]||0))*(Ct/ut),plotX:(it.plotX||0)+(Mt-(it.plotX||0))*(Ct/ut),plotY:(it.plotY||0)+(Vt-(it.plotY||0))*(Ct/ut)});ai(wt),it=wt}}}return It})(ee),et.push(...Be.boxesToAvoid||[])}),te.series.forEach(function(ee){let Be=ee.options.label;if(!Be||!ee.xAxis&&!ee.yAxis)return;let ke="highcharts-color-"+Kt(ee.colorIndex,"none"),tt=!ee.labelBySeries,ct=Be.minFontSize,St=Be.maxFontSize,ut=te.inverted,Ct=ut?ee.yAxis.pos:ee.xAxis.pos,ht=ut?ee.xAxis.pos:ee.yAxis.pos,It=te.inverted?ee.yAxis.len:ee.xAxis.len,Tt=te.inverted?ee.xAxis.len:ee.yAxis.len,ot=ee.interpolatedPoints,rt=Kt(Be.onArea,!!ee.area),Le=[],ft=ee.getColumn("x"),De,lt,pt,Ii,_t,qe,yt=ee.labelBySeries,zt,ai,it;function gt(Yt,Ot,Qt){let Yi=Math.max(Ct,Kt(ai,-1/0)),mi=Math.min(Ct+It,Kt(it,1/0));return Yt>Yi&&Yt<=mi-Qt.width&&Ot>=ht&&Ot<=ht+Tt-Qt.height}function Mt(){yt&&(ee.labelBySeries=yt.destroy())}if(rt&&!ut&&(zt=[ee.xAxis.toPixels(ft[0]),ee.xAxis.toPixels(ft[ft.length-1])],ai=Math.min.apply(Math,zt),it=Math.max.apply(Math,zt)),ee.visible&&!ee.boosted&&ot){if(!yt){var Vt,Bt,wt;let Yt=ee.name;if(typeof Be.format=="string"?Yt=ol(Be.format,ee,te):Be.formatter&&(Yt=Be.formatter.call(ee)),ee.labelBySeries=yt=te.renderer.label(Yt,0,0,"connector",0,0,Be.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+ke),!te.renderer.styledMode){let Ot=typeof ee.color=="string"?ee.color:"#666666";yt.css(xo({color:rt?te.renderer.getContrast(Ot):Ot},Be.style||{})),yt.attr({opacity:+!!te.renderer.forExport,stroke:ee.color,"stroke-width":1})}ct&&St&&yt.css({fontSize:(Vt=ee,Bt=ct,wt=St,Bt+(Vt.sum||0)/(Vt.chart.labelSeriesMaxSum||0)*(wt-Bt)+"px")}),yt.attr({padding:0,zIndex:3}).add()}for((De=yt.getBBox()).width=Math.round(De.width),_t=ot.length-1;_t>0;_t-=1)rt?gt(lt=(ot[_t].chartCenterX??ot[_t].chartX)-De.width/2,pt=(ot[_t].chartCenterY??ot[_t].chartY)-De.height/2,De)&&(qe=pi(ee,lt,pt,De)):(gt(lt=ot[_t].chartX+3,pt=ot[_t].chartY-De.height-3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX+3,pt=ot[_t].chartY+3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX-De.width-3,pt=ot[_t].chartY+3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX-De.width-3,pt=ot[_t].chartY-De.height-3,De)&&(qe=pi(ee,lt,pt,De,!0))),qe&&Le.push(qe);if(Be.connectorAllowed&&!Le.length&&!rt)for(lt=Ct+It-De.width;lt>=Ct;lt-=16)for(pt=ht;pt<ht+Tt-De.height;pt+=16)(Ii=pi(ee,lt,pt,De,!0))&&Le.push(Ii);if(Le.length){Le.sort((Ot,Qt)=>Qt.weight-Ot.weight),qe=Le[0],(te.boxesToAvoid||[]).push({left:qe.x,right:qe.x+De.width,top:qe.y,bottom:qe.y+De.height});let Yt=Math.sqrt(Math.pow(Math.abs(qe.x-(yt.x||0)),2)+Math.pow(Math.abs(qe.y-(yt.y||0)),2));if(Yt&&ee.labelBySeries){let Ot,Qt={opacity:+!!te.renderer.forExport,x:qe.x,y:qe.y},Yi={opacity:1};Yt<=10&&(Yi={x:Qt.x,y:Qt.y},Qt={}),tt&&(Ot=eo(ee.options.animation),Ot.duration*=.2),ee.labelBySeries.attr(xo(Qt,{anchorX:qe.connectorPoint&&(qe.connectorPoint.plotX||0)+Ct,anchorY:qe.connectorPoint&&(qe.connectorPoint.plotY||0)+ht})).animate(Yi,Ot),ee.options.kdNow=!0,ee.buildKDTree();let mi=ee.searchPoint({chartX:qe.x,chartY:qe.y},!0);mi&&(yt.closest=[mi,qe.x-(mi.plotX||0),qe.y-(mi.plotY||0)])}}else Mt()}else Mt()}),ml(te,"afterDrawSeriesLabels"))},te.renderer.forExport||!Oe?0:Oe)}}function cl(he,te,Oe,Ie,et){let ee=et&&et.anchorX,Be=et&&et.anchorY,ke,tt,ct=Oe/2;return Hi(ee)&&Hi(Be)&&(ke=[["M",ee,Be]],(tt=te-Be)<0&&(tt=-Ie-tt),tt<Oe&&(ct=ee<he+Oe/2?tt:Oe-tt),Be>te+Ie?ke.push(["L",he+ct,te+Ie]):Be<te?ke.push(["L",he+ct,te]):ee<he?ke.push(["L",he,te+Ie/2]):ee>he+Oe&&ke.push(["L",he+Oe,te+Ie/2])),ke||[]}let So=T();({compose:function(he,te){sl(ll,"SeriesLabel")&&(go(he,"load",fo),go(he,"redraw",fo),te.prototype.symbols.connector=cl,rl({plotOptions:{series:{label:ni}}}))}}).compose(So.Chart,So.SVGRenderer);let ul=T();return l.default})())});var gl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Dr=i=>({ID:i});function xl(i,s){if(i&1){let e=b();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function fl(i,s){if(i&1&&(n(0,"div",2),C(1,xl,3,0,"button",3),a()),i&2){let e=m();o(),g(e.roleService.global.Export?1:-1)}}function Sl(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),E(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(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 S(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 hl(i,s){i&1&&(n(0,"th",32),p(1,"@ Cost"),a())}function yl(i,s){i&1&&(n(0,"th",33),p(1,"@ Price"),a(),n(2,"th",30),p(3,"Disc."),a(),n(4,"th",33),p(5,"Total"),a())}function Dl(i,s){if(i&1&&(n(0,"small",40),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function vl(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 Tl(i,s){if(i&1&&(n(0,"span",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+x(2,1,e.Profit)," ")}}function wl(i,s){if(i&1&&(n(0,"i",43),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Pl(i,s){if(i&1&&(n(0,"span",44),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Fl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function bl(i,s){if(i&1&&(E(0,"div",45),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",x(1,1,e.SONote),be)}}function El(i,s){if(i&1&&(n(0,"div")(1,"a",51),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",J(2,Dr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Il(i,s){if(i&1&&(n(0,"div",46),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PaymentStateLabel," ")}}function Ml(i,s){if(i&1&&(n(0,"i",54),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Vl(i,s){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e==null?null:e.UnitCost)," ")}}function Bl(i,s){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),a(),n(3,"th",61)(4,"div",62),p(5),a(),n(6,"div",63),p(7),d(8,"amountFraction"),a()(),n(9,"th",60),p(10),d(11,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,4,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?"":x(8,6,e==null?null:e.DiscountAmount)," "),o(3),D(" ",x(11,8,e==null?null:e.Total)," ")}}function Ll(i,s){if(i&1&&(n(0,"tr",49)(1,"th",28)(2,"div",52)(3,"span",53),p(4),a(),C(5,Ml,2,1,"i",54),E(6,"small",55),a()(),n(7,"th",56),p(8),a(),n(9,"th",57),p(10),d(11,"quantityFraction"),a(),n(12,"th",58),p(13),a(),C(14,Vl,3,3,"th",59),C(15,Bl,12,10),a()),i&2){let e=s.$implicit,r=m(4);o(4),F(e==null?null:e.Name),o(),g((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,be),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",x(11,8,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),g(r.roleService.product.Cost?14:-1),o(),g(r.roleService.report.Price?15:-1)}}function Ol(i,s){if(i&1&&(n(0,"tr")(1,"th",64),p(2),a(),n(3,"th",65),p(4),a(),n(5,"th",66),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(" ",x(7,3,e.Amount)," ")}}function Rl(i,s){if(i&1&&(n(0,"table",50),V(1,Ol,8,5,"tr",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Aggregate)}}function kl(i,s){if(i&1&&(n(0,"div")(1,"div",35)(2,"div",36)(3,"div")(4,"a",37)(5,"span",38),p(6),a()(),n(7,"span"),p(8),d(9,"date"),E(10,"small",39),d(11,"date"),C(12,Dl,3,4,"small",40),a()(),n(13,"div",41)(14,"strong",42),p(15),C(16,vl,3,4,"span"),a(),C(17,Tl,3,3,"span",40),C(18,wl,2,1,"i",43),C(19,Pl,2,1,"span",44),C(20,Fl,2,0,"span"),a(),C(21,bl,2,3,"div",45),C(22,El,3,4,"div"),a(),C(23,Il,2,1,"div",46),a(),n(24,"table",47)(25,"tbody",48),V(26,Ll,16,10,"tr",49,R),a()(),C(28,Rl,3,0,"table",50),a()),i&2){let e=s.$implicit,r=m(3);o(4),c("routerLink",I(22,gl))("queryParams",J(23,Dr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,16,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,19,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",be),o(2),g(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),g(r.isNotEmpty(e.SalesName)?16:-1),o(),g(r.roleService.report.Profit&&r.roleService.report.Price&&r.roleService.product.Cost?17:-1),o(),g(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),g(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),g(e.SONote&&e.PromotionCoupon?20:-1),o(),g(r.isNotEmpty(e.SONote)?21:-1),o(),g(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(),g(r.roleService.report.Price?23:-1),o(3),B(e.Items),o(2),g(r.roleService.report.Price?28:-1)}}function Wl(i,s){if(i&1&&(n(0,"tr")(1,"td",34),V(2,kl,29,25,"div",null,R),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7),o(),B(e.infiniteList)}}function Nl(i,s){if(i&1&&(n(0,"tr")(1,"td"),E(2,"app-empty-state"),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7)}}function Al(i,s){if(i&1){let e=b();n(0,"span",73),P("click",function(){u(e);let t=m(3);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function Gl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),F(x(2,1,e.listTotal))}}function Hl(i,s){if(i&1){let e=b();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(3);return t.currentRowCount=100,_(t.NextPage(!0))}),E(2,"i",76),p(3," Next 100"),a()()}}function Yl(i,s){if(i&1){let e=b();n(0,"div",67)(1,"button",68),P("click",function(){u(e);let t=m(2);return _(t.showSummaryReport())}),p(2," View Report Summary "),a()(),n(3,"div",69)(4,"div",70)(5,"div",71),p(6),d(7,"number"),C(8,Al,3,0,"span",72),C(9,Gl,3,3,"span"),p(10),a()(),C(11,Hl,4,0,"div",2),a()}if(i&2){let e=m(2);o(6),D(" Showing 1 - ",x(7,5,e.infiniteList.length)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),g(e.nextPageDisabled?11:-1)}}function Ql(i,s){if(i&1&&(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(),C(14,hl,2,0,"th",32),C(15,yl,6,0),a()(),n(16,"tbody"),C(17,Wl,4,1,"tr")(18,Nl,3,1,"tr"),a()()(),C(19,Yl,12,7),a()()),i&2){let e=m();o(14),g(e.roleService.product.Cost?14:-1),o(),g(e.roleService.report.Price?15:-1),o(2),g(e.infiniteList.length>0?17:18),o(2),g((e.infiniteList==null?null:e.infiniteList.length)>0?19:-1)}}var In=class i extends ve{constructor(e,r,t,l,y,T,je,vt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,y);this.csvConverter=t;this.datePipe=l;this.activatedRoute=y;this.matDialog=T;this.toaster=je;this.roleService=vt}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,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.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 M.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(y=>y):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(z,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(xr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(Ae),w(K),w(Ue),w(j))};static \u0275cmp=O({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[Y],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,"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%"],[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"],[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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,fl,2,1,"div",2),a(),n(3,"filters"),L(4,Sl,46,26,"ng-template",null,0,A),a(),C(6,Ql,20,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,U,ze,Ti,Ko,vn,re,oe,Z,ne],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 Mn=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 sn;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(xi),w(fi))};static \u0275cmp=O({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 S(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 S(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:[Ye,k,W,Ke,Xt],encapsulation:2})};var Ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vr=i=>({ID:i}),Kl=()=>["/menu/Contacts/Contact/Customers/Info"],zl=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function Jl(i,s){if(i&1){let e=b();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",4),p(2," Export "),a()}}function Xl(i,s){if(i&1){let e=b();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 S(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",7),h("ngModelChange",function(t){u(e);let l=m();return S(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",8),h("ngModelChange",function(t){u(e);let l=m();return S(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",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),kt(18),n(19,"div",11)(20,"div",12)(21,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",14)(23,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",16)(25,"div",12)(26,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(27,"div",14)(28,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),Wt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",22),h("ngModelChange",function(t){u(e);let l=m();return S(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.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Zl(i,s){i&1&&(n(0,"th",36),p(1,"DATE"),a())}function $l(i,s){i&1&&(n(0,"th",37),p(1," CUSTOMER "),a())}function ep(i,s){i&1&&(n(0,"th",38),p(1,"JOIN DATE"),a())}function tp(i,s){i&1&&(n(0,"th",39),p(1,"GROUPS"),a())}function ip(i,s){i&1&&(n(0,"th",40),p(1," SALES PERSON "),a())}function np(i,s){i&1&&(n(0,"th",41),p(1," COST "),a())}function ap(i,s){i&1&&(n(0,"th",44),p(1," GROSS "),a())}function op(i,s){i&1&&(n(0,"th",45),p(1," SALES "),a())}function rp(i,s){i&1&&(n(0,"th",46),p(1," TAX "),a())}function lp(i,s){i&1&&(n(0,"th",47),p(1," SURCHARGE "),a())}function pp(i,s){i&1&&(n(0,"th",48),p(1," TOTAL "),a())}function mp(i,s){if(i&1&&(C(0,ap,2,0,"th",44),C(1,op,2,0,"th",45),C(2,rp,2,0,"th",46),C(3,lp,2,0,"th",47),C(4,pp,2,0,"th",48)),i&2){let e=m(3);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function sp(i,s){i&1&&(n(0,"th",42),p(1," PAYMENT "),a())}function dp(i,s){i&1&&E(0,"br")}function cp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function up(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 _p(i,s){if(i&1&&(n(0,"td")(1,"a",52),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",I(3,Kl))("queryParams",J(4,vr,e.CustomerID)),o(),F(e.CustomerName)}}function Cp(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 gp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function xp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function fp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function Sp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function hp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function yp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Dp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SurchargeAmount)," ")}}function vp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SalesNSurcharge)," ")}}function Tp(i,s){if(i&1&&(C(0,Sp,3,3,"td",53),C(1,hp,3,3,"td",53),C(2,yp,3,3,"td",54),C(3,Dp,3,3,"td",53),C(4,vp,3,3,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function wp(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;c("ngClass",mt(2,zl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Pp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",49),p(5),a(),C(6,dp,1,0,"br"),C(7,cp,2,1,"i"),a(),C(8,up,7,8,"td"),C(9,_p,3,6,"td"),C(10,Cp,3,4,"td"),C(11,gp,2,1,"td"),C(12,xp,2,1,"td"),C(13,fp,3,3,"td",50),C(14,Tp,5,5),C(15,wp,2,6,"td",51),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",I(14,Ul))("queryParams",J(15,vr,e.ID)),o(),D(" ",e.Number," "),o(),g(e.Note?6:-1),o(),g(e.Note?7:-1),o(),g(r.column.Date.selected?8:-1),o(),g(r.column.Customer.selected?9:-1),o(),g(r.column.JoinDate.selected?10:-1),o(),g(r.column.Groups.selected?11:-1),o(),g(r.column.SalesPerson.selected?12:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.role&&r.column.Cost.selected?13:-1),o(),g(r.roleService.report.Price?14:-1),o(),g(r.column.Payment.selected?15:-1)}}function Fp(i,s){i&1&&E(0,"td",56)}function bp(i,s){i&1&&E(0,"td",56)}function Ep(i,s){i&1&&E(0,"td",56)}function Ip(i,s){i&1&&(n(0,"td",57),p(1," Total: "),a())}function Mp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Vp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Bp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Lp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Op(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Rp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function kp(i,s){if(i&1&&(C(0,Ip,2,0,"td",57),C(1,Mp,4,6,"td",50),C(2,Vp,4,6,"td",53),C(3,Bp,4,6,"td",53),C(4,Lp,4,6,"td",54),C(5,Op,4,6,"td",53),C(6,Rp,4,6,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected?0:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?1:-1),o(),g(e.column.Gross.selected?2:-1),o(),g(e.column.Sales.selected?3:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?4:-1),o(),g(e.data.SurchargeVisible?5:-1),o(),g(e.column.Total.selected?6:-1)}}function Wp(i,s){if(i&1&&(n(0,"tfoot",43)(1,"tr",55),E(2,"td",56),C(3,Fp,1,0,"td",56),C(4,bp,1,0,"td",56),C(5,Ep,1,0,"td",56),C(6,kp,7,7),a()()),i&2){let e=m(3);o(3),g(e.column.Date.selected?3:-1),o(),g(e.column.Customer.selected?4:-1),o(),g(e.column.SalesPerson.selected?5:-1),o(),g(e.roleService.report.Price?6:-1)}}function Np(i,s){if(i&1){let e=b();n(0,"div",24)(1,"table",32),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",33)(3,"tr")(4,"th",34),p(5,"OUTLET"),a(),n(6,"th",35),p(7,"NUMBER"),a(),C(8,Zl,2,0,"th",36),C(9,$l,2,0,"th",37),C(10,ep,2,0,"th",38),C(11,tp,2,0,"th",39),C(12,ip,2,0,"th",40),C(13,np,2,0,"th",41),C(14,mp,5,5),C(15,sp,2,0,"th",42),a()(),n(16,"tbody"),V(17,Pp,16,17,"tr",null,R),a(),C(19,Wp,7,4,"tfoot",43),a()()}if(i&2){let e=m(2);o(8),g(e.column.Date.selected?8:-1),o(),g(e.column.Customer.selected?9:-1),o(),g(e.column.JoinDate.selected?10:-1),o(),g(e.column.Groups.selected?11:-1),o(),g(e.column.SalesPerson.selected?12:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.role&&e.column.Cost.selected?13:-1),o(),g(e.roleService.report.Price?14:-1),o(),g(e.column.Payment.selected?15:-1),o(2),B(e.infiniteList),o(2),g(e.data?19:-1)}}function Ap(i,s){if(i&1){let e=b();n(0,"span",58),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",59),p(2,"?"),a()()}}function Gp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Hp(i,s){if(i&1){let e=b();n(0,"a",60),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",61),p(2," Next"),a()}}function Yp(i,s){if(i&1){let e=b();n(0,"a",62),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),E(1,"i",63),p(2," Show All"),a()}}function Qp(i,s){if(i&1&&(n(0,"content")(1,"div",23),C(2,Np,20,9,"div",24),n(3,"div",25)(4,"div",26)(5,"div",27),p(6),d(7,"number"),C(8,Ap,3,0,"span",28),C(9,Gp,3,3,"span"),p(10),a()(),n(11,"div",29),C(12,Hp,3,0,"a",30),C(13,Yp,3,0,"a",31),a()()()()),i&2){let e=m();o(2),g(e.data?2:-1),o(4),D(" Showing 1 - ",x(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),g(!e.nextPageDisabled&&!e.goToLast?12:-1),o(),g(!e.nextPageDisabled&&!e.goToLast?13:-1)}}var Vn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=y}roleService=Me(j);columnService=Me(st);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",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},Total:{selected:!0,name:"Total",role:this.roleService.report.Price},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=>M.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(Mn,{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 y=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(),y);case"number":return this.compare(t.Number,l.Number,y);case"date":return this.compare(t.Date,l.Date,y);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),y);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),y);case"cost":return this.compare(t.Cost,l.Cost,y);case"gross":return this.compare(t.Gross,l.Gross,y);case"sales":return this.compare(t.Sales,l.Sales,y);case"tax":return this.compare(t.Tax,l.Tax,y);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,y);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,y);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,y);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,y);case"groups":return this.compare(t.Groups,l.Groups,y);default:return 0}})}openExportModal(){this._matDialog.open(z,{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=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.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");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ae),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[Y],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[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"],["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"],[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","customStyle"],[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","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,"container-fluid","mt-5"],[1,"table-responsive"],[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 more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["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"],["mat-sort-header","customer"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],[1,"border-top"],["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"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-start",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"table","table-borderless"],[1,"empty-column"],[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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Jl,3,0,"button",2),a(),n(3,"filters"),L(4,Xl,44,26,"ng-template",null,0,A),a(),C(6,Qp,14,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,$e,Q,$,X,Ye,k,W,ie,le,ge,Ke,we,Ge,Di,U,ze,me,re,oe,Z],encapsulation:2})};var jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Up=()=>["/menu/Products/Setup/Brand/Brand_Form"],Kp=i=>({ID:i}),zp=(i,s)=>({BrandID:i,Name:s});function Jp(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Xp(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"p-treeSelect",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectetOutletGroup,t)||(l.selectetOutletGroup=t),_(t)}),P("ngModelChange",function(t){u(e);let l=m();return _(l.onSelectOutletGroup(t))})("onClear",function(){u(e);let t=m();return _(t.onClearOutletGroup())}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(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,"Category"),a(),n(9,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(13,"div",15)(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(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("disabled",(e.pageData.Filter==null||e.pageData.Filter.ListIDs==null?null:e.pageData.Filter.ListIDs.length)>0)("options",e.pageData.Options==null?null:e.pageData.Options.OutletGroupsTree),f("ngModel",e.selectetOutletGroup),c("showClear",!0),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),o(2),f("date",e.pageData.Filter.To)}}function Zp(i,s){i&1&&(n(0,"th",21),p(1," Cost "),a())}function $p(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Gross))}}function em(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",27),p(3),a()(),n(4,"td",28)(5,"a",29),p(6),d(7,"quantityFraction"),a()(),n(8,"td",28),p(9),d(10,"amountFraction"),a(),C(11,$p,3,3,"td",28),n(12,"td",28),p(13),d(14,"amountFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),n(18,"td",28),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",I(20,Up))("queryParams",J(21,Kp,e.ID)),o(),D("",e.BrandName," "),o(2),c("queryParams",xe(23,zp,e.ID,e.BrandName)),o(),F(x(7,10,e.Quantity)),o(3),F(x(10,12,e.Cost)),o(2),g(r.roleService.product.Cost?11:-1),o(2),F(x(14,14,e.NetSales)),o(3),F(x(17,16,e.Tax)),o(3),F(x(20,18,e.SalesTax))}}function tm(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(x(3,4,v(2,1,e.data.Data,"Cost")))}}function im(i,s){if(i&1){let e=b();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,"Brand"),a(),n(6,"th",20),p(7," Quantity "),a(),C(8,Zp,2,0,"th",21),n(9,"th",22),p(10," Gross "),a(),n(11,"th",23),p(12," Sales "),a(),n(13,"th",24),p(14," Tax "),a(),n(15,"th",25),p(16," Sales + Tax "),a()()(),n(17,"tbody"),V(18,em,21,26,"tr",null,R),a(),n(20,"tfoot")(21,"tr",26)(22,"td"),p(23,"Total"),a(),n(24,"td"),p(25),d(26,"sum"),a(),C(27,tm,4,6,"td"),n(28,"td"),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td"),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td"),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td"),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()}if(i&2){let e=m();o(8),g(e.roleService.product.Cost?8:-1),o(10),B(e.data.Data),o(7),F(v(26,7,e.data.Data,"Quantity")),o(2),g(e.roleService.product.Cost?27:-1),o(2),F(x(31,13,v(30,10,e.data.Data,"Gross"))),o(4),F(x(35,18,v(34,15,e.data.Data,"NetSales"))),o(4),F(x(39,23,v(38,20,e.data.Data,"Tax"))),o(4),F(x(43,28,v(42,25,e.data.Data,"SalesTax")))}}var Bn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=y;this.matDialog=T}selectetOutletGroup;preInitList(){super.preInitList(),this.pageData.Options=Ze(Xe({},this.pageData.Options),{Categories:[]})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=JSON.parse(JSON.stringify(this.originalData));return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";return this.compare(t[e.active],l[e.active],y)})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e.key,this.selectetOutletGroup=e}onClearOutletGroup(){this.pageData.Filter.OutletGroupID=null}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ae),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[Y],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"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","placeholder","Choose Outlet",1,"tree-select-as-filter",3,"ngModelChange","onClear","disabled","options","ngModel","showClear"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["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","BrandName",2,"width","250px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before","matTooltip","Brand Cost Cost",1,"flex-right",2,"width","120px"],["mat-sort-header","Gross","arrowPosition","before","matTooltip","Brand Gross Gross",1,"flex-right",2,"width","120px"],["mat-sort-header","NetSales","arrowPosition","before","matTooltip","Brand Net Sales",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Brand Net Tax",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesTax","arrowPosition","before","matTooltip","Brand Net Sales + Tax",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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Jp,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"),L(14,Xp,15,14,"ng-template",null,0,A),a(),n(16,"content"),C(17,im,44,30,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(8,jp)),o(3),c("routerLink",I(9,qp)),o(6),g(t.data?17:-1))},dependencies:[H,Q,X,k,W,ie,le,ge,ce,U,$o,me,Z,ne],encapsulation:2})};function nm(i,s){if(i&1){let e=b();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),E(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 Ln=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(xi),w(fi))};static \u0275cmp=O({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),V(3,nm,4,3,"label",null,R),a()()()),e&2&&(c("title","Edit Groups"),o(3),B(r.options))},dependencies:[Xt],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],mm=()=>["/menu/Contacts/Contact/Customers/Info"],sm=i=>({ID:i});function dm(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function cm(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 um(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function _m(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Cm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function gm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function xm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function fm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Sm(i,s){if(i&1){let e=b();n(0,"span")(1,"span"),p(2),a(),n(3,"a",42),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 hm(i,s){if(i&1&&(n(0,"span"),V(1,Sm,5,2,"span",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Groups)}}function ym(i,s){if(i&1){let e=b();n(0,"a",42),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 Dm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Orders)," ")}}function vm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Quantity)," ")}}function Tm(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function wm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function Pm(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Fm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales+e.Tax)," ")}}function bm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",35),p(3),a(),n(4,"div",36),C(5,hm,3,0,"span"),C(6,ym,2,0,"a",37),a()(),n(7,"td")(8,"span",38),p(9),a()(),C(10,Dm,3,3,"td",39),C(11,vm,3,3,"td",39),C(12,Tm,3,3,"td",40),C(13,wm,3,3,"td",39),C(14,Pm,3,3,"td",41),C(15,Fm,3,3,"td",39),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",I(13,mm))("queryParams",J(14,sm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),g(e.Groups.length>0?5:-1),o(),g(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(),g(r.column.Orders.selected?10:-1),o(),g(r.column.QTY.selected?11:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),g(r.column.Sales.selected?13:-1),o(),g(r.column.Tax.selected?14:-1),o(),g(r.column.SalesNTax.selected?15:-1)}}function Em(i,s){if(i&1&&(n(0,"tbody",28),V(1,bm,16,16,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.infiniteList)}}function Im(i,s){if(i&1){let e=b();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))}),n(1,"i",44),p(2,"?"),a()()}}function Mm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Vm(i,s){if(i&1){let e=b();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",46),p(2," Next"),a()}}function Bm(i,s){if(i&1){let e=b();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(),C(9,um,2,0,"th",22),C(10,_m,2,0,"th",23),C(11,Cm,2,0,"th",24),C(12,gm,2,0,"th",25),C(13,xm,2,0,"th",26),C(14,fm,2,0,"th",27),a()(),C(15,Em,3,0,"tbody",28),a()(),n(16,"div",29)(17,"div",30)(18,"div",31),p(19),d(20,"number"),L(21,Im,3,0,"span",32)(22,Mm,3,3,"span",33),p(23),a()(),L(24,Vm,3,0,"a",34),a()()}if(i&2){let e=m();o(9),g(e.column.Orders.selected?9:-1),o(),g(e.column.QTY.selected?10:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),g(e.column.Sales.selected?12:-1),o(),g(e.column.Tax.selected?13:-1),o(),g(e.column.SalesNTax.selected?14:-1),o(),g(e.data.Data?15:-1),o(4),D(" Showing 1 - ",x(20,12,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)}}var On=class i extends Zt{constructor(e,r,t,l,y){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=y}roleService=Me(j);columnService=Me(st);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=wn.maskingField;postInit(e){super.postInit(e),this.maskingFields=M.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(){M.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 y=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Orders":return this.compare(t.Orders,l.Orders,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Sales":return this.compare(t.Sales,l.Sales,y);case"Tax":return this.compare(t.Tax,l.Tax,y);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,y);case"Cost":return this.compare(t.Cost,l.Cost,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(Ln,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let y={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",y).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(z,{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)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[Y],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"],[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"],[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"],[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"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,dm,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),E(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),L(24,cm,16,10,"ng-template",null,0,A),a(),n(26,"content"),C(27,Bm,25,14,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,am)),o(3),c("routerLink",I(13,om)),o(3),c("routerLink",I(14,rm)),o(3),c("routerLink",I(15,lm)),o(4),c("routerLink",I(16,pm)),o(6),g(t.data?27:-1))},dependencies:[H,on,Q,$,X,Ye,k,W,ie,le,ge,Ke,U,re,Z,ne],encapsulation:2})};var Lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Nm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Am(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Gm(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(x(5,4,e.TotalOrders)),o(3),F(x(8,6,e.TotalCost)),o(3),F(x(11,8,e.TotalAmount))}}function Hm(i,s){if(i&1&&(n(0,"tbody",22),V(1,Gm,12,10,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.data.Data)}}function Ym(i,s){if(i&1){let e=b();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()()(),C(12,Hm,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),g(e.data.Data?12:-1)}}var Rn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;this.datePipe=T}preInitList(){M.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 y=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Nm,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"),L(23,Am,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,Ym,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(11,Lm)),o(3),c("routerLink",I(12,Om)),o(3),c("routerLink",I(13,Rm)),o(3),c("routerLink",I(14,km)),o(3),c("routerLink",I(15,Wm)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z],encapsulation:2})};var Qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function zm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Jm(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Xm(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function Zm(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function $m(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function e0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalOrders))}}function t0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.TotalQuantity)," ")}}function i0(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalAmount))}}function n0(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),C(3,e0,3,3,"td",23),C(4,t0,3,3,"td",23),C(5,i0,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),g(r.column.Orders.selected?3:-1),o(),g(r.column.QTY.selected?4:-1),o(),g(r.column.Amount.selected?5:-1)}}function a0(i,s){if(i&1){let e=b();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(),C(6,Xm,2,0,"th",19),C(7,Zm,2,0,"th",20),C(8,$m,2,0,"th",21),a()(),n(9,"tbody",22),V(10,n0,6,4,"tr",null,R),a()()()}if(i&2){let e=m();o(6),g(e.column.Orders.selected?6:-1),o(),g(e.column.QTY.selected?7:-1),o(),g(e.column.Amount.selected?8:-1),o(2),B(e.data==null?null:e.data.Data)}}var kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.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 y=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(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 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"),L(23,Jm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,a0,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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Qm)),o(3),c("routerLink",I(13,jm)),o(3),c("routerLink",I(14,qm)),o(3),c("routerLink",I(15,Um)),o(3),c("routerLink",I(16,Km)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z,ne],encapsulation:2})};var Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],s0=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],d0=i=>({ID:i}),c0=(i,s,e)=>({From:i,SupplierID:s,To:e});function u0(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function _0(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 C0(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",I(19,s0))("queryParams",J(20,d0,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",x(10,9,e.Quantity)," "),o(3),c("routerLink",I(22,Tr))("queryParams",mt(23,c0,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(" ",x(16,17,e.Total))}}function g0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),E(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),E(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 x0(i,s){if(i&1){let e=b();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"),V(15,C0,17,27,"tr",24,R),a(),C(17,g0,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),B(e.data.Data),o(2),g((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Wn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}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 y=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,y);case"Supplier":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Total":return this.compare(t.Total,l.Total,y);default:return 0}})}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,u0,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"),L(26,_0,16,10,"ng-template",null,0,A),a(),n(28,"content"),C(29,x0,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Tr)),o(3),c("routerLink",I(13,o0)),o(3),c("routerLink",I(14,r0)),o(3),c("routerLink",I(15,l0)),o(3),c("routerLink",I(16,p0)),o(3),c("routerLink",I(17,m0)),o(6),g(t.data?29:-1))},dependencies:[H,Q,$,X,Ye,k,W,le,ge,Ke,U,oe,Z,ne],encapsulation:2})};var wr=At(ei());var h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],P0=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),F0=i=>[i],b0=i=>({ID:i}),E0=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Pr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],I0=(i,s,e)=>({VariantID:i,From:s,To:e}),M0=(i,s,e)=>({ProductID:i,From:s,To:e});function V0(i,s){if(i&1&&(n(0,"a",9),E(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",tn(1,P0,(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 B0(i,s){if(i&1){let e=b();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",12),p(2," Export "),a()}}function L0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function O0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function R0(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Cost Currency"),a(),n(41,"ng-select",28),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectedCurrencyID,t)||(l.selectedCurrencyID=t),_(t)}),L(42,L0,5,2,"ng-template",29)(43,O0,5,2,"ng-template",30),a(),n(44,"h6"),p(45,"Product Type"),a(),n(46,"radio-options",31),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(47,"h6"),p(48,"Multiply Unit Quantity"),a(),n(49,"radio-options",32),h("modelChange",function(t){u(e);let l=m();return S(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),c("items",e.pageData.Options.Currencies),f("ngModel",e.selectedCurrencyID),o(5),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function k0(i,s){if(i&1){let e=b();n(0,"th",54)(1,"div",55)(2,"input",56),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 W0(i,s){if(i&1&&(n(0,"th",57),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function N0(i,s){i&1&&(n(0,"th",58),p(1," On Hand "),a())}function A0(i,s){i&1&&(n(0,"th",59),p(1," Cost "),a())}function G0(i,s){i&1&&(n(0,"th",60),p(1," GROSS "),a())}function H0(i,s){if(i&1&&(n(0,"th",61),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function Y0(i,s){i&1&&(n(0,"th",62),p(1," Tax "),a())}function Q0(i,s){if(i&1&&(n(0,"th",63),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function j0(i,s){i&1&&(n(0,"th",64),p(1," PROFIT "),a())}function q0(i,s){i&1&&(n(0,"th",65),p(1," % "),a())}function U0(i,s){if(i&1){let e=b();n(0,"td")(1,"div",55)(2,"input",77),h("ngModelChange",function(t){u(e);let l=m().$implicit;return S(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 K0(i,s){if(i&1){let e=b();kt(0),n(1,"img",78),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l==null?null:l.ImageURL,t))}),a(),Wt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,Ki)}}function z0(i,s){if(i&1){let e=b();n(0,"a",79)(1,"img",80),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function J0(i,s){if(i&1&&(n(0,"td",81)(1,"a",82),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Fo(4,E0,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(x(3,2,r.Quantity))}}function X0(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.OnHand)," ")}}function Z0(i,s){if(i&1&&(p(0),d(1,"amountFraction")),i&2){let e=m(2).$implicit,r=m(2);Nt(" ",r.primaryCurrency().Symbol," ",x(1,2,e.UnitCost*e.CostCurrencyExchangeRate)," ")}}function $0(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"amountFraction"),E(3,"br"),C(4,Z0,2,4),a()),i&2){let e,r=m().$implicit,t=m(2);o(),Nt(" ",r.CostCurrencySymbol," ",x(2,3,r.UnitCost)," "),o(3),g(r.CostCurrencyID&&r.CostCurrencyID!==((e=t.primaryCurrency())==null?null:e.ID)?4:-1)}}function es(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function ts(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,Pr))("queryParams",mt(12,I0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function is(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,Pr))("queryParams",mt(12,M0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function ns(i,s){if(i&1&&(n(0,"td",81),L(1,ts,5,16,"a",84)(2,is,5,16,"a",84),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function as(i,s){if(i&1&&(n(0,"td",85),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function os(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.SalesNTax)," ")}}function rs(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Profit)," ")}}function ls(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Margin)," ")}}function ps(i,s){if(i&1&&(n(0,"tr",66),L(1,U0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",67)(6,"div",68),L(7,K0,2,1,"ng-container",8)(8,z0,2,1,"a",69),a(),n(9,"div",70)(10,"a",71),p(11),a(),n(12,"small",72),p(13),a()()()(),L(14,J0,4,11,"td",73)(15,X0,3,3,"td",73)(16,$0,5,5,"td",74)(17,es,3,3,"td",73)(18,ns,3,2,"td",73)(19,as,3,3,"td",75)(20,os,3,3,"td",73)(21,rs,3,4,"td",76)(22,ls,3,4,"td",76),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",J(17,F0,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(19,b0,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 ms(i,s){i&1&&E(0,"td",81)}function ss(i,s){i&1&&(n(0,"td",81),p(1," Total : "),a())}function ds(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function cs(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function us(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function _s(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Cs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Sales")))}}function gs(i,s){if(i&1&&(n(0,"td",85)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Tax")))}}function xs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function fs(i,s){if(i&1&&(n(0,"td",86),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(" ",x(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function Ss(i,s){if(i&1&&(n(0,"td",86),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(" ",x(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function hs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",87),E(2,"td",81),L(3,ms,1,0,"td",73)(4,ss,2,0,"td",73)(5,ds,4,6,"td",73)(6,cs,4,6,"td",73)(7,us,4,6,"td",74)(8,_s,4,6,"td",73)(9,Cs,5,6,"td",88)(10,gs,5,6,"td",75)(11,xs,5,6,"td",88)(12,fs,5,10,"td",76)(13,Ss,7,16,"td",76),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 ys(i,s){if(i&1){let e=b();n(0,"content")(1,"div",36)(2,"div",37)(3,"table",38),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",39)(5,"tr"),L(6,k0,3,1,"th",40),n(7,"th",41),p(8,"No"),a(),n(9,"th",42),p(10,"Name"),a(),L(11,W0,2,1,"th",43)(12,N0,2,0,"th",44)(13,A0,2,0,"th",45)(14,G0,2,0,"th",46)(15,H0,2,1,"th",47)(16,Y0,2,0,"th",48)(17,Q0,2,1,"th",49)(18,j0,2,0,"th",50)(19,q0,2,0,"th",51),a()(),n(20,"tbody"),L(21,ps,23,21,"tr",52),a(),L(22,hs,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",53),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 Nn=class i extends ve{constructor(e,r,t,l,y,T,je){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,y);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=y;this.matDialog=T;this.bigPicture=je}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Me(j);columnService=Me(st);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:!1,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=at([]);queryParams=at(null);primaryCurrency=at(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=Ze(Xe({},this.data),{Data:e.Data.map(t=>Ze(Xe({},t),{checked:!1}))}),this.primaryCurrency.set(e.PrimaryCurrency);for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=Ze(Xe({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=Ze(Xe({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>Ze(Xe({},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;M.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"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.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=Ze(Xe({},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 y=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 M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),y);case"Quantity":return M.compare(t.Quantity,l.Quantity,y);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,y);case"Inventory":return M.compare(t.OnHand,l.OnHand,y);case"Total_Sales":return M.compare(t.Total,l.Total,y);case"Total_Tax":return M.compare(t.Tax,l.Tax,y);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,y);case"ReOrder":return M.compare(t.MinStock,l.MinStock,y);case"Gross":return M.compare(t.Gross,l.Gross,y);case"Margin":return M.compare(t.Margin,l.Margin,y);case"Profit":return M.compare(t.Profit,l.Profit,y);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(z,{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,wr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}showCurrencyExchangeRate(e){return this.primaryCurrency().ID===e}get selectedCurrencyID(){return this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID:this.pageData.Filter.ProductCostCurrencyID}set selectedCurrencyID(e){this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID=e:this.pageData.Filter.ProductCostCurrencyID=e}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ue),w(Ae),w(K),w(bn))};static \u0275cmp=O({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[Y],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"],["bindValue","ID","bindLabel","Name",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),L(2,V0,3,7,"a",2),C(3,B0,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"),L(27,R0,50,38,"ng-template",null,0,A),a(),L(29,ys,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(),g(t.roleService.global.Export?3:-1),o(6),c("routerLink",I(14,h0)),o(3),c("routerLink",I(15,y0)),o(3),c("routerLink",I(16,D0)),o(3),c("routerLink",I(17,v0)),o(3),c("routerLink",I(18,T0)),o(3),c("routerLink",I(19,w0)),o(5),c("ngIf",t.data))},dependencies:[H,$e,Io,on,Q,$,X,Lo,k,W,ie,le,ge,we,Ge,ce,U,ze,wi,Si,Uo,me,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ws=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Es=i=>({ID:i}),Is=(i,s)=>s.Name,Ms=(i,s)=>s.ID;function Vs(i,s){if(i&1){let e=b();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",17),p(2," Export "),a()}}function Bs(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(31,"h6"),p(32,"Hide Zero"),a(),n(33,"radio-options",30),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),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),o(3),f("model",e.pageData.Filter.HideZero)}}function Ls(i,s){i&1&&(n(0,"th",31),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Os(i,s){i&1&&(n(0,"th",32),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function Rs(i,s){i&1&&(n(0,"th",32),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function ks(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",dt(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function Ws(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function Ns(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 As(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(" ",x(2,3,e.UnitCost)," ")}}function Gs(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(" ",x(2,3,e.UnitPrice)," ")}}function Hs(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Ys(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function Qs(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",33),p(3),a()(),C(4,Ns,2,3,"td",34),C(5,As,3,5,"td",34),C(6,Gs,3,5,"td",34),V(7,Hs,2,1,"td",14,Bi),C(9,Ys,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",J(7,Es,e.ID)),o(),D(" ",e.Name),o(),g(r.column.code.selected?4:-1),o(),g(r.column.cost&&r.column.cost.selected?5:-1),o(),g(r.column.sales&&r.column.sales.selected?6:-1),o(),B(e.Quantities),o(2),g(r.column.total.selected?9:-1)}}var An=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=y}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(z,{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(G),w(N),w(q),w(K),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[Y],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"],["name","HideZero",3,"modelChange","model"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.submit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Vs,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"),L(26,Bs,34,19,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),C(35,Ls,2,2,"th",11),C(36,Os,2,2,"th",12),C(37,Rs,2,2,"th",12),V(38,ks,2,3,"th",13,Is),C(40,Ws,2,0,"th",14),a()(),n(41,"tbody"),V(42,Qs,10,9,"tr",15,Ms),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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(16,vs)),o(3),c("routerLink",I(17,Ts)),o(3),c("routerLink",I(18,ws)),o(3),c("routerLink",I(19,Ps)),o(3),c("routerLink",I(20,Fs)),o(3),c("routerLink",I(21,bs)),o(12),g(t.column.code.selected?35:-1),o(),g(t.column.cost&&t.column.cost.selected?36:-1),o(),g(t.column.sales&&t.column.sales.selected?37:-1),o(),B(t.data==null?null:t.data.Outlet),o(2),g(t.column.total.selected?40:-1),o(2),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,ce,U,ze,vi,Z],encapsulation:2})};var no=At(ei());var js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Fr=()=>({standalone:!0}),br=()=>({overflow:"visible"}),Xs=i=>[i],Zs=i=>({ID:i});function $s(i,s){if(i&1){let e=b();n(0,"a",14),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",15),p(2," Export"),a()}}function ed(i,s){if(i&1){let e=b();n(0,"div",16)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",17),h("ngModelChange",function(t){u(e);let l=m();return S(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",18),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",19)(8,"div",20)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",22)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(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",I(18,Fr))("contentStyle",I(19,br))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",I(20,Fr))("contentStyle",I(21,br))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function td(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function id(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function nd(i,s){i&1&&(n(0,"th",13)(1,"span",24),p(2," On Hand "),a()())}function ad(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 od(i,s){i&1&&(n(0,"th",13)(1,"span",25),p(2," Total "),a()())}function rd(i,s){if(i&1&&(n(0,"td")(1,"a",27),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",J(3,Xs,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(5,Zs,e.ID)),o(),D(" ",e.Name," ")}}function ld(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function pd(i,s){if(i&1&&(n(0,"td",26)(1,"span",24),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 md(i,s){if(i&1&&(n(0,"td",26),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 sd(i,s){if(i&1&&(n(0,"td",26)(1,"span",25),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 dd(i,s){if(i&1&&(n(0,"tr"),C(1,rd,3,7,"td"),C(2,ld,2,1,"td"),C(3,pd,4,4,"td",26),V(4,md,3,4,"td",26,R),C(6,sd,5,7,"td",26),a()),i&2){let e=m();o(),g(e.column.name.selected?1:-1),o(),g(e.column.code.selected?2:-1),o(),g(e.column.OnHand.selected?3:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?6:-1)}}function cd(i,s){i&1&&E(0,"td")}function ud(i,s){i&1&&(n(0,"td",26),p(1,"Total :"),a())}function _d(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Cd(i,s){if(i&1&&(n(0,"td",26),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 gd(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==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function xd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",28),C(2,cd,1,0,"td"),C(3,ud,2,0,"td",26),C(4,_d,3,4,"td",26),V(5,Cd,3,4,"td",26,R),C(7,gd,4,7,"td",26),a()()),i&2){let e=m();o(2),g(e.column.name.selected?2:-1),o(),g(e.column.code.selected?3:-1),o(),g(e.column.OnHand.selected?4:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?7:-1)}}var Gn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;let T=new Date().getFullYear(),je=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,je)}_toastrService=Me(Ue);columnService=Me(st);years=M.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(z,{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 y=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(),y);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);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,no.default)(this.pageData.Filter.MonthFrom),r=(0,no.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",y=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(y),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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[Y],decls:43,vars:23,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"],["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"],[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"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.onSubmit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,$s,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"),L(26,ed,19,22,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return t.sortData(T)}),n(31,"thead",9)(32,"tr",10),C(33,td,2,0,"th",11),C(34,id,2,0,"th",12),C(35,nd,3,0,"th",13),V(36,ad,2,1,"th",13,R),C(38,od,3,0,"th",13),a()(),n(39,"tbody"),V(40,dd,7,4,"tr",null,R),a(),C(42,xd,8,4,"tfoot"),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(17,js)),o(3),c("routerLink",I(18,qs)),o(3),c("routerLink",I(19,Us)),o(3),c("routerLink",I(20,Ks)),o(3),c("routerLink",I(21,zs)),o(3),c("routerLink",I(22,Js)),o(10),g(t.column.name.selected?33:-1),o(),g(t.column.code.selected?34:-1),o(),g(t.column.OnHand.selected?35:-1),o(),B(t.data==null?null:t.data.MonthlySales),o(2),g(t.column.total.selected?38:-1),o(2),B(t.data==null?null:t.data.Data),o(2),g((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?42:-1))},dependencies:[H,Q,k,W,ie,le,ge,we,ce,U,or,me,re],encapsulation:2})};var fd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Sd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],yd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],vd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Td=i=>[i],wd=i=>({ID:i});function Pd(i,s){if(i&1){let e=b();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",14),p(2," Export"),a()}}function Fd(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 bd(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Ed(i,s){if(i&1&&(n(0,"tr"),E(1,"th")(2,"th"),V(3,bd,2,1,"th",22,R),a()),i&2){let e=m();o(3),B(e.data==null?null:e.data.Outlet)}}function Id(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Md(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",J(3,Td,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",J(5,wd,r[1])),o(),F(r[e])}}function Vd(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Bd(i,s){if(i&1&&(n(0,"td",11),C(1,Md,2,7,"a",23)(2,Vd,1,1),a()),i&2){let e=s.$index;o(),g(e===0?1:2)}}function Ld(i,s){if(i&1&&(n(0,"tr",11),V(1,Bd,3,1,"td",11,R),a()),i&2){let e=s.$implicit,r=m();o(),B(r.getFilteredKeys(e))}}var Hn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Pd,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"),L(26,Fd,16,10,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),C(32,Ed,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),V(38,Id,2,1,"th",12,R),a()(),n(40,"tbody"),V(41,Ld,3,0,"tr",11,R),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,fd)),o(3),c("routerLink",I(13,Sd)),o(3),c("routerLink",I(14,hd)),o(3),c("routerLink",I(15,yd)),o(3),c("routerLink",I(16,Dd)),o(3),c("routerLink",I(17,vd)),o(9),g((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),B(t.data==null?null:t.data.Header),o(3),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,X,k,W,we,ce,U],encapsulation:2})};var Od=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Rd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],kd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Wd=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Ir=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Nd=(i,s,e)=>({CategoryID:i,From:s,To:e}),Ad=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Er=i=>({CategoryID:i});function Gd(i,s){if(i&1){let e=b();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",8),p(2," Export "),a()}}function Hd(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",dt(e.Value)),o(),F(e.Value)}}function Yd(i,s){if(i&1){let e=b();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 S(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",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),L(10,Hd,2,3,"ng-template",13),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(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",15)(16,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(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",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(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",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=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),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Qd(i,s){i&1&&(n(0,"th",33),p(1," Cost "),E(2,"p-treeTableSortIcon",34),a())}function jd(i,s){i&1&&(n(0,"th",35),p(1," Gross "),E(2,"p-treeTableSortIcon",36),a(),n(3,"th",37),p(4," Disc "),E(5,"p-treeTableSortIcon",38),a(),n(6,"th",39),p(7," Sales "),E(8,"p-treeTableSortIcon",40),a())}function qd(i,s){i&1&&(n(0,"th",41),p(1," Profit "),E(2,"p-treeTableSortIcon",42),a(),n(3,"th",43),p(4," % "),E(5,"p-treeTableSortIcon",44),a())}function Ud(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),E(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),E(6,"p-treeTableSortIcon",32),a(),C(7,Qd,3,0,"th",33),C(8,jd,9,0),C(9,qd,6,0),a()),i&2){let e=m(2);o(7),g(e.roleService.product.Cost?7:-1),o(),g(e.roleService.report.Price?8:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?9:-1)}}function Kd(i,s){if(i&1&&(n(0,"td",48)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",dt(e.CostInDirect&&e.Cost?"Direct ("+x(2,3,e.Cost)+") Indirect ("+x(3,5,e.CostInDirect)+")":"")),o(3),F(x(5,7,e.DisplayedCost))}}function zd(i,s){if(i&1&&(n(0,"td",49)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td",50)(7,"a",51),d(8,"number"),d(9,"number"),p(10),d(11,"amountFraction"),a()(),n(12,"td",49)(13,"span",22),d(14,"number"),d(15,"number"),n(16,"a",47),p(17),d(18,"amountFraction"),a()()()),i&2){let e=m().rowData;o(),c("matTooltip",dt(e.GrossIndirect&&e.GrossSales?"Direct ("+x(2,13,e.GrossSales)+") Indirect ("+x(3,15,e.GrossIndirect)+")":"")),o(3),F(x(5,17,e.DisplayedGross)),o(3),c("matTooltip",dt(e.DiscountIndirect&&e.Discount?"Direct ("+x(8,19,e.Discount)+") Indirect ("+x(9,21,e.DiscountIndirect)+")":""))("routerLink",I(31,Ad))("queryParams",J(32,Er,e.ID)),o(3),F(x(11,23,e.DisplayedTotalDiscount)),o(3),c("matTooltip",dt(e.NetSalesIndirect&&e.Sales?"Direct ("+x(14,25,e.Sales)+") Indirect ("+x(15,27,e.NetSalesIndirect)+")":"")),o(3),c("routerLink",I(34,Ir))("queryParams",J(35,Er,e.ID)),o(),F(x(18,29,e.DisplayedNetSales))}}function Jd(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",dt(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("",x(4,9,e.DisplayedPercentage),"%")}}function Xd(i,s){if(i&1&&(n(0,"td",52)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td"),C(7,Jd,5,11,"span",22),a()),i&2){let e=m().rowData,r=m(2);o(),c("matTooltip",dt(e.ProfitInDirect&&e.Profit?"Direct ("+x(2,4,e.Profit)+") Indirect ("+x(3,6,e.ProfitInDirect)+")":"")),o(3),F(x(5,8,e.DisplayedProfit)),o(3),g(r.roleService.report.Profit?7:-1)}}function Zd(i,s){if(i&1&&(n(0,"tr",45)(1,"td"),E(2,"p-treeTableToggler",46),n(3,"a",47),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()(),C(13,Kd,6,9,"td",48),C(14,zd,19,37),C(15,Xd,8,10),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",I(23,Ir))("queryParams",mt(24,Nd,r.ID,v(4,11,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,14,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",dt(r.QuantityIndirect&&r.Quantity?"Direct ("+x(9,17,r.Quantity)+") Indirect ("+x(10,19,r.QuantityIndirect)+")":"")),o(3),F(x(12,21,r.DisplayedQuantity)),o(2),g(t.roleService.product.Cost?13:-1),o(),g(t.roleService.report.Price?14:-1),o(),g(t.roleService.product.Cost&&t.roleService.report.Price&&t.roleService.report.Profit?15:-1)}}function $d(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(2,1,e.data.Aggregate.TotalCost)," ")}}function ec(i,s){if(i&1&&(n(0,"td",56)(1,"a"),p(2),d(3,"amountFraction"),a()(),n(4,"td",54),p(5),d(6,"amountFraction"),a(),n(7,"td",56),p(8),d(9,"amountFraction"),a()),i&2){let e=m(3);o(2),F(x(3,3,e.data.Aggregate.TotalGross)),o(3),D(" ",x(6,5,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",x(9,7,e.data.Aggregate.TotalNetSales)," ")}}function tc(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a(),n(3,"td",54),p(4),d(5,"number"),a()),i&2){let e=m(3);o(),D(" ",x(2,2,e.data.Aggregate.TotalProfit)," "),o(3),D(" ",x(5,4,e.data.Aggregate.TotalPercentage),"% ")}}function ic(i,s){if(i&1&&(n(0,"tr",53)(1,"td",54),p(2,"Total :"),a(),n(3,"td",54),p(4),d(5,"quantityFraction"),a(),C(6,$d,3,3,"td",55),C(7,ec,10,9),C(8,tc,6,6),a()),i&2){let e=m(2);o(4),D(" ",x(5,4,e.data.Aggregate.TotalQuantity)," "),o(2),g(e.roleService.product.Cost?6:-1),o(),g(e.roleService.report.Price?7:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?8:-1)}}function nc(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),L(3,Ud,10,3,"ng-template",25)(4,Zd,16,28,"ng-template",26)(5,ic,9,6,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",I(4,Wd))}}var Yn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[Y],decls:20,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,"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"],["name","render-ProductType",3,"modelChange","model","options"],["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"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["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"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],[1,"text-danger",2,"width","120px"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[1,"text-success",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Gd,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"),L(17,Yd,32,17,"ng-template",null,0,A),a(),C(19,nc,6,5,"content"),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),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,Od)),o(3),c("routerLink",I(11,Rd)),o(3),c("routerLink",I(12,kd)),o(5),g(t.data?19:-1))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,lr,Wo,dr,pr,mr,sr,ce,U,ze,Si,re,oe,Z,ne],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 ac=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],oc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function lc(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function pc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 mc(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 sc(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function dc(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Value))}}function cc(i,s){if(i&1&&(n(0,"td"),C(1,sc,2,1,"span"),C(2,dc,3,3,"span"),a()),i&2){let e=s.$implicit;o(),g(e.Key=="Category"?1:-1),o(),g(e.Key!="Category"?2:-1)}}function uc(i,s){if(i&1&&(n(0,"tr"),V(1,cc,3,2,"td",null,R),a()),i&2){let e=s.$implicit;o(),B(e)}}function _c(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",x(2,1,e))}}function Cc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),V(4,_c,3,3,"td",null,R),a()()),i&2){let e=m(2);o(4),B(e.data.Sum)}}function gc(i,s){if(i&1){let e=b();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"),V(4,mc,2,2,"th",19,R),a()(),n(6,"tbody"),V(7,uc,3,0,"tr",null,R),a(),C(9,Cc,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),B(e.data.Dataheader),o(3),B(e.data.Data),o(2),g(e.data.Data.length>0?9:-1)}}var Qn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}openExportModal(){this.matDialog.open(z,{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 y=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let je=t.find(ni=>ni.Key===[this.data.Dataheader[T]].toString()).Value,vt=l.find(ni=>ni.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(je,vt,y)}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,lc,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"),L(17,pc,16,9,"ng-template",null,0,A),a(),n(19,"content"),C(20,gc,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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,ac)),o(3),c("routerLink",I(11,oc)),o(3),c("routerLink",I(12,rc)),o(6),g(t.data?20:-1))},dependencies:[H,Q,X,k,W,le,ge,Ge,ce,U,Z],encapsulation:2})};var xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function hc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 yc(i,s){if(i&1&&(n(0,"div",6),E(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var jn=class i extends pe{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.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(G),w(N))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(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"),L(16,hc,10,6,"ng-template",null,0,A),a(),n(18,"content"),C(19,yc,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",I(8,xc)),o(3),c("routerLink",I(9,fc)),o(3),c("routerLink",I(10,Sc)),o(6),g(t.data?19:-1))},dependencies:[H,Q,$,k,W,ti],encapsulation:2})};var Dc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function vc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Tc(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),E(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),E(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 qn=class i extends ve{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 y={name:l.Name+": "+l.Description,y:l.Transaction};t.push(y)}),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,y){return l+"<br/>"+y.series.name+": <b>"+y.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),E(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),L(6,vc,13,9,"ng-template",null,0,A),a(),C(8,Tc,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",I(6,Dc)),o(6),g(t.data?8:-1))},dependencies:[H,Q,$,X,k,W,ti,Ft,U],encapsulation:2})};function wc(i,s){if(i&1){let e=b();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function Pc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Fc(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(x(3,5,e.Visitor)),o(3),F(x(6,7,e.Orders)),o(3),F(x(9,9,e.TotalVisitor)),o(3),F(x(12,11,e.Sales)),o(3),F(x(15,13,e.Sales/(e.Visitor*e.Orders)))}}function bc(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"),V(15,Fc,16,15,"tr",null,R),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),B(e.data.Data),o(7),F(x(24,7,v(23,4,e.data.Data,"Orders"))),o(4),F(x(28,12,v(27,9,e.data.Data,"TotalVisitor"))),o(4),F(x(32,17,v(31,14,e.data.Data,"Sales"))),o(4),F(x(35,19,e.getSpendingPerPersonSum(e.data.Data)))}}var Un=class i extends pe{constructor(e,r,t,l,y){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,wc,3,0,"a",2),a(),n(3,"filters"),L(4,Pc,10,6,"ng-template",null,0,A),a(),n(6,"content"),C(7,bc,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),g(t.data?7:-1))},dependencies:[H,X,k,W,U,me,re,Z],encapsulation:2})};var Ec=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Ic(i,s){if(i&1){let e=b();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",16),p(2," Export "),a()}}function Mc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Vc(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Bc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Revenue))}}function Lc(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(),C(20,Bc,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(x(5,7,e.Count)),o(3),F(x(8,9,e.Quantity)),o(3),F(x(11,11,e.Sales)),o(3),F(x(15,15,x(14,13,e.Tax))),o(4),F(x(19,19,x(18,17,e.SalesWithTax))),o(3),g(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Oc(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(x(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Ic,3,0,"a",2),n(3,"a",3),E(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),L(7,Mc,10,6,"ng-template",null,0,A),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(),C(26,Vc,2,0,"th",10),a()(),n(27,"tbody"),V(28,Lc,21,21,"tr",null,R),a(),n(30,"tfoot")(31,"tr",11),E(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(),C(55,Oc,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",I(42,Ec)),o(23),g(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),B(t.data==null?null:t.data.Data),o(6),F(x(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(x(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(x(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(x(49,33,x(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(x(54,40,x(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),g(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[H,Q,X,k,W,U,me,zo,re,Z,ne],encapsulation:2})};var ro=At(ei());var Rc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],oo=(i,s)=>({From:i,To:s}),kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Wc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Nc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Ac(i,s){if(i&1&&(n(0,"content")(1,"div",11),E(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var zn=class i extends pe{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=M.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 M.getDatesInRange(s,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=(0,ro.default)(s.from).format("YYYY-MM-DD[T]00:00:00"),this.pageData.Filter.To=(0,ro.default)(s.to).format("YYYY-MM-DD[T]00:00:00")}static \u0275fac=function(e){return new(e||i)(w(G),w(N),w(Ae))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return r.searchFromPageOne()}),h("filterChange",function(y){return u(t),S(r.pageData.Filter,y)||(r.pageData.Filter=y),_(y)}),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"),L(16,Nc,13,11,"ng-template",null,0,A),a(),C(18,Ac,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",I(11,Rc))("queryParams",xe(12,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(15,kc))("queryParams",xe(16,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(19,Wc))("queryParams",xe(20,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),g(r.data?18:-1))},dependencies:[H,Q,$,k,W,Ft,Lt,ce,U],encapsulation:2})};var Yc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Xn=(()=>{class i{constructor(){this.dateChange=nn(),this.width=_i(),this.minDate=M.MinDate}ngOnInit(){}setMonthAndYear(e,r){let t=null;e&&(t=e.toDate(),t.setHours(0,0,0,0)),this.date=t,this.dateChange.emit(t),r.close()}onDateChange(e){let r=null;e&&(r=e.toDate()),this.date=r,this.dateChange.emit(r)}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="outside")}}chosenYearHandler(e,r){let t=new Date(e.getFullYear(),0,1);this.date=t.toISOString(),r.close()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=O({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:[1,"width"]},outputs:{dateChange:"dateChange"},features:[en([{provide:un,useClass:Fn,deps:[cn,ar]},{provide:_n,useValue:Yc}])],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(r,t){if(r&1){let l=b();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(T){return t.onDateChange(T.value)}),a(),E(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(T){u(l);let je=Jt(4);return _(t.chosenYearHandler(T,je))})("monthSelected",function(T){u(l);let je=Jt(4);return _(t.setMonthAndYear(T,je))})("opened",function(){return t.onOpenDatepicker()})("closed",function(){return t.onCloseDatepicker()}),a()()}if(r&2){let l=Jt(4);qt("width",t.width()||100,"%"),o(),c("matDatepicker",l)("value",t.date==t.minDate?null:t.date),o(),c("for",l)}},dependencies:[Gt,hn,Ci,xn,fn,Sn,gi,Dn,gn,Cn,yn],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}
1
+ import{a as ti,b as fr}from"./chunk-2PDAUDPI.js";import{a as xr}from"./chunk-NNXT3U7A.js";import{a as hr}from"./chunk-Q3UK7KXA.js";import{a as Ft,b as Sr}from"./chunk-2P63LSN3.js";import{a as Lt}from"./chunk-72SBQH3S.js";import{b as yr}from"./chunk-YZP54ECO.js";import{a as wi}from"./chunk-JI2IJDXQ.js";import{a as ve}from"./chunk-T35BG6KB.js";import{a as ze}from"./chunk-NRCV4GQO.js";import{a as bn}from"./chunk-LHAFSZF7.js";import{a as En,b as li}from"./chunk-AVOTGRPZ.js";import{a as st}from"./chunk-Y5WAQBUZ.js";import{a as Go}from"./chunk-3NFVXRWB.js";import{b as jo}from"./chunk-37PZPWZY.js";import"./chunk-TTZUIFLN.js";import{a as vi}from"./chunk-VJMZ3HB7.js";import"./chunk-7GRHNPNY.js";import{a as ur,b as _r,d as Cr,g as gr}from"./chunk-MTMTZLMY.js";import{a as Di}from"./chunk-F5OC2EXS.js";import{a as or,b as rr}from"./chunk-UOCGL3EW.js";import"./chunk-DIAV4K3S.js";import"./chunk-2JPZMGCJ.js";import"./chunk-5GHN24QS.js";import{e as Qo}from"./chunk-EMLV5DDD.js";import{a as Ti}from"./chunk-3KHNPM76.js";import"./chunk-JEJGTRFJ.js";import{a as ei,b as ar,c as Fn,d as X}from"./chunk-6C7NKVRP.js";import{c as xn,d as fn,e as Sn,m as Ci}from"./chunk-6TWTQLKB.js";import{a as cn,b as un,c as _n,d as hn}from"./chunk-SASYAFMF.js";import{b as Dn,c as gi}from"./chunk-QP7B4347.js";import"./chunk-STYLBZL4.js";import"./chunk-XLS7AM5H.js";import{c as yn}from"./chunk-U7XVI26F.js";import{a as Z}from"./chunk-5WULCQQ4.js";import{c as Yo,d as we}from"./chunk-ALUJK3AI.js";import{a as ne}from"./chunk-PHNI4ZJ6.js";import"./chunk-B3U3BHLU.js";import{a as Zt}from"./chunk-B7UE3WB3.js";import{b as le,c as ge,d as Ao}from"./chunk-C5SH4ACM.js";import{a as Pt,b as nr}from"./chunk-ZIWP67C5.js";import{b as $o,c as er,e as ce}from"./chunk-GGV5VB6F.js";import{a as lr,b as pr,c as mr,e as sr,f as dr,g as cr}from"./chunk-H4KXYKGD.js";import"./chunk-OER3SUOJ.js";import"./chunk-EQ5GVHN7.js";import"./chunk-ZFPL5GZZ.js";import"./chunk-X7XTDK26.js";import"./chunk-RRTVC6Y2.js";import{a as U}from"./chunk-JX7TU3SH.js";import{b as tr,c as ir}from"./chunk-JDZPL3KU.js";import{b as z}from"./chunk-FZGFUOJQ.js";import"./chunk-UJPQDPFC.js";import{a as pe}from"./chunk-L5YCNYA2.js";import{a as No}from"./chunk-YJXKVHKE.js";import"./chunk-RHZ4SE3E.js";import{a as q}from"./chunk-E6MKUJD5.js";import{f as H,g as yi}from"./chunk-4VQ6MXVC.js";import"./chunk-Z3I6U6KT.js";import"./chunk-6R334P6I.js";import"./chunk-LSV7QXYU.js";import{c as qo}from"./chunk-HB5JT7XV.js";import"./chunk-35ECO23I.js";import"./chunk-G2UNSH3R.js";import"./chunk-3GIDLGOV.js";import"./chunk-JJFV542H.js";import"./chunk-QGI3QC76.js";import"./chunk-JBO3R4W5.js";import{a as Ke}from"./chunk-VIKIXIX5.js";import"./chunk-SFKCZ7DL.js";import"./chunk-PPNXP25T.js";import"./chunk-MHPH7T32.js";import"./chunk-UNAPWUZC.js";import"./chunk-IFLLAVLK.js";import"./chunk-GPQD2PY3.js";import"./chunk-A3HVDWQA.js";import{a as G}from"./chunk-GMKCQXEM.js";import"./chunk-3GZUX2TV.js";import"./chunk-LWCDPG6P.js";import{c as Zo}from"./chunk-ANISRDEI.js";import{b as wn,e as Ge,f as Pn}from"./chunk-2OZQZYOP.js";import"./chunk-3TFWTYY2.js";import{d as Cn,g as gn,n as Ho}from"./chunk-52KMSRYQ.js";import"./chunk-STIMAG44.js";import"./chunk-EKGQU5OA.js";import"./chunk-IOBYB6AV.js";import{a as ie,b as dn}from"./chunk-JFS6EFNT.js";import"./chunk-YNQPX5G6.js";import{A as Tn,B as Jo,C as $t,K as hi,O as Xo,g as me,o as Ko,s as vn,z as zo}from"./chunk-CTP6QQZM.js";import"./chunk-QU45SEX2.js";import"./chunk-QYSFCWV7.js";import{a as Si,b as Uo,d as $}from"./chunk-ZRBKLF75.js";import"./chunk-VBXYBASD.js";import{a as xi,b as fi,c as K}from"./chunk-CPHICIOL.js";import{b as mn}from"./chunk-GCPQTFRO.js";import"./chunk-NFVNHSX5.js";import"./chunk-Z6KYVNJQ.js";import"./chunk-4NWLXS6M.js";import"./chunk-OEFF3O4P.js";import{a as ki,b as sn,c as Xt}from"./chunk-N4STXFCX.js";import"./chunk-ZLJTB3SO.js";import"./chunk-OG6UIE5Q.js";import"./chunk-LYYPWLC4.js";import{va as Wo}from"./chunk-4CLMG36L.js";import{E as Gt,F as pn,b as Lo,c as Ye,h as k,l as Oo,o as W,q as Ro,s as ko}from"./chunk-DHBFOXIN.js";import"./chunk-S42ZE3AJ.js";import"./chunk-L3DZP263.js";import"./chunk-VFWU5XQ6.js";import{b as j}from"./chunk-HQQZZQUW.js";import{a as M}from"./chunk-3DEA4WWC.js";import"./chunk-RGBBE5KH.js";import{n as Ue,q as N}from"./chunk-2WBWJI4D.js";import{Ba as vo,Bb as C,Bc as en,Bd as Vo,Cc as I,Db as g,Dc as J,Eb as Bi,Ec as xe,F as ri,Fa as at,Fb as R,Fc as mt,Gb as V,Gc as Ut,Ha as Ui,Hb as B,Hc as tn,Ib as c,Ic as Fo,J as Mi,Jb as n,Kb as a,Kc as d,L as ho,La as To,Lb as E,Lc as x,Mc as v,N as yo,Nc as ui,Nd as Bo,Oa as wo,Pb as kt,Qb as Wt,Qc as A,R as Qi,Rd as Ae,Sa as be,Sc as bo,Tc as Oi,Td as ln,Ua as Ki,Ub as b,Ud as Q,Wd as Ri,Xb as P,Xc as nn,Yc as _i,Z as jt,Za as o,Zb as m,ad as an,ba as io,bc as Xi,cc as Zi,dc as $i,dd as Eo,eb as w,ga as Rt,hc as Jt,ib as O,ic as qt,jb as zi,jc as Li,kb as Ji,mb as Po,mc as p,md as $e,na as Do,nb as Y,nc as F,o as di,oa as ji,ob as L,oc as D,od as Io,pa as ci,pc as Nt,pd as on,ra as Me,rc as f,sc as S,sd as Mo,tc as h,u as oi,ud as oe,v as to,va as u,wa as _,wd as re,xb as Vi,xc as dt,za as qi,zd as rn}from"./chunk-2ERDZXCS.js";import"./chunk-WFMAM73Y.js";import{a as Xe,b as Ze,f as _l,h as At,k as si}from"./chunk-SNAKHGZS.js";var _o=_l((Wi,uo)=>{(function(i,s){typeof Wi=="object"&&typeof uo=="object"?uo.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 Wi=="object"?Wi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})("u"<typeof window?Wi:window,(i,s)=>(()=>{"use strict";var e={944:he=>{he.exports=i},984:he=>{he.exports=s}},r={};function t(he){var te=r[he];if(te!==void 0)return te.exports;var Oe=r[he]={exports:{}};return e[he](Oe,Oe.exports,t),Oe.exports}t.n=he=>{var te=he&&he.__esModule?()=>he.default:()=>he;return t.d(te,{a:te}),te},t.d=(he,te)=>{for(var Oe in te)t.o(te,Oe)&&!t.o(he,Oe)&&Object.defineProperty(he,Oe,{enumerable:!0,get:te[Oe]})},t.o=(he,te)=>Object.prototype.hasOwnProperty.call(he,te);var l={};t.d(l,{default:()=>ul});var y=t(944),T=t.n(y),je=t(984),vt=t.n(je);let ni={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 Ai(he,te,Oe,Ie,et,ee){let Be=(ee-te)*(Oe-he)-(Ie-te)*(et-he);return Be>0||!(Be<0)}function Gi(he,te,Oe,Ie,et,ee,Be,ke){return Ai(he,te,et,ee,Be,ke)!==Ai(Oe,Ie,et,ee,Be,ke)&&Ai(he,te,Oe,Ie,et,ee)!==Ai(he,te,Oe,Ie,Be,ke)}let{animObject:eo}=T(),{format:ol}=vt(),{setOptions:rl}=T(),{composed:ll}=T(),{boxIntersectLine:Co,intersectRect:pl}={boxIntersectLine:function(he,te,Oe,Ie,et,ee,Be,ke){return Gi(he,te,he+Oe,te,et,ee,Be,ke)||Gi(he+Oe,te,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te+Ie,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te,he,te+Ie,et,ee,Be,ke)},intersectRect:function(he,te){return!(te.left>he.right||te.right<he.left||te.top>he.bottom||te.bottom<he.top)}},{addEvent:go,extend:xo,fireEvent:ml,isNumber:Hi,pick:Kt,pushUnique:sl,syncTimeout:dl}=T();function pi(he,te,Oe,Ie,et){let ee=he.chart,Be=he.options.label||{},ke=Kt(Be.onArea,!!he.area),tt=ke||Be.connectorAllowed,ct=ee.boxesToAvoid,St=Number.MAX_VALUE,ut=Number.MAX_VALUE,Ct,ht,It,Tt,ot,rt,Le;for(rt=0;ct&&rt<ct.length;rt+=1)if(pl(ct[rt],{left:te,right:te+Ie.width,top:Oe,bottom:Oe+Ie.height}))return!1;for(rt=0;rt<ee.series.length;rt+=1){let ft=ee.series[rt],De=ft.interpolatedPoints&&[...ft.interpolatedPoints];if(ft.visible&&De){let lt=ee.plotHeight/10;for(let pt=ee.plotTop;pt<=ee.plotTop+ee.plotHeight;pt+=lt)De.unshift({chartX:ee.plotLeft,chartY:pt}),De.push({chartX:ee.plotLeft+ee.plotWidth,chartY:pt});for(Le=1;Le<De.length;Le+=1){if(De[Le].chartX>=te-16&&De[Le-1].chartX<=te+Ie.width+16){if(Co(te,Oe,Ie.width,Ie.height,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))return!1;he===ft&&!It&&et&&(It=Co(te-16,Oe-16,Ie.width+32,Ie.height+32,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))}(tt||It)&&(he!==ft||ke)&&(St=Math.min(St,(Tt=te+Ie.width/2-De[Le].chartX)*Tt+(ot=Oe+Ie.height/2-De[Le].chartY)*ot))}if(!ke&&tt&&he===ft&&(et&&!It||St<Math.pow(Be.connectorNeighbourDistance||1,2))){for(Le=1;Le<De.length;Le+=1)(Ct=Math.min(Math.pow(te+Ie.width/2-De[Le].chartX,2)+Math.pow(Oe+Ie.height/2-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2)))<ut&&(ut=Ct,ht=De[Le]);It=!0}}}return(!et||!!It)&&{x:te,y:Oe,weight:St-(ht?ut:0),connectorPoint:ht}}function fo(he){if(this.renderer){let te=this,Oe=eo(te.renderer.globalAnimation).duration;te.labelSeries=[],te.labelSeriesMaxSum=0,te.seriesLabelTimer&&T().clearTimeout(te.seriesLabelTimer),te.series.forEach(function(Ie){let et=Ie.options.label||{},ee=Ie.labelBySeries,Be=ee&&ee.closest,ke=Ie.getColumn("y");et.enabled&&Ie.visible&&(Ie.graph||Ie.area)&&!Ie.boosted&&te.labelSeries&&(te.labelSeries.push(Ie),et.minFontSize&&et.maxFontSize&&ke.length&&(Ie.sum=ke.reduce((tt,ct)=>(tt||0)+(ct||0),0),te.labelSeriesMaxSum=Math.max(te.labelSeriesMaxSum||0,Ie.sum||0)),he.type==="load"&&(Oe=Math.max(Oe,eo(Ie.options.animation).duration)),Be&&(Be[0].plotX!==void 0?ee.animate({x:Be[0].plotX+Be[1],y:Be[0].plotY+Be[2]}):ee.attr({opacity:0})))}),te.seriesLabelTimer=dl(function(){let Ie,et;te.series&&te.labelSeries&&(te.boxesToAvoid=[],Ie=te.labelSeries||[],et=te.boxesToAvoid,te.series.forEach(ee=>(ee.points||[]).forEach(Be=>(Be.dataLabels||[]).forEach(ke=>{let{width:tt,height:ct}=ke.getBBox(),St=(ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),ut=(ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);et.push({left:St,top:ut,right:St+tt,bottom:ut+ct})}))),Ie.forEach(function(ee){let Be=ee.options.label||{};ee.interpolatedPoints=(function(ke){let tt,ct,St,ut,Ct;if(!ke.xAxis&&!ke.yAxis)return;let ht=ke.points,It=[],Tt=ke.graph||ke.area,ot=Tt&&Tt.element,rt=ke.chart.inverted,Le=ke.xAxis,ft=ke.yAxis,De=rt?ft.pos:Le.pos,lt=rt?Le.pos:ft.pos,pt=rt?Le.len:ft.len,Ii=rt?ft.len:Le.len,_t=Kt((ke.options.label||{}).onArea,!!ke.area),qe=ft.getThreshold(ke.options.threshold),yt={},zt=rt?"chartCenterX":"chartCenterY";function ai(it){let gt=Math.round((it.plotX||0)/8)+","+Math.round((it.plotY||0)/8);yt[gt]||(yt[gt]=1,It.push(it))}if(ke.getPointSpline&&ot&&ot.getPointAtLength&&!_t&&ht.length<(ke.chart.plotSizeX||0)/16){let it=Tt.toD&&Tt.attr("d");for(Tt.toD&&Tt.attr({d:Tt.toD}),St=ot.getTotalLength(),tt=0;tt<St;tt+=16){let Mt=ot.getPointAtLength(tt),Vt=rt?Ii-Mt.y:Mt.x,Bt=rt?pt-Mt.x:Mt.y;ai({chartX:De+Vt,chartY:lt+Bt,plotX:Vt,plotY:Bt})}it&&Tt.attr({d:it});let gt=ht[ht.length-1].pos();ai({chartX:De+(gt?.[0]||0),chartY:lt+(gt?.[1]||0)})}else{let it;for(tt=0,St=ht.length;tt<St;tt+=1){let gt=ht[tt],[Mt,Vt]=gt.pos()||[],{plotHigh:Bt}=gt;if(Hi(Mt)&&Hi(Vt)){let wt={plotX:Mt,plotY:Vt,chartX:De+Mt,chartY:lt+Vt};if(_t&&(Bt&&(wt.plotY=Bt,wt.chartY=lt+Bt),rt?wt.chartCenterX=De+Ii-((Bt||gt.plotY||0)+Kt(gt.yBottom,qe))/2:wt.chartCenterY=lt+((Bt||Vt)+Kt(gt.yBottom,qe))/2),it&&(ct=Math.max(Math.abs(wt.chartX-it.chartX),Math.abs(wt.chartY-it.chartY)))>16&&ct<999)for(Ct=1,ut=Math.ceil(ct/16);Ct<ut;Ct+=1)ai({chartX:it.chartX+(wt.chartX-it.chartX)*(Ct/ut),chartY:it.chartY+(wt.chartY-it.chartY)*(Ct/ut),[zt]:(it[zt]||0)+((wt[zt]||0)-(it[zt]||0))*(Ct/ut),plotX:(it.plotX||0)+(Mt-(it.plotX||0))*(Ct/ut),plotY:(it.plotY||0)+(Vt-(it.plotY||0))*(Ct/ut)});ai(wt),it=wt}}}return It})(ee),et.push(...Be.boxesToAvoid||[])}),te.series.forEach(function(ee){let Be=ee.options.label;if(!Be||!ee.xAxis&&!ee.yAxis)return;let ke="highcharts-color-"+Kt(ee.colorIndex,"none"),tt=!ee.labelBySeries,ct=Be.minFontSize,St=Be.maxFontSize,ut=te.inverted,Ct=ut?ee.yAxis.pos:ee.xAxis.pos,ht=ut?ee.xAxis.pos:ee.yAxis.pos,It=te.inverted?ee.yAxis.len:ee.xAxis.len,Tt=te.inverted?ee.xAxis.len:ee.yAxis.len,ot=ee.interpolatedPoints,rt=Kt(Be.onArea,!!ee.area),Le=[],ft=ee.getColumn("x"),De,lt,pt,Ii,_t,qe,yt=ee.labelBySeries,zt,ai,it;function gt(Yt,Ot,Qt){let Yi=Math.max(Ct,Kt(ai,-1/0)),mi=Math.min(Ct+It,Kt(it,1/0));return Yt>Yi&&Yt<=mi-Qt.width&&Ot>=ht&&Ot<=ht+Tt-Qt.height}function Mt(){yt&&(ee.labelBySeries=yt.destroy())}if(rt&&!ut&&(zt=[ee.xAxis.toPixels(ft[0]),ee.xAxis.toPixels(ft[ft.length-1])],ai=Math.min.apply(Math,zt),it=Math.max.apply(Math,zt)),ee.visible&&!ee.boosted&&ot){if(!yt){var Vt,Bt,wt;let Yt=ee.name;if(typeof Be.format=="string"?Yt=ol(Be.format,ee,te):Be.formatter&&(Yt=Be.formatter.call(ee)),ee.labelBySeries=yt=te.renderer.label(Yt,0,0,"connector",0,0,Be.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+ke),!te.renderer.styledMode){let Ot=typeof ee.color=="string"?ee.color:"#666666";yt.css(xo({color:rt?te.renderer.getContrast(Ot):Ot},Be.style||{})),yt.attr({opacity:+!!te.renderer.forExport,stroke:ee.color,"stroke-width":1})}ct&&St&&yt.css({fontSize:(Vt=ee,Bt=ct,wt=St,Bt+(Vt.sum||0)/(Vt.chart.labelSeriesMaxSum||0)*(wt-Bt)+"px")}),yt.attr({padding:0,zIndex:3}).add()}for((De=yt.getBBox()).width=Math.round(De.width),_t=ot.length-1;_t>0;_t-=1)rt?gt(lt=(ot[_t].chartCenterX??ot[_t].chartX)-De.width/2,pt=(ot[_t].chartCenterY??ot[_t].chartY)-De.height/2,De)&&(qe=pi(ee,lt,pt,De)):(gt(lt=ot[_t].chartX+3,pt=ot[_t].chartY-De.height-3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX+3,pt=ot[_t].chartY+3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX-De.width-3,pt=ot[_t].chartY+3,De)&&(qe=pi(ee,lt,pt,De,!0)),qe&&Le.push(qe),gt(lt=ot[_t].chartX-De.width-3,pt=ot[_t].chartY-De.height-3,De)&&(qe=pi(ee,lt,pt,De,!0))),qe&&Le.push(qe);if(Be.connectorAllowed&&!Le.length&&!rt)for(lt=Ct+It-De.width;lt>=Ct;lt-=16)for(pt=ht;pt<ht+Tt-De.height;pt+=16)(Ii=pi(ee,lt,pt,De,!0))&&Le.push(Ii);if(Le.length){Le.sort((Ot,Qt)=>Qt.weight-Ot.weight),qe=Le[0],(te.boxesToAvoid||[]).push({left:qe.x,right:qe.x+De.width,top:qe.y,bottom:qe.y+De.height});let Yt=Math.sqrt(Math.pow(Math.abs(qe.x-(yt.x||0)),2)+Math.pow(Math.abs(qe.y-(yt.y||0)),2));if(Yt&&ee.labelBySeries){let Ot,Qt={opacity:+!!te.renderer.forExport,x:qe.x,y:qe.y},Yi={opacity:1};Yt<=10&&(Yi={x:Qt.x,y:Qt.y},Qt={}),tt&&(Ot=eo(ee.options.animation),Ot.duration*=.2),ee.labelBySeries.attr(xo(Qt,{anchorX:qe.connectorPoint&&(qe.connectorPoint.plotX||0)+Ct,anchorY:qe.connectorPoint&&(qe.connectorPoint.plotY||0)+ht})).animate(Yi,Ot),ee.options.kdNow=!0,ee.buildKDTree();let mi=ee.searchPoint({chartX:qe.x,chartY:qe.y},!0);mi&&(yt.closest=[mi,qe.x-(mi.plotX||0),qe.y-(mi.plotY||0)])}}else Mt()}else Mt()}),ml(te,"afterDrawSeriesLabels"))},te.renderer.forExport||!Oe?0:Oe)}}function cl(he,te,Oe,Ie,et){let ee=et&&et.anchorX,Be=et&&et.anchorY,ke,tt,ct=Oe/2;return Hi(ee)&&Hi(Be)&&(ke=[["M",ee,Be]],(tt=te-Be)<0&&(tt=-Ie-tt),tt<Oe&&(ct=ee<he+Oe/2?tt:Oe-tt),Be>te+Ie?ke.push(["L",he+ct,te+Ie]):Be<te?ke.push(["L",he+ct,te]):ee<he?ke.push(["L",he,te+Ie/2]):ee>he+Oe&&ke.push(["L",he+Oe,te+Ie/2])),ke||[]}let So=T();({compose:function(he,te){sl(ll,"SeriesLabel")&&(go(he,"load",fo),go(he,"redraw",fo),te.prototype.symbols.connector=cl,rl({plotOptions:{series:{label:ni}}}))}}).compose(So.Chart,So.SVGRenderer);let ul=T();return l.default})())});var gl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Dr=i=>({ID:i});function xl(i,s){if(i&1){let e=b();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function fl(i,s){if(i&1&&(n(0,"div",2),C(1,xl,3,0,"button",3),a()),i&2){let e=m();o(),g(e.roleService.global.Export?1:-1)}}function Sl(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),E(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(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 S(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 hl(i,s){i&1&&(n(0,"th",32),p(1,"@ Cost"),a())}function yl(i,s){i&1&&(n(0,"th",33),p(1,"@ Price"),a(),n(2,"th",30),p(3,"Disc."),a(),n(4,"th",33),p(5,"Total"),a())}function Dl(i,s){if(i&1&&(n(0,"small",40),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function vl(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 Tl(i,s){if(i&1&&(n(0,"span",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+x(2,1,e.Profit)," ")}}function wl(i,s){if(i&1&&(n(0,"i",43),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Pl(i,s){if(i&1&&(n(0,"span",44),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Fl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function bl(i,s){if(i&1&&(E(0,"div",45),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",x(1,1,e.SONote),be)}}function El(i,s){if(i&1&&(n(0,"div")(1,"a",51),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",J(2,Dr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Il(i,s){if(i&1&&(n(0,"div",46),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PaymentStateLabel," ")}}function Ml(i,s){if(i&1&&(n(0,"i",54),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Vl(i,s){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e==null?null:e.UnitCost)," ")}}function Bl(i,s){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),a(),n(3,"th",61)(4,"div",62),p(5),a(),n(6,"div",63),p(7),d(8,"amountFraction"),a()(),n(9,"th",60),p(10),d(11,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,4,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?"":x(8,6,e==null?null:e.DiscountAmount)," "),o(3),D(" ",x(11,8,e==null?null:e.Total)," ")}}function Ll(i,s){if(i&1&&(n(0,"tr",49)(1,"th",28)(2,"div",52)(3,"span",53),p(4),a(),C(5,Ml,2,1,"i",54),E(6,"small",55),a()(),n(7,"th",56),p(8),a(),n(9,"th",57),p(10),d(11,"quantityFraction"),a(),n(12,"th",58),p(13),a(),C(14,Vl,3,3,"th",59),C(15,Bl,12,10),a()),i&2){let e=s.$implicit,r=m(4);o(4),F(e==null?null:e.Name),o(),g((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,be),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",x(11,8,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),g(r.roleService.product.Cost?14:-1),o(),g(r.roleService.report.Price?15:-1)}}function Ol(i,s){if(i&1&&(n(0,"tr")(1,"th",64),p(2),a(),n(3,"th",65),p(4),a(),n(5,"th",66),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(" ",x(7,3,e.Amount)," ")}}function Rl(i,s){if(i&1&&(n(0,"table",50),V(1,Ol,8,5,"tr",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Aggregate)}}function kl(i,s){if(i&1&&(n(0,"div")(1,"div",35)(2,"div",36)(3,"div")(4,"a",37)(5,"span",38),p(6),a()(),n(7,"span"),p(8),d(9,"date"),E(10,"small",39),d(11,"date"),C(12,Dl,3,4,"small",40),a()(),n(13,"div",41)(14,"strong",42),p(15),C(16,vl,3,4,"span"),a(),C(17,Tl,3,3,"span",40),C(18,wl,2,1,"i",43),C(19,Pl,2,1,"span",44),C(20,Fl,2,0,"span"),a(),C(21,bl,2,3,"div",45),C(22,El,3,4,"div"),a(),C(23,Il,2,1,"div",46),a(),n(24,"table",47)(25,"tbody",48),V(26,Ll,16,10,"tr",49,R),a()(),C(28,Rl,3,0,"table",50),a()),i&2){let e=s.$implicit,r=m(3);o(4),c("routerLink",I(22,gl))("queryParams",J(23,Dr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,16,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,19,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",be),o(2),g(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),g(r.isNotEmpty(e.SalesName)?16:-1),o(),g(r.roleService.report.Profit&&r.roleService.report.Price&&r.roleService.product.Cost?17:-1),o(),g(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),g(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),g(e.SONote&&e.PromotionCoupon?20:-1),o(),g(r.isNotEmpty(e.SONote)?21:-1),o(),g(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(),g(r.roleService.report.Price?23:-1),o(3),B(e.Items),o(2),g(r.roleService.report.Price?28:-1)}}function Wl(i,s){if(i&1&&(n(0,"tr")(1,"td",34),V(2,kl,29,25,"div",null,R),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7),o(),B(e.infiniteList)}}function Nl(i,s){if(i&1&&(n(0,"tr")(1,"td"),E(2,"app-empty-state"),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7)}}function Al(i,s){if(i&1){let e=b();n(0,"span",73),P("click",function(){u(e);let t=m(3);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function Gl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),F(x(2,1,e.listTotal))}}function Hl(i,s){if(i&1){let e=b();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(3);return t.currentRowCount=100,_(t.NextPage(!0))}),E(2,"i",76),p(3," Next 100"),a()()}}function Yl(i,s){if(i&1){let e=b();n(0,"div",67)(1,"button",68),P("click",function(){u(e);let t=m(2);return _(t.showSummaryReport())}),p(2," View Report Summary "),a()(),n(3,"div",69)(4,"div",70)(5,"div",71),p(6),d(7,"number"),C(8,Al,3,0,"span",72),C(9,Gl,3,3,"span"),p(10),a()(),C(11,Hl,4,0,"div",2),a()}if(i&2){let e=m(2);o(6),D(" Showing 1 - ",x(7,5,e.infiniteList.length)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),g(e.nextPageDisabled?11:-1)}}function Ql(i,s){if(i&1&&(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(),C(14,hl,2,0,"th",32),C(15,yl,6,0),a()(),n(16,"tbody"),C(17,Wl,4,1,"tr")(18,Nl,3,1,"tr"),a()()(),C(19,Yl,12,7),a()()),i&2){let e=m();o(14),g(e.roleService.product.Cost?14:-1),o(),g(e.roleService.report.Price?15:-1),o(2),g(e.infiniteList.length>0?17:18),o(2),g((e.infiniteList==null?null:e.infiniteList.length)>0?19:-1)}}var In=class i extends ve{constructor(e,r,t,l,y,T,je,vt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,y);this.csvConverter=t;this.datePipe=l;this.activatedRoute=y;this.matDialog=T;this.toaster=je;this.roleService=vt}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,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.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 M.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(y=>y):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(z,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(xr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(Ae),w(K),w(Ue),w(j))};static \u0275cmp=O({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[Y],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,"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%"],[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"],[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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,fl,2,1,"div",2),a(),n(3,"filters"),L(4,Sl,46,26,"ng-template",null,0,A),a(),C(6,Ql,20,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,U,ze,Ti,Ko,vn,re,oe,Z,ne],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 Mn=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 sn;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(xi),w(fi))};static \u0275cmp=O({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 S(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 S(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:[Ye,k,W,Ke,Xt],encapsulation:2})};var Ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vr=i=>({ID:i}),Kl=()=>["/menu/Contacts/Contact/Customers/Info"],zl=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function Jl(i,s){if(i&1){let e=b();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",4),p(2," Export "),a()}}function Xl(i,s){if(i&1){let e=b();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 S(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",7),h("ngModelChange",function(t){u(e);let l=m();return S(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",8),h("ngModelChange",function(t){u(e);let l=m();return S(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",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),kt(18),n(19,"div",11)(20,"div",12)(21,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",14)(23,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",16)(25,"div",12)(26,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(27,"div",14)(28,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),Wt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",22),h("ngModelChange",function(t){u(e);let l=m();return S(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.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Zl(i,s){i&1&&(n(0,"th",36),p(1,"DATE"),a())}function $l(i,s){i&1&&(n(0,"th",37),p(1," CUSTOMER "),a())}function ep(i,s){i&1&&(n(0,"th",38),p(1,"JOIN DATE"),a())}function tp(i,s){i&1&&(n(0,"th",39),p(1,"GROUPS"),a())}function ip(i,s){i&1&&(n(0,"th",40),p(1," SALES PERSON "),a())}function np(i,s){i&1&&(n(0,"th",41),p(1," COST "),a())}function ap(i,s){i&1&&(n(0,"th",44),p(1," GROSS "),a())}function op(i,s){i&1&&(n(0,"th",45),p(1," SALES "),a())}function rp(i,s){i&1&&(n(0,"th",46),p(1," TAX "),a())}function lp(i,s){i&1&&(n(0,"th",47),p(1," SURCHARGE "),a())}function pp(i,s){i&1&&(n(0,"th",48),p(1," TOTAL "),a())}function mp(i,s){if(i&1&&(C(0,ap,2,0,"th",44),C(1,op,2,0,"th",45),C(2,rp,2,0,"th",46),C(3,lp,2,0,"th",47),C(4,pp,2,0,"th",48)),i&2){let e=m(3);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function sp(i,s){i&1&&(n(0,"th",42),p(1," PAYMENT "),a())}function dp(i,s){i&1&&E(0,"br")}function cp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function up(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 _p(i,s){if(i&1&&(n(0,"td")(1,"a",52),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",I(3,Kl))("queryParams",J(4,vr,e.CustomerID)),o(),F(e.CustomerName)}}function Cp(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 gp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function xp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function fp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function Sp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function hp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function yp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Dp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SurchargeAmount)," ")}}function vp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SalesNSurcharge)," ")}}function Tp(i,s){if(i&1&&(C(0,Sp,3,3,"td",53),C(1,hp,3,3,"td",53),C(2,yp,3,3,"td",54),C(3,Dp,3,3,"td",53),C(4,vp,3,3,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function wp(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;c("ngClass",mt(2,zl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Pp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",49),p(5),a(),C(6,dp,1,0,"br"),C(7,cp,2,1,"i"),a(),C(8,up,7,8,"td"),C(9,_p,3,6,"td"),C(10,Cp,3,4,"td"),C(11,gp,2,1,"td"),C(12,xp,2,1,"td"),C(13,fp,3,3,"td",50),C(14,Tp,5,5),C(15,wp,2,6,"td",51),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",I(14,Ul))("queryParams",J(15,vr,e.ID)),o(),D(" ",e.Number," "),o(),g(e.Note?6:-1),o(),g(e.Note?7:-1),o(),g(r.column.Date.selected?8:-1),o(),g(r.column.Customer.selected?9:-1),o(),g(r.column.JoinDate.selected?10:-1),o(),g(r.column.Groups.selected?11:-1),o(),g(r.column.SalesPerson.selected?12:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.role&&r.column.Cost.selected?13:-1),o(),g(r.roleService.report.Price?14:-1),o(),g(r.column.Payment.selected?15:-1)}}function Fp(i,s){i&1&&E(0,"td",56)}function bp(i,s){i&1&&E(0,"td",56)}function Ep(i,s){i&1&&E(0,"td",56)}function Ip(i,s){i&1&&(n(0,"td",57),p(1," Total: "),a())}function Mp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Vp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Bp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Lp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Op(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Rp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function kp(i,s){if(i&1&&(C(0,Ip,2,0,"td",57),C(1,Mp,4,6,"td",50),C(2,Vp,4,6,"td",53),C(3,Bp,4,6,"td",53),C(4,Lp,4,6,"td",54),C(5,Op,4,6,"td",53),C(6,Rp,4,6,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected?0:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?1:-1),o(),g(e.column.Gross.selected?2:-1),o(),g(e.column.Sales.selected?3:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?4:-1),o(),g(e.data.SurchargeVisible?5:-1),o(),g(e.column.Total.selected?6:-1)}}function Wp(i,s){if(i&1&&(n(0,"tfoot",43)(1,"tr",55),E(2,"td",56),C(3,Fp,1,0,"td",56),C(4,bp,1,0,"td",56),C(5,Ep,1,0,"td",56),C(6,kp,7,7),a()()),i&2){let e=m(3);o(3),g(e.column.Date.selected?3:-1),o(),g(e.column.Customer.selected?4:-1),o(),g(e.column.SalesPerson.selected?5:-1),o(),g(e.roleService.report.Price?6:-1)}}function Np(i,s){if(i&1){let e=b();n(0,"div",24)(1,"table",32),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",33)(3,"tr")(4,"th",34),p(5,"OUTLET"),a(),n(6,"th",35),p(7,"NUMBER"),a(),C(8,Zl,2,0,"th",36),C(9,$l,2,0,"th",37),C(10,ep,2,0,"th",38),C(11,tp,2,0,"th",39),C(12,ip,2,0,"th",40),C(13,np,2,0,"th",41),C(14,mp,5,5),C(15,sp,2,0,"th",42),a()(),n(16,"tbody"),V(17,Pp,16,17,"tr",null,R),a(),C(19,Wp,7,4,"tfoot",43),a()()}if(i&2){let e=m(2);o(8),g(e.column.Date.selected?8:-1),o(),g(e.column.Customer.selected?9:-1),o(),g(e.column.JoinDate.selected?10:-1),o(),g(e.column.Groups.selected?11:-1),o(),g(e.column.SalesPerson.selected?12:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.role&&e.column.Cost.selected?13:-1),o(),g(e.roleService.report.Price?14:-1),o(),g(e.column.Payment.selected?15:-1),o(2),B(e.infiniteList),o(2),g(e.data?19:-1)}}function Ap(i,s){if(i&1){let e=b();n(0,"span",58),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",59),p(2,"?"),a()()}}function Gp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Hp(i,s){if(i&1){let e=b();n(0,"a",60),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",61),p(2," Next"),a()}}function Yp(i,s){if(i&1){let e=b();n(0,"a",62),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),E(1,"i",63),p(2," Show All"),a()}}function Qp(i,s){if(i&1&&(n(0,"content")(1,"div",23),C(2,Np,20,9,"div",24),n(3,"div",25)(4,"div",26)(5,"div",27),p(6),d(7,"number"),C(8,Ap,3,0,"span",28),C(9,Gp,3,3,"span"),p(10),a()(),n(11,"div",29),C(12,Hp,3,0,"a",30),C(13,Yp,3,0,"a",31),a()()()()),i&2){let e=m();o(2),g(e.data?2:-1),o(4),D(" Showing 1 - ",x(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),g(!e.nextPageDisabled&&!e.goToLast?12:-1),o(),g(!e.nextPageDisabled&&!e.goToLast?13:-1)}}var Vn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=y}roleService=Me(j);columnService=Me(st);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",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},Total:{selected:!0,name:"Total",role:this.roleService.report.Price},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=>M.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(Mn,{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 y=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(),y);case"number":return this.compare(t.Number,l.Number,y);case"date":return this.compare(t.Date,l.Date,y);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),y);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),y);case"cost":return this.compare(t.Cost,l.Cost,y);case"gross":return this.compare(t.Gross,l.Gross,y);case"sales":return this.compare(t.Sales,l.Sales,y);case"tax":return this.compare(t.Tax,l.Tax,y);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,y);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,y);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,y);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,y);case"groups":return this.compare(t.Groups,l.Groups,y);default:return 0}})}openExportModal(){this._matDialog.open(z,{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=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.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");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ae),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[Y],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[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"],["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"],[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","customStyle"],[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","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,"container-fluid","mt-5"],[1,"table-responsive"],[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 more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["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"],["mat-sort-header","customer"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],[1,"border-top"],["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"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-start",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"table","table-borderless"],[1,"empty-column"],[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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Jl,3,0,"button",2),a(),n(3,"filters"),L(4,Xl,44,26,"ng-template",null,0,A),a(),C(6,Qp,14,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,$e,Q,$,X,Ye,k,W,ie,le,ge,Ke,we,Ge,Di,U,ze,me,re,oe,Z],encapsulation:2})};var jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Up=()=>["/menu/Products/Setup/Brand/Brand_Form"],Kp=i=>({ID:i}),zp=(i,s)=>({BrandID:i,Name:s});function Jp(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Xp(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"p-treeSelect",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectetOutletGroup,t)||(l.selectetOutletGroup=t),_(t)}),P("ngModelChange",function(t){u(e);let l=m();return _(l.onSelectOutletGroup(t))})("onClear",function(){u(e);let t=m();return _(t.onClearOutletGroup())}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(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,"Category"),a(),n(9,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(13,"div",15)(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(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("disabled",(e.pageData.Filter==null||e.pageData.Filter.ListIDs==null?null:e.pageData.Filter.ListIDs.length)>0)("options",e.pageData.Options==null?null:e.pageData.Options.OutletGroupsTree),f("ngModel",e.selectetOutletGroup),c("showClear",!0),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),o(2),f("date",e.pageData.Filter.To)}}function Zp(i,s){i&1&&(n(0,"th",21),p(1," Cost "),a())}function $p(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Gross))}}function em(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",27),p(3),a()(),n(4,"td",28)(5,"a",29),p(6),d(7,"quantityFraction"),a()(),n(8,"td",28),p(9),d(10,"amountFraction"),a(),C(11,$p,3,3,"td",28),n(12,"td",28),p(13),d(14,"amountFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),n(18,"td",28),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",I(20,Up))("queryParams",J(21,Kp,e.ID)),o(),D("",e.BrandName," "),o(2),c("queryParams",xe(23,zp,e.ID,e.BrandName)),o(),F(x(7,10,e.Quantity)),o(3),F(x(10,12,e.Cost)),o(2),g(r.roleService.product.Cost?11:-1),o(2),F(x(14,14,e.NetSales)),o(3),F(x(17,16,e.Tax)),o(3),F(x(20,18,e.SalesTax))}}function tm(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(x(3,4,v(2,1,e.data.Data,"Cost")))}}function im(i,s){if(i&1){let e=b();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,"Brand"),a(),n(6,"th",20),p(7," Quantity "),a(),C(8,Zp,2,0,"th",21),n(9,"th",22),p(10," Gross "),a(),n(11,"th",23),p(12," Sales "),a(),n(13,"th",24),p(14," Tax "),a(),n(15,"th",25),p(16," Sales + Tax "),a()()(),n(17,"tbody"),V(18,em,21,26,"tr",null,R),a(),n(20,"tfoot")(21,"tr",26)(22,"td"),p(23,"Total"),a(),n(24,"td"),p(25),d(26,"sum"),a(),C(27,tm,4,6,"td"),n(28,"td"),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td"),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td"),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td"),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()}if(i&2){let e=m();o(8),g(e.roleService.product.Cost?8:-1),o(10),B(e.data.Data),o(7),F(v(26,7,e.data.Data,"Quantity")),o(2),g(e.roleService.product.Cost?27:-1),o(2),F(x(31,13,v(30,10,e.data.Data,"Gross"))),o(4),F(x(35,18,v(34,15,e.data.Data,"NetSales"))),o(4),F(x(39,23,v(38,20,e.data.Data,"Tax"))),o(4),F(x(43,28,v(42,25,e.data.Data,"SalesTax")))}}var Bn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=y;this.matDialog=T}selectetOutletGroup;preInitList(){super.preInitList(),this.pageData.Options=Ze(Xe({},this.pageData.Options),{Categories:[]})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=JSON.parse(JSON.stringify(this.originalData));return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";return this.compare(t[e.active],l[e.active],y)})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e.key,this.selectetOutletGroup=e}onClearOutletGroup(){this.pageData.Filter.OutletGroupID=null}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ae),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[Y],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"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","placeholder","Choose Outlet",1,"tree-select-as-filter",3,"ngModelChange","onClear","disabled","options","ngModel","showClear"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["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","BrandName",2,"width","250px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before","matTooltip","Brand Cost Cost",1,"flex-right",2,"width","120px"],["mat-sort-header","Gross","arrowPosition","before","matTooltip","Brand Gross Gross",1,"flex-right",2,"width","120px"],["mat-sort-header","NetSales","arrowPosition","before","matTooltip","Brand Net Sales",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Brand Net Tax",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesTax","arrowPosition","before","matTooltip","Brand Net Sales + Tax",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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Jp,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"),L(14,Xp,15,14,"ng-template",null,0,A),a(),n(16,"content"),C(17,im,44,30,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(8,jp)),o(3),c("routerLink",I(9,qp)),o(6),g(t.data?17:-1))},dependencies:[H,Q,X,k,W,ie,le,ge,ce,U,$o,me,Z,ne],encapsulation:2})};function nm(i,s){if(i&1){let e=b();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),E(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 Ln=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(xi),w(fi))};static \u0275cmp=O({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),V(3,nm,4,3,"label",null,R),a()()()),e&2&&(c("title","Edit Groups"),o(3),B(r.options))},dependencies:[Xt],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],mm=()=>["/menu/Contacts/Contact/Customers/Info"],sm=i=>({ID:i});function dm(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function cm(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 um(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function _m(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Cm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function gm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function xm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function fm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Sm(i,s){if(i&1){let e=b();n(0,"span")(1,"span"),p(2),a(),n(3,"a",42),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 hm(i,s){if(i&1&&(n(0,"span"),V(1,Sm,5,2,"span",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Groups)}}function ym(i,s){if(i&1){let e=b();n(0,"a",42),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 Dm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Orders)," ")}}function vm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Quantity)," ")}}function Tm(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function wm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function Pm(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Fm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales+e.Tax)," ")}}function bm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",35),p(3),a(),n(4,"div",36),C(5,hm,3,0,"span"),C(6,ym,2,0,"a",37),a()(),n(7,"td")(8,"span",38),p(9),a()(),C(10,Dm,3,3,"td",39),C(11,vm,3,3,"td",39),C(12,Tm,3,3,"td",40),C(13,wm,3,3,"td",39),C(14,Pm,3,3,"td",41),C(15,Fm,3,3,"td",39),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",I(13,mm))("queryParams",J(14,sm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),g(e.Groups.length>0?5:-1),o(),g(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(),g(r.column.Orders.selected?10:-1),o(),g(r.column.QTY.selected?11:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),g(r.column.Sales.selected?13:-1),o(),g(r.column.Tax.selected?14:-1),o(),g(r.column.SalesNTax.selected?15:-1)}}function Em(i,s){if(i&1&&(n(0,"tbody",28),V(1,bm,16,16,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.infiniteList)}}function Im(i,s){if(i&1){let e=b();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))}),n(1,"i",44),p(2,"?"),a()()}}function Mm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Vm(i,s){if(i&1){let e=b();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",46),p(2," Next"),a()}}function Bm(i,s){if(i&1){let e=b();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(),C(9,um,2,0,"th",22),C(10,_m,2,0,"th",23),C(11,Cm,2,0,"th",24),C(12,gm,2,0,"th",25),C(13,xm,2,0,"th",26),C(14,fm,2,0,"th",27),a()(),C(15,Em,3,0,"tbody",28),a()(),n(16,"div",29)(17,"div",30)(18,"div",31),p(19),d(20,"number"),L(21,Im,3,0,"span",32)(22,Mm,3,3,"span",33),p(23),a()(),L(24,Vm,3,0,"a",34),a()()}if(i&2){let e=m();o(9),g(e.column.Orders.selected?9:-1),o(),g(e.column.QTY.selected?10:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),g(e.column.Sales.selected?12:-1),o(),g(e.column.Tax.selected?13:-1),o(),g(e.column.SalesNTax.selected?14:-1),o(),g(e.data.Data?15:-1),o(4),D(" Showing 1 - ",x(20,12,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)}}var On=class i extends Zt{constructor(e,r,t,l,y){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=y}roleService=Me(j);columnService=Me(st);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=wn.maskingField;postInit(e){super.postInit(e),this.maskingFields=M.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(){M.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 y=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Orders":return this.compare(t.Orders,l.Orders,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Sales":return this.compare(t.Sales,l.Sales,y);case"Tax":return this.compare(t.Tax,l.Tax,y);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,y);case"Cost":return this.compare(t.Cost,l.Cost,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(Ln,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let y={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",y).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(z,{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)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[Y],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"],[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"],[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"],[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"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,dm,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),E(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),L(24,cm,16,10,"ng-template",null,0,A),a(),n(26,"content"),C(27,Bm,25,14,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,am)),o(3),c("routerLink",I(13,om)),o(3),c("routerLink",I(14,rm)),o(3),c("routerLink",I(15,lm)),o(4),c("routerLink",I(16,pm)),o(6),g(t.data?27:-1))},dependencies:[H,on,Q,$,X,Ye,k,W,ie,le,ge,Ke,U,re,Z,ne],encapsulation:2})};var Lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Nm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Am(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Gm(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(x(5,4,e.TotalOrders)),o(3),F(x(8,6,e.TotalCost)),o(3),F(x(11,8,e.TotalAmount))}}function Hm(i,s){if(i&1&&(n(0,"tbody",22),V(1,Gm,12,10,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.data.Data)}}function Ym(i,s){if(i&1){let e=b();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()()(),C(12,Hm,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),g(e.data.Data?12:-1)}}var Rn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;this.datePipe=T}preInitList(){M.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 y=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Nm,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"),L(23,Am,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,Ym,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(11,Lm)),o(3),c("routerLink",I(12,Om)),o(3),c("routerLink",I(13,Rm)),o(3),c("routerLink",I(14,km)),o(3),c("routerLink",I(15,Wm)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z],encapsulation:2})};var Qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function zm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Jm(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Xm(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function Zm(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function $m(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function e0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalOrders))}}function t0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.TotalQuantity)," ")}}function i0(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalAmount))}}function n0(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),C(3,e0,3,3,"td",23),C(4,t0,3,3,"td",23),C(5,i0,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),g(r.column.Orders.selected?3:-1),o(),g(r.column.QTY.selected?4:-1),o(),g(r.column.Amount.selected?5:-1)}}function a0(i,s){if(i&1){let e=b();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(),C(6,Xm,2,0,"th",19),C(7,Zm,2,0,"th",20),C(8,$m,2,0,"th",21),a()(),n(9,"tbody",22),V(10,n0,6,4,"tr",null,R),a()()()}if(i&2){let e=m();o(6),g(e.column.Orders.selected?6:-1),o(),g(e.column.QTY.selected?7:-1),o(),g(e.column.Amount.selected?8:-1),o(2),B(e.data==null?null:e.data.Data)}}var kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.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 y=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(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 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"),L(23,Jm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,a0,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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Qm)),o(3),c("routerLink",I(13,jm)),o(3),c("routerLink",I(14,qm)),o(3),c("routerLink",I(15,Um)),o(3),c("routerLink",I(16,Km)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z,ne],encapsulation:2})};var Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],s0=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],d0=i=>({ID:i}),c0=(i,s,e)=>({From:i,SupplierID:s,To:e});function u0(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function _0(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 C0(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",I(19,s0))("queryParams",J(20,d0,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",x(10,9,e.Quantity)," "),o(3),c("routerLink",I(22,Tr))("queryParams",mt(23,c0,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(" ",x(16,17,e.Total))}}function g0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),E(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),E(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 x0(i,s){if(i&1){let e=b();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"),V(15,C0,17,27,"tr",24,R),a(),C(17,g0,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),B(e.data.Data),o(2),g((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Wn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}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 y=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,y);case"Supplier":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Total":return this.compare(t.Total,l.Total,y);default:return 0}})}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,u0,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"),L(26,_0,16,10,"ng-template",null,0,A),a(),n(28,"content"),C(29,x0,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Tr)),o(3),c("routerLink",I(13,o0)),o(3),c("routerLink",I(14,r0)),o(3),c("routerLink",I(15,l0)),o(3),c("routerLink",I(16,p0)),o(3),c("routerLink",I(17,m0)),o(6),g(t.data?29:-1))},dependencies:[H,Q,$,X,Ye,k,W,le,ge,Ke,U,oe,Z,ne],encapsulation:2})};var wr=At(ei());var h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],P0=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),F0=i=>[i],b0=i=>({ID:i}),E0=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Pr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],I0=(i,s,e)=>({VariantID:i,From:s,To:e}),M0=(i,s,e)=>({ProductID:i,From:s,To:e});function V0(i,s){if(i&1&&(n(0,"a",9),E(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",tn(1,P0,(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 B0(i,s){if(i&1){let e=b();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",12),p(2," Export "),a()}}function L0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function O0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function R0(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Cost Currency"),a(),n(41,"ng-select",28),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectedCurrencyID,t)||(l.selectedCurrencyID=t),_(t)}),L(42,L0,5,2,"ng-template",29)(43,O0,5,2,"ng-template",30),a(),n(44,"h6"),p(45,"Product Type"),a(),n(46,"radio-options",31),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(47,"h6"),p(48,"Multiply Unit Quantity"),a(),n(49,"radio-options",32),h("modelChange",function(t){u(e);let l=m();return S(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),c("items",e.pageData.Options.Currencies),f("ngModel",e.selectedCurrencyID),o(5),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function k0(i,s){if(i&1){let e=b();n(0,"th",54)(1,"div",55)(2,"input",56),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 W0(i,s){if(i&1&&(n(0,"th",57),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function N0(i,s){i&1&&(n(0,"th",58),p(1," On Hand "),a())}function A0(i,s){i&1&&(n(0,"th",59),p(1," Cost "),a())}function G0(i,s){i&1&&(n(0,"th",60),p(1," GROSS "),a())}function H0(i,s){if(i&1&&(n(0,"th",61),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function Y0(i,s){i&1&&(n(0,"th",62),p(1," Tax "),a())}function Q0(i,s){if(i&1&&(n(0,"th",63),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function j0(i,s){i&1&&(n(0,"th",64),p(1," PROFIT "),a())}function q0(i,s){i&1&&(n(0,"th",65),p(1," % "),a())}function U0(i,s){if(i&1){let e=b();n(0,"td")(1,"div",55)(2,"input",77),h("ngModelChange",function(t){u(e);let l=m().$implicit;return S(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 K0(i,s){if(i&1){let e=b();kt(0),n(1,"img",78),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l==null?null:l.ImageURL,t))}),a(),Wt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,Ki)}}function z0(i,s){if(i&1){let e=b();n(0,"a",79)(1,"img",80),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function J0(i,s){if(i&1&&(n(0,"td",81)(1,"a",82),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Fo(4,E0,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(x(3,2,r.Quantity))}}function X0(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.OnHand)," ")}}function Z0(i,s){if(i&1&&(p(0),d(1,"amountFraction")),i&2){let e=m(2).$implicit,r=m(2);Nt(" ",r.primaryCurrency().Symbol," ",x(1,2,e.UnitCost*e.CostCurrencyExchangeRate)," ")}}function $0(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"amountFraction"),E(3,"br"),C(4,Z0,2,4),a()),i&2){let e,r=m().$implicit,t=m(2);o(),Nt(" ",r.CostCurrencySymbol," ",x(2,3,r.UnitCost)," "),o(3),g(r.CostCurrencyID&&r.CostCurrencyID!==((e=t.primaryCurrency())==null?null:e.ID)?4:-1)}}function es(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function ts(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,Pr))("queryParams",mt(12,I0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function is(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,Pr))("queryParams",mt(12,M0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function ns(i,s){if(i&1&&(n(0,"td",81),L(1,ts,5,16,"a",84)(2,is,5,16,"a",84),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function as(i,s){if(i&1&&(n(0,"td",85),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function os(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.SalesNTax)," ")}}function rs(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Profit)," ")}}function ls(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Margin)," ")}}function ps(i,s){if(i&1&&(n(0,"tr",66),L(1,U0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",67)(6,"div",68),L(7,K0,2,1,"ng-container",8)(8,z0,2,1,"a",69),a(),n(9,"div",70)(10,"a",71),p(11),a(),n(12,"small",72),p(13),a()()()(),L(14,J0,4,11,"td",73)(15,X0,3,3,"td",73)(16,$0,5,5,"td",74)(17,es,3,3,"td",73)(18,ns,3,2,"td",73)(19,as,3,3,"td",75)(20,os,3,3,"td",73)(21,rs,3,4,"td",76)(22,ls,3,4,"td",76),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",J(17,F0,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(19,b0,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 ms(i,s){i&1&&E(0,"td",81)}function ss(i,s){i&1&&(n(0,"td",81),p(1," Total : "),a())}function ds(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function cs(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function us(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function _s(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Cs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Sales")))}}function gs(i,s){if(i&1&&(n(0,"td",85)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Tax")))}}function xs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function fs(i,s){if(i&1&&(n(0,"td",86),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(" ",x(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function Ss(i,s){if(i&1&&(n(0,"td",86),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(" ",x(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function hs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",87),E(2,"td",81),L(3,ms,1,0,"td",73)(4,ss,2,0,"td",73)(5,ds,4,6,"td",73)(6,cs,4,6,"td",73)(7,us,4,6,"td",74)(8,_s,4,6,"td",73)(9,Cs,5,6,"td",88)(10,gs,5,6,"td",75)(11,xs,5,6,"td",88)(12,fs,5,10,"td",76)(13,Ss,7,16,"td",76),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 ys(i,s){if(i&1){let e=b();n(0,"content")(1,"div",36)(2,"div",37)(3,"table",38),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",39)(5,"tr"),L(6,k0,3,1,"th",40),n(7,"th",41),p(8,"No"),a(),n(9,"th",42),p(10,"Name"),a(),L(11,W0,2,1,"th",43)(12,N0,2,0,"th",44)(13,A0,2,0,"th",45)(14,G0,2,0,"th",46)(15,H0,2,1,"th",47)(16,Y0,2,0,"th",48)(17,Q0,2,1,"th",49)(18,j0,2,0,"th",50)(19,q0,2,0,"th",51),a()(),n(20,"tbody"),L(21,ps,23,21,"tr",52),a(),L(22,hs,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",53),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 Nn=class i extends ve{constructor(e,r,t,l,y,T,je){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,y);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=y;this.matDialog=T;this.bigPicture=je}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Me(j);columnService=Me(st);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:!1,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=at([]);queryParams=at(null);primaryCurrency=at(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=Ze(Xe({},this.data),{Data:e.Data.map(t=>Ze(Xe({},t),{checked:!1}))}),this.primaryCurrency.set(e.PrimaryCurrency);for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=Ze(Xe({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=Ze(Xe({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>Ze(Xe({},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;M.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"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.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=Ze(Xe({},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 y=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 M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),y);case"Quantity":return M.compare(t.Quantity,l.Quantity,y);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,y);case"Inventory":return M.compare(t.OnHand,l.OnHand,y);case"Total_Sales":return M.compare(t.Total,l.Total,y);case"Total_Tax":return M.compare(t.Tax,l.Tax,y);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,y);case"ReOrder":return M.compare(t.MinStock,l.MinStock,y);case"Gross":return M.compare(t.Gross,l.Gross,y);case"Margin":return M.compare(t.Margin,l.Margin,y);case"Profit":return M.compare(t.Profit,l.Profit,y);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(z,{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,wr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}showCurrencyExchangeRate(e){return this.primaryCurrency().ID===e}get selectedCurrencyID(){return this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID:this.pageData.Filter.ProductCostCurrencyID}set selectedCurrencyID(e){this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID=e:this.pageData.Filter.ProductCostCurrencyID=e}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ue),w(Ae),w(K),w(bn))};static \u0275cmp=O({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[Y],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"],["bindValue","ID","bindLabel","Name",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),L(2,V0,3,7,"a",2),C(3,B0,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"),L(27,R0,50,38,"ng-template",null,0,A),a(),L(29,ys,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(),g(t.roleService.global.Export?3:-1),o(6),c("routerLink",I(14,h0)),o(3),c("routerLink",I(15,y0)),o(3),c("routerLink",I(16,D0)),o(3),c("routerLink",I(17,v0)),o(3),c("routerLink",I(18,T0)),o(3),c("routerLink",I(19,w0)),o(5),c("ngIf",t.data))},dependencies:[H,$e,Io,on,Q,$,X,Lo,k,W,ie,le,ge,we,Ge,ce,U,ze,wi,Si,Uo,me,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ws=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Es=i=>({ID:i}),Is=(i,s)=>s.Name,Ms=(i,s)=>s.ID;function Vs(i,s){if(i&1){let e=b();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",17),p(2," Export "),a()}}function Bs(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(31,"h6"),p(32,"Hide Zero"),a(),n(33,"radio-options",30),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),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),o(3),f("model",e.pageData.Filter.HideZero)}}function Ls(i,s){i&1&&(n(0,"th",31),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Os(i,s){i&1&&(n(0,"th",32),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function Rs(i,s){i&1&&(n(0,"th",32),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function ks(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",dt(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function Ws(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function Ns(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 As(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(" ",x(2,3,e.UnitCost)," ")}}function Gs(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(" ",x(2,3,e.UnitPrice)," ")}}function Hs(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Ys(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function Qs(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",33),p(3),a()(),C(4,Ns,2,3,"td",34),C(5,As,3,5,"td",34),C(6,Gs,3,5,"td",34),V(7,Hs,2,1,"td",14,Bi),C(9,Ys,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",J(7,Es,e.ID)),o(),D(" ",e.Name),o(),g(r.column.code.selected?4:-1),o(),g(r.column.cost&&r.column.cost.selected?5:-1),o(),g(r.column.sales&&r.column.sales.selected?6:-1),o(),B(e.Quantities),o(2),g(r.column.total.selected?9:-1)}}var An=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=y}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(z,{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(G),w(N),w(q),w(K),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[Y],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"],["name","HideZero",3,"modelChange","model"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.submit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Vs,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"),L(26,Bs,34,19,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),C(35,Ls,2,2,"th",11),C(36,Os,2,2,"th",12),C(37,Rs,2,2,"th",12),V(38,ks,2,3,"th",13,Is),C(40,Ws,2,0,"th",14),a()(),n(41,"tbody"),V(42,Qs,10,9,"tr",15,Ms),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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(16,vs)),o(3),c("routerLink",I(17,Ts)),o(3),c("routerLink",I(18,ws)),o(3),c("routerLink",I(19,Ps)),o(3),c("routerLink",I(20,Fs)),o(3),c("routerLink",I(21,bs)),o(12),g(t.column.code.selected?35:-1),o(),g(t.column.cost&&t.column.cost.selected?36:-1),o(),g(t.column.sales&&t.column.sales.selected?37:-1),o(),B(t.data==null?null:t.data.Outlet),o(2),g(t.column.total.selected?40:-1),o(2),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,ce,U,ze,vi,Z],encapsulation:2})};var no=At(ei());var js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Fr=()=>({standalone:!0}),br=()=>({overflow:"visible"}),Xs=i=>[i],Zs=i=>({ID:i});function $s(i,s){if(i&1){let e=b();n(0,"a",14),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",15),p(2," Export"),a()}}function ed(i,s){if(i&1){let e=b();n(0,"div",16)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",17),h("ngModelChange",function(t){u(e);let l=m();return S(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",18),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",19)(8,"div",20)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",22)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(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",I(18,Fr))("contentStyle",I(19,br))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",I(20,Fr))("contentStyle",I(21,br))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function td(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function id(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function nd(i,s){i&1&&(n(0,"th",13)(1,"span",24),p(2," On Hand "),a()())}function ad(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 od(i,s){i&1&&(n(0,"th",13)(1,"span",25),p(2," Total "),a()())}function rd(i,s){if(i&1&&(n(0,"td")(1,"a",27),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",J(3,Xs,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(5,Zs,e.ID)),o(),D(" ",e.Name," ")}}function ld(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function pd(i,s){if(i&1&&(n(0,"td",26)(1,"span",24),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 md(i,s){if(i&1&&(n(0,"td",26),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 sd(i,s){if(i&1&&(n(0,"td",26)(1,"span",25),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 dd(i,s){if(i&1&&(n(0,"tr"),C(1,rd,3,7,"td"),C(2,ld,2,1,"td"),C(3,pd,4,4,"td",26),V(4,md,3,4,"td",26,R),C(6,sd,5,7,"td",26),a()),i&2){let e=m();o(),g(e.column.name.selected?1:-1),o(),g(e.column.code.selected?2:-1),o(),g(e.column.OnHand.selected?3:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?6:-1)}}function cd(i,s){i&1&&E(0,"td")}function ud(i,s){i&1&&(n(0,"td",26),p(1,"Total :"),a())}function _d(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Cd(i,s){if(i&1&&(n(0,"td",26),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 gd(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==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function xd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",28),C(2,cd,1,0,"td"),C(3,ud,2,0,"td",26),C(4,_d,3,4,"td",26),V(5,Cd,3,4,"td",26,R),C(7,gd,4,7,"td",26),a()()),i&2){let e=m();o(2),g(e.column.name.selected?2:-1),o(),g(e.column.code.selected?3:-1),o(),g(e.column.OnHand.selected?4:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?7:-1)}}var Gn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;let T=new Date().getFullYear(),je=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,je)}_toastrService=Me(Ue);columnService=Me(st);years=M.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(z,{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 y=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(),y);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);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,no.default)(this.pageData.Filter.MonthFrom),r=(0,no.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",y=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(y),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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[Y],decls:43,vars:23,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"],["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"],[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"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.onSubmit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,$s,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"),L(26,ed,19,22,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return t.sortData(T)}),n(31,"thead",9)(32,"tr",10),C(33,td,2,0,"th",11),C(34,id,2,0,"th",12),C(35,nd,3,0,"th",13),V(36,ad,2,1,"th",13,R),C(38,od,3,0,"th",13),a()(),n(39,"tbody"),V(40,dd,7,4,"tr",null,R),a(),C(42,xd,8,4,"tfoot"),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(17,js)),o(3),c("routerLink",I(18,qs)),o(3),c("routerLink",I(19,Us)),o(3),c("routerLink",I(20,Ks)),o(3),c("routerLink",I(21,zs)),o(3),c("routerLink",I(22,Js)),o(10),g(t.column.name.selected?33:-1),o(),g(t.column.code.selected?34:-1),o(),g(t.column.OnHand.selected?35:-1),o(),B(t.data==null?null:t.data.MonthlySales),o(2),g(t.column.total.selected?38:-1),o(2),B(t.data==null?null:t.data.Data),o(2),g((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?42:-1))},dependencies:[H,Q,k,W,ie,le,ge,we,ce,U,or,me,re],encapsulation:2})};var fd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Sd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],yd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],vd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Td=i=>[i],wd=i=>({ID:i});function Pd(i,s){if(i&1){let e=b();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",14),p(2," Export"),a()}}function Fd(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 bd(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Ed(i,s){if(i&1&&(n(0,"tr"),E(1,"th")(2,"th"),V(3,bd,2,1,"th",22,R),a()),i&2){let e=m();o(3),B(e.data==null?null:e.data.Outlet)}}function Id(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Md(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",J(3,Td,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",J(5,wd,r[1])),o(),F(r[e])}}function Vd(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Bd(i,s){if(i&1&&(n(0,"td",11),C(1,Md,2,7,"a",23)(2,Vd,1,1),a()),i&2){let e=s.$index;o(),g(e===0?1:2)}}function Ld(i,s){if(i&1&&(n(0,"tr",11),V(1,Bd,3,1,"td",11,R),a()),i&2){let e=s.$implicit,r=m();o(),B(r.getFilteredKeys(e))}}var Hn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Pd,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"),L(26,Fd,16,10,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),C(32,Ed,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),V(38,Id,2,1,"th",12,R),a()(),n(40,"tbody"),V(41,Ld,3,0,"tr",11,R),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,fd)),o(3),c("routerLink",I(13,Sd)),o(3),c("routerLink",I(14,hd)),o(3),c("routerLink",I(15,yd)),o(3),c("routerLink",I(16,Dd)),o(3),c("routerLink",I(17,vd)),o(9),g((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),B(t.data==null?null:t.data.Header),o(3),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,X,k,W,we,ce,U],encapsulation:2})};var Od=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Rd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],kd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Wd=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Ir=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Nd=(i,s,e)=>({CategoryID:i,From:s,To:e}),Ad=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Er=i=>({CategoryID:i});function Gd(i,s){if(i&1){let e=b();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",8),p(2," Export "),a()}}function Hd(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",dt(e.Value)),o(),F(e.Value)}}function Yd(i,s){if(i&1){let e=b();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 S(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",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),L(10,Hd,2,3,"ng-template",13),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(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",15)(16,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(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",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(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",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=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),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Qd(i,s){i&1&&(n(0,"th",33),p(1," Cost "),E(2,"p-treeTableSortIcon",34),a())}function jd(i,s){i&1&&(n(0,"th",35),p(1," Gross "),E(2,"p-treeTableSortIcon",36),a(),n(3,"th",37),p(4," Disc "),E(5,"p-treeTableSortIcon",38),a(),n(6,"th",39),p(7," Sales "),E(8,"p-treeTableSortIcon",40),a())}function qd(i,s){i&1&&(n(0,"th",41),p(1," Profit "),E(2,"p-treeTableSortIcon",42),a(),n(3,"th",43),p(4," % "),E(5,"p-treeTableSortIcon",44),a())}function Ud(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),E(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),E(6,"p-treeTableSortIcon",32),a(),C(7,Qd,3,0,"th",33),C(8,jd,9,0),C(9,qd,6,0),a()),i&2){let e=m(2);o(7),g(e.roleService.product.Cost?7:-1),o(),g(e.roleService.report.Price?8:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?9:-1)}}function Kd(i,s){if(i&1&&(n(0,"td",48)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",dt(e.CostInDirect&&e.Cost?"Direct ("+x(2,3,e.Cost)+") Indirect ("+x(3,5,e.CostInDirect)+")":"")),o(3),F(x(5,7,e.DisplayedCost))}}function zd(i,s){if(i&1&&(n(0,"td",49)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td",50)(7,"a",51),d(8,"number"),d(9,"number"),p(10),d(11,"amountFraction"),a()(),n(12,"td",49)(13,"span",22),d(14,"number"),d(15,"number"),n(16,"a",47),p(17),d(18,"amountFraction"),a()()()),i&2){let e=m().rowData;o(),c("matTooltip",dt(e.GrossIndirect&&e.GrossSales?"Direct ("+x(2,13,e.GrossSales)+") Indirect ("+x(3,15,e.GrossIndirect)+")":"")),o(3),F(x(5,17,e.DisplayedGross)),o(3),c("matTooltip",dt(e.DiscountIndirect&&e.Discount?"Direct ("+x(8,19,e.Discount)+") Indirect ("+x(9,21,e.DiscountIndirect)+")":""))("routerLink",I(31,Ad))("queryParams",J(32,Er,e.ID)),o(3),F(x(11,23,e.DisplayedTotalDiscount)),o(3),c("matTooltip",dt(e.NetSalesIndirect&&e.Sales?"Direct ("+x(14,25,e.Sales)+") Indirect ("+x(15,27,e.NetSalesIndirect)+")":"")),o(3),c("routerLink",I(34,Ir))("queryParams",J(35,Er,e.ID)),o(),F(x(18,29,e.DisplayedNetSales))}}function Jd(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",dt(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("",x(4,9,e.DisplayedPercentage),"%")}}function Xd(i,s){if(i&1&&(n(0,"td",52)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td"),C(7,Jd,5,11,"span",22),a()),i&2){let e=m().rowData,r=m(2);o(),c("matTooltip",dt(e.ProfitInDirect&&e.Profit?"Direct ("+x(2,4,e.Profit)+") Indirect ("+x(3,6,e.ProfitInDirect)+")":"")),o(3),F(x(5,8,e.DisplayedProfit)),o(3),g(r.roleService.report.Profit?7:-1)}}function Zd(i,s){if(i&1&&(n(0,"tr",45)(1,"td"),E(2,"p-treeTableToggler",46),n(3,"a",47),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()(),C(13,Kd,6,9,"td",48),C(14,zd,19,37),C(15,Xd,8,10),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",I(23,Ir))("queryParams",mt(24,Nd,r.ID,v(4,11,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,14,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",dt(r.QuantityIndirect&&r.Quantity?"Direct ("+x(9,17,r.Quantity)+") Indirect ("+x(10,19,r.QuantityIndirect)+")":"")),o(3),F(x(12,21,r.DisplayedQuantity)),o(2),g(t.roleService.product.Cost?13:-1),o(),g(t.roleService.report.Price?14:-1),o(),g(t.roleService.product.Cost&&t.roleService.report.Price&&t.roleService.report.Profit?15:-1)}}function $d(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(2,1,e.data.Aggregate.TotalCost)," ")}}function ec(i,s){if(i&1&&(n(0,"td",56)(1,"a"),p(2),d(3,"amountFraction"),a()(),n(4,"td",54),p(5),d(6,"amountFraction"),a(),n(7,"td",56),p(8),d(9,"amountFraction"),a()),i&2){let e=m(3);o(2),F(x(3,3,e.data.Aggregate.TotalGross)),o(3),D(" ",x(6,5,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",x(9,7,e.data.Aggregate.TotalNetSales)," ")}}function tc(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a(),n(3,"td",54),p(4),d(5,"number"),a()),i&2){let e=m(3);o(),D(" ",x(2,2,e.data.Aggregate.TotalProfit)," "),o(3),D(" ",x(5,4,e.data.Aggregate.TotalPercentage),"% ")}}function ic(i,s){if(i&1&&(n(0,"tr",53)(1,"td",54),p(2,"Total :"),a(),n(3,"td",54),p(4),d(5,"quantityFraction"),a(),C(6,$d,3,3,"td",55),C(7,ec,10,9),C(8,tc,6,6),a()),i&2){let e=m(2);o(4),D(" ",x(5,4,e.data.Aggregate.TotalQuantity)," "),o(2),g(e.roleService.product.Cost?6:-1),o(),g(e.roleService.report.Price?7:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?8:-1)}}function nc(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),L(3,Ud,10,3,"ng-template",25)(4,Zd,16,28,"ng-template",26)(5,ic,9,6,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",I(4,Wd))}}var Yn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[Y],decls:20,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,"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"],["name","render-ProductType",3,"modelChange","model","options"],["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"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["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"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],[1,"text-danger",2,"width","120px"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[1,"text-success",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Gd,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"),L(17,Yd,32,17,"ng-template",null,0,A),a(),C(19,nc,6,5,"content"),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),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,Od)),o(3),c("routerLink",I(11,Rd)),o(3),c("routerLink",I(12,kd)),o(5),g(t.data?19:-1))},dependencies:[H,Q,$,X,k,W,ie,we,Ge,lr,Wo,dr,pr,mr,sr,ce,U,ze,Si,re,oe,Z,ne],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 ac=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],oc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function lc(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function pc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 mc(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 sc(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function dc(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Value))}}function cc(i,s){if(i&1&&(n(0,"td"),C(1,sc,2,1,"span"),C(2,dc,3,3,"span"),a()),i&2){let e=s.$implicit;o(),g(e.Key=="Category"?1:-1),o(),g(e.Key!="Category"?2:-1)}}function uc(i,s){if(i&1&&(n(0,"tr"),V(1,cc,3,2,"td",null,R),a()),i&2){let e=s.$implicit;o(),B(e)}}function _c(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",x(2,1,e))}}function Cc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),V(4,_c,3,3,"td",null,R),a()()),i&2){let e=m(2);o(4),B(e.data.Sum)}}function gc(i,s){if(i&1){let e=b();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"),V(4,mc,2,2,"th",19,R),a()(),n(6,"tbody"),V(7,uc,3,0,"tr",null,R),a(),C(9,Cc,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),B(e.data.Dataheader),o(3),B(e.data.Data),o(2),g(e.data.Data.length>0?9:-1)}}var Qn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}openExportModal(){this.matDialog.open(z,{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 y=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let je=t.find(ni=>ni.Key===[this.data.Dataheader[T]].toString()).Value,vt=l.find(ni=>ni.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(je,vt,y)}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,lc,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"),L(17,pc,16,9,"ng-template",null,0,A),a(),n(19,"content"),C(20,gc,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),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,ac)),o(3),c("routerLink",I(11,oc)),o(3),c("routerLink",I(12,rc)),o(6),g(t.data?20:-1))},dependencies:[H,Q,X,k,W,le,ge,Ge,ce,U,Z],encapsulation:2})};var xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function hc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 yc(i,s){if(i&1&&(n(0,"div",6),E(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var jn=class i extends pe{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.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(G),w(N))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(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"),L(16,hc,10,6,"ng-template",null,0,A),a(),n(18,"content"),C(19,yc,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",I(8,xc)),o(3),c("routerLink",I(9,fc)),o(3),c("routerLink",I(10,Sc)),o(6),g(t.data?19:-1))},dependencies:[H,Q,$,k,W,ti],encapsulation:2})};var Dc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function vc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 Tc(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),E(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),E(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 qn=class i extends ve{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 y={name:l.Name+": "+l.Description,y:l.Transaction};t.push(y)}),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,y){return l+"<br/>"+y.series.name+": <b>"+y.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),E(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),L(6,vc,13,9,"ng-template",null,0,A),a(),C(8,Tc,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",I(6,Dc)),o(6),g(t.data?8:-1))},dependencies:[H,Q,$,X,k,W,ti,Ft,U],encapsulation:2})};function wc(i,s){if(i&1){let e=b();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function Pc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Fc(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(x(3,5,e.Visitor)),o(3),F(x(6,7,e.Orders)),o(3),F(x(9,9,e.TotalVisitor)),o(3),F(x(12,11,e.Sales)),o(3),F(x(15,13,e.Sales/(e.Visitor*e.Orders)))}}function bc(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"),V(15,Fc,16,15,"tr",null,R),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),B(e.data.Data),o(7),F(x(24,7,v(23,4,e.data.Data,"Orders"))),o(4),F(x(28,12,v(27,9,e.data.Data,"TotalVisitor"))),o(4),F(x(32,17,v(31,14,e.data.Data,"Sales"))),o(4),F(x(35,19,e.getSpendingPerPersonSum(e.data.Data)))}}var Un=class i extends pe{constructor(e,r,t,l,y){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,wc,3,0,"a",2),a(),n(3,"filters"),L(4,Pc,10,6,"ng-template",null,0,A),a(),n(6,"content"),C(7,bc,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),g(t.data?7:-1))},dependencies:[H,X,k,W,U,me,re,Z],encapsulation:2})};var Ec=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Ic(i,s){if(i&1){let e=b();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",16),p(2," Export "),a()}}function Mc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Vc(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Bc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Revenue))}}function Lc(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(),C(20,Bc,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(x(5,7,e.Count)),o(3),F(x(8,9,e.Quantity)),o(3),F(x(11,11,e.Sales)),o(3),F(x(15,15,x(14,13,e.Tax))),o(4),F(x(19,19,x(18,17,e.SalesWithTax))),o(3),g(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Oc(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(x(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(z,{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(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Ic,3,0,"a",2),n(3,"a",3),E(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),L(7,Mc,10,6,"ng-template",null,0,A),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(),C(26,Vc,2,0,"th",10),a()(),n(27,"tbody"),V(28,Lc,21,21,"tr",null,R),a(),n(30,"tfoot")(31,"tr",11),E(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(),C(55,Oc,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",I(42,Ec)),o(23),g(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),B(t.data==null?null:t.data.Data),o(6),F(x(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(x(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(x(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(x(49,33,x(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(x(54,40,x(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),g(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[H,Q,X,k,W,U,me,zo,re,Z,ne],encapsulation:2})};var ro=At(ei());var Rc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],oo=(i,s)=>({From:i,To:s}),kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Wc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Nc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 Ac(i,s){if(i&1&&(n(0,"content")(1,"div",11),E(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var zn=class i extends pe{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=M.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 M.getDatesInRange(s,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=(0,ro.default)(s.from).format("YYYY-MM-DD[T]00:00:00"),this.pageData.Filter.To=(0,ro.default)(s.to).format("YYYY-MM-DD[T]00:00:00")}static \u0275fac=function(e){return new(e||i)(w(G),w(N),w(Ae))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[Y],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=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return r.searchFromPageOne()}),h("filterChange",function(y){return u(t),S(r.pageData.Filter,y)||(r.pageData.Filter=y),_(y)}),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"),L(16,Nc,13,11,"ng-template",null,0,A),a(),C(18,Ac,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",I(11,Rc))("queryParams",xe(12,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(15,kc))("queryParams",xe(16,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(19,Wc))("queryParams",xe(20,oo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),g(r.data?18:-1))},dependencies:[H,Q,$,k,W,Ft,Lt,ce,U],encapsulation:2})};var Yc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Xn=(()=>{class i{constructor(){this.dateChange=nn(),this.width=_i(),this.minDate=M.MinDate}ngOnInit(){}setMonthAndYear(e,r){let t=null;e&&(t=e.toDate(),t.setHours(0,0,0,0)),this.date=t,this.dateChange.emit(t),r.close()}onDateChange(e){let r=null;e&&(r=e.toDate()),this.date=r,this.dateChange.emit(r)}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="outside")}}chosenYearHandler(e,r){let t=new Date(e.getFullYear(),0,1);this.date=t.toISOString(),r.close()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=O({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:[1,"width"]},outputs:{dateChange:"dateChange"},features:[en([{provide:un,useClass:Fn,deps:[cn,ar]},{provide:_n,useValue:Yc}])],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(r,t){if(r&1){let l=b();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(T){return t.onDateChange(T.value)}),a(),E(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(T){u(l);let je=Jt(4);return _(t.chosenYearHandler(T,je))})("monthSelected",function(T){u(l);let je=Jt(4);return _(t.setMonthAndYear(T,je))})("opened",function(){return t.onOpenDatepicker()})("closed",function(){return t.onCloseDatepicker()}),a()()}if(r&2){let l=Jt(4);qt("width",t.width()||100,"%"),o(),c("matDatepicker",l)("value",t.date==t.minDate?null:t.date),o(),c("for",l)}},dependencies:[Gt,hn,Ci,xn,fn,Sn,gi,Dn,gn,Cn,yn],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
2
  `],encapsulation:2})}}return i})();var jc=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function qc(i,s){if(i&1){let e=b();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 S(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 S(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 S(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 S(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 S(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 S(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 S(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 Uc(i,s){if(i&1&&(n(0,"div",5),E(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var Zn=class i extends pe{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};let r=this.data.ProfitTaxCalculationConfig;this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let t,l="",y=Math.abs(this.total);if(r==0){let T=e.find(je=>je?.serieType==="Tax");T&&(y=y-T.data[this.x])}return y>999&&y<1e10?(l="K",t=(y/1e3).toFixed(0)):y>=1e10?(l="M",t=(y/1e6).toFixed(0)):y<999&&(t=y.toString()),this.total<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+l}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let t=this.series.chart.series,l=this.point?.stackTotal;if(r==0){let vt=t.find(ni=>ni.userOptions?.serieType==="Tax");vt&&(l=l-vt.points[this.point.index]?.y)}t=t.filter(vt=>this.series?.name==vt?.name);let y=[],T="",je=this.point.index;return t.forEach(vt=>{vt.options.stack===this.point.series.options.stack&&(y=vt.name.split(" "),T+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(l)}</br>${y[0]}: