dealpos 25.42.1 → 25.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/browser/{chunk-ROQHG6JX.js → chunk-2CU7XQYN.js} +1 -1
  2. package/browser/{chunk-YIKW3UR6.js → chunk-2L54CRB2.js} +1 -1
  3. package/browser/{chunk-ZWBEJM56.js → chunk-2O3TR26P.js} +8 -8
  4. package/browser/{chunk-ZTHPT62A.js → chunk-3A4C23H5.js} +1 -1
  5. package/browser/{chunk-XJ25XOBC.js → chunk-3JVX2T6M.js} +1 -1
  6. package/browser/{chunk-GHA3WIJU.js → chunk-3RWVYWJF.js} +1 -1
  7. package/browser/{chunk-AAI6JWC5.js → chunk-47W54HJY.js} +1 -1
  8. package/browser/{chunk-55U65HSD.js → chunk-4ODUHZAT.js} +1 -1
  9. package/browser/{chunk-NJS6IQX6.js → chunk-4R4W625N.js} +1 -1
  10. package/browser/{chunk-TFE7D7VV.js → chunk-4WW3BBDP.js} +1 -1
  11. package/browser/{chunk-XZWMENTO.js → chunk-4WYJGX5K.js} +1 -1
  12. package/browser/{chunk-RTE36RZ4.js → chunk-4XWCWJZC.js} +1 -1
  13. package/browser/{chunk-5BKBBN4I.js → chunk-53ACYG5V.js} +1 -1
  14. package/browser/{chunk-UU55EO4X.js → chunk-5BZEOCFN.js} +1 -1
  15. package/browser/{chunk-46DETXA6.js → chunk-5OS5VELO.js} +1 -1
  16. package/browser/{chunk-5MPRE3II.js → chunk-6A45AGTK.js} +1 -1
  17. package/browser/{chunk-DLONNLPI.js → chunk-6CQ6XYJG.js} +1 -1
  18. package/browser/{chunk-IC3DZAMU.js → chunk-6G37ZXRX.js} +1 -1
  19. package/browser/{chunk-VIJ7B625.js → chunk-6IQQC2YT.js} +1 -1
  20. package/browser/{chunk-HIKFNCGX.js → chunk-7275MAOI.js} +1 -1
  21. package/browser/{chunk-TLXGEI76.js → chunk-772SQL5I.js} +1 -1
  22. package/browser/chunk-7MYFXXHY.js +1 -0
  23. package/browser/{chunk-WTP4E6M5.js → chunk-7R3X2A2H.js} +1 -1
  24. package/browser/{chunk-5AJG5HDI.js → chunk-7X35YY3T.js} +1 -1
  25. package/browser/{chunk-MQKEWZMW.js → chunk-A3CWPPXF.js} +1 -1
  26. package/browser/{chunk-N6QITTR2.js → chunk-A7PNRSF2.js} +1 -1
  27. package/browser/{chunk-4HEESH5A.js → chunk-AEHOTFB4.js} +1 -1
  28. package/browser/{chunk-RDXTLLRW.js → chunk-AQC5G2DR.js} +1 -1
  29. package/browser/{chunk-5VIFPZ5D.js → chunk-BVVYVR6R.js} +1 -1
  30. package/browser/{chunk-YPFMEFOD.js → chunk-BXAYNP7A.js} +1 -1
  31. package/browser/{chunk-IC7LV3SK.js → chunk-C32V5IHL.js} +1 -1
  32. package/browser/{chunk-EFDAS2KA.js → chunk-CD3BSGAP.js} +1 -1
  33. package/browser/{chunk-VAMTYISE.js → chunk-CKSMLIVU.js} +2 -2
  34. package/browser/{chunk-XHG7GWS5.js → chunk-CRJOVQ56.js} +2 -2
  35. package/browser/{chunk-XZRKMN4V.js → chunk-D5QLS4SZ.js} +1 -1
  36. package/browser/{chunk-SIRUW7U2.js → chunk-DKPNAGIM.js} +1 -1
  37. package/browser/{chunk-RFAAXFT5.js → chunk-DNBZTRXL.js} +1 -1
  38. package/browser/{chunk-HG3CFH36.js → chunk-DNSE6AZ3.js} +1 -1
  39. package/browser/{chunk-KGLFSTLG.js → chunk-DV4MQXAE.js} +1 -1
  40. package/browser/{chunk-I3ZGST4N.js → chunk-EENVAF36.js} +1 -1
  41. package/browser/{chunk-SA6YKTKS.js → chunk-EHV62EGB.js} +3 -3
  42. package/browser/{chunk-XO6RYTAS.js → chunk-EJFVZSWQ.js} +1 -1
  43. package/browser/{chunk-T26KVRGE.js → chunk-EMP32K7Q.js} +1 -1
  44. package/browser/{chunk-BSIHS2EA.js → chunk-EOY5VQKV.js} +2 -2
  45. package/browser/chunk-ERTAWD4X.js +1 -0
  46. package/browser/{chunk-N23TC7B4.js → chunk-FAJUK2PL.js} +1 -1
  47. package/browser/{chunk-5SEFV3QG.js → chunk-FKYUI33J.js} +1 -1
  48. package/browser/{chunk-AY5QZ3W6.js → chunk-FNUNWZ2W.js} +1 -1
  49. package/browser/{chunk-7SC45GNA.js → chunk-G5P4GFMX.js} +1 -1
  50. package/browser/{chunk-QYWAJKFK.js → chunk-GGPT7WIY.js} +1 -1
  51. package/browser/{chunk-LO3FAFDO.js → chunk-GINOZV6C.js} +1 -1
  52. package/browser/{chunk-IYF464XX.js → chunk-GKKKOTYZ.js} +1 -1
  53. package/browser/{chunk-VGPJKK3G.js → chunk-GOZYJRWV.js} +1 -1
  54. package/browser/{chunk-7BNQDGUO.js → chunk-GPP3J3W4.js} +1 -1
  55. package/browser/{chunk-WNVQWJ2T.js → chunk-H66NFIQQ.js} +1 -1
  56. package/browser/{chunk-UMT5IJRJ.js → chunk-H6LHYTUN.js} +1 -1
  57. package/browser/{chunk-MCQ4J3UT.js → chunk-HA6VJJLI.js} +1 -1
  58. package/browser/{chunk-WPFMJVWU.js → chunk-HAGFCQCM.js} +1 -1
  59. package/browser/{chunk-NPUWXK3K.js → chunk-HGADEAZ4.js} +1 -1
  60. package/browser/{chunk-5EJERM6E.js → chunk-HGM42PVN.js} +1 -1
  61. package/browser/{chunk-EGIDHMPA.js → chunk-HQQWO76P.js} +1 -1
  62. package/browser/{chunk-F6Z777C5.js → chunk-HYZX6TUF.js} +1 -1
  63. package/browser/chunk-I6NIUHOQ.js +1 -0
  64. package/browser/{chunk-5BE43QU3.js → chunk-IJ3Y6CA4.js} +1 -1
  65. package/browser/{chunk-N47VNTBG.js → chunk-IQ26VFNR.js} +1 -1
  66. package/browser/{chunk-N5UW2RHA.js → chunk-IQ4IMICT.js} +1 -1
  67. package/browser/{chunk-JKLJ4KAW.js → chunk-IRIE5DZT.js} +1 -1
  68. package/browser/{chunk-FLCAZ4FS.js → chunk-ITLMINSX.js} +1 -1
  69. package/browser/{chunk-MGQ5I7BK.js → chunk-IU526HWZ.js} +1 -1
  70. package/browser/chunk-JU5FQANB.js +1 -0
  71. package/browser/{chunk-TBHZV7EF.js → chunk-JYNN4IZB.js} +1 -1
  72. package/browser/{chunk-WRBZW62O.js → chunk-K7ON3WKW.js} +1 -1
  73. package/browser/{chunk-MH6ADXRE.js → chunk-KBO5VO7S.js} +1 -1
  74. package/browser/{chunk-UECAH6V7.js → chunk-LQ3Q52LD.js} +1 -1
  75. package/browser/{chunk-RIRZVGFR.js → chunk-LWDGMGFV.js} +1 -1
  76. package/browser/chunk-MW6BE5UI.js +1 -0
  77. package/browser/{chunk-4MOSTNVA.js → chunk-NII66FBK.js} +2 -2
  78. package/browser/chunk-NM2P4KR5.js +1 -0
  79. package/browser/{chunk-4E2KYPJT.js → chunk-NOQM2VPB.js} +1 -1
  80. package/browser/{chunk-AZO64X7U.js → chunk-NXXNEU5Q.js} +1 -1
  81. package/browser/{chunk-7WNL4VON.js → chunk-O3NKN7KT.js} +1 -1
  82. package/browser/{chunk-6OOS5QHG.js → chunk-OAY4ZDTS.js} +1 -1
  83. package/browser/{chunk-YWGXM2C3.js → chunk-OG45AMIC.js} +1 -1
  84. package/browser/{chunk-2YMLZZTQ.js → chunk-OSSHGIDA.js} +1 -1
  85. package/browser/{chunk-UOWOBHQL.js → chunk-P6LA3P5N.js} +1 -1
  86. package/browser/{chunk-KCZNKMQH.js → chunk-PDKNFOY7.js} +1 -1
  87. package/browser/chunk-PNQGP25W.js +1 -0
  88. package/browser/{chunk-U4U76CXH.js → chunk-PRBPKAI4.js} +1 -1
  89. package/browser/{chunk-YAWVVMMS.js → chunk-PZANARAM.js} +1 -1
  90. package/browser/{chunk-X2WGP6SP.js → chunk-Q5IKPX3P.js} +1 -1
  91. package/browser/{chunk-IW63ASKB.js → chunk-Q7GDNJAI.js} +3 -3
  92. package/browser/{chunk-OIQL44PV.js → chunk-QCEQZT7E.js} +1 -1
  93. package/browser/{chunk-WM2AITL6.js → chunk-QCXWKQ7Z.js} +1 -1
  94. package/browser/{chunk-ZSOLQ2F4.js → chunk-QFO3KUMD.js} +1 -1
  95. package/browser/{chunk-YPOODN5H.js → chunk-QJ4LGJCR.js} +1 -1
  96. package/browser/{chunk-UY6FY532.js → chunk-QPXWIIQK.js} +1 -1
  97. package/browser/{chunk-R3KCKK52.js → chunk-R7Y776E5.js} +1 -1
  98. package/browser/{chunk-W4UISTRM.js → chunk-SEXQYEXV.js} +1 -1
  99. package/browser/{chunk-Z56AQWHN.js → chunk-SHMXCJ6Q.js} +1 -1
  100. package/browser/{chunk-BEPFMRGE.js → chunk-SHPUXNKO.js} +1 -1
  101. package/browser/{chunk-PVDNKSRC.js → chunk-SIH5NVFR.js} +1 -1
  102. package/browser/{chunk-6CAS42OB.js → chunk-SV4HJFAL.js} +1 -1
  103. package/browser/{chunk-5ZIFEEGI.js → chunk-T5HYNGEA.js} +1 -1
  104. package/browser/{chunk-OZ5JEMRA.js → chunk-TDO7VOF5.js} +1 -1
  105. package/browser/{chunk-XYZNPGYI.js → chunk-THXV6YJP.js} +1 -1
  106. package/browser/{chunk-STUDNF4L.js → chunk-TIX624OU.js} +1 -1
  107. package/browser/{chunk-T2IJ4MCB.js → chunk-TQZQYUFG.js} +1 -1
  108. package/browser/{chunk-PAXXDG73.js → chunk-TRUZ46QL.js} +1 -1
  109. package/browser/{chunk-ADE4IPMV.js → chunk-TSBV5MA4.js} +1 -1
  110. package/browser/{chunk-FOWSNZZX.js → chunk-TU4O5BX3.js} +1 -1
  111. package/browser/{chunk-H3ARLDNZ.js → chunk-TUQ4INQ4.js} +1 -1
  112. package/browser/{chunk-JUT3PXG2.js → chunk-TZ74SUXJ.js} +1 -1
  113. package/browser/{chunk-HFCVE2EL.js → chunk-UE53BLCC.js} +1 -1
  114. package/browser/{chunk-ZJ23VRN3.js → chunk-UEQT5HE5.js} +1 -1
  115. package/browser/{chunk-5NDP4IKK.js → chunk-UQP7S73H.js} +1 -1
  116. package/browser/{chunk-D5K5VZVN.js → chunk-V52QD5BS.js} +1 -1
  117. package/browser/{chunk-B4HMFP42.js → chunk-VD4QQDNI.js} +1 -1
  118. package/browser/{chunk-RK5QSVFP.js → chunk-VGNMBCUC.js} +1 -1
  119. package/browser/{chunk-ENTVT5C2.js → chunk-VKJIDCM7.js} +1 -1
  120. package/browser/{chunk-TVEGYRXE.js → chunk-VSF6PYZW.js} +1 -1
  121. package/browser/{chunk-GNAF5D23.js → chunk-W7R2NCKA.js} +2 -2
  122. package/browser/{chunk-ITQF6HII.js → chunk-W7Z44R3C.js} +1 -1
  123. package/browser/{chunk-EGQ2HW7A.js → chunk-XBMOSDDE.js} +1 -1
  124. package/browser/{chunk-EKKU5TMC.js → chunk-XGGQUHUR.js} +1 -1
  125. package/browser/{chunk-5Y67S5BV.js → chunk-XPEGAYJO.js} +1 -1
  126. package/browser/{chunk-PGWC5FQQ.js → chunk-Y6VMIGXC.js} +1 -1
  127. package/browser/{chunk-5HJ6VGWE.js → chunk-Z5HBVHYO.js} +1 -1
  128. package/browser/{chunk-PDJ7PMBB.js → chunk-ZFXZABWG.js} +14 -14
  129. package/browser/{chunk-YN74XRON.js → chunk-ZH7IWOYT.js} +1 -1
  130. package/browser/{chunk-YQL4ALTP.js → chunk-ZHIGBBGN.js} +2 -2
  131. package/browser/chunk-ZOIQWHQE.js +1 -0
  132. package/browser/{chunk-SZPU2EUQ.js → chunk-ZSE5MOHQ.js} +1 -1
  133. package/browser/index.html +2 -2
  134. package/browser/{main-SZ6HFSZZ.js → main-C7YDPF2T.js} +2 -2
  135. package/package.json +1 -1
  136. package/browser/chunk-5EKTXVHQ.js +0 -1
  137. package/browser/chunk-KPXHDKIY.js +0 -1
  138. package/browser/chunk-KTBBWEI2.js +0 -1
  139. package/browser/chunk-O47TK53N.js +0 -1
  140. package/browser/chunk-OEARSIZR.js +0 -1
  141. package/browser/chunk-QMRUEU6Q.js +0 -1
  142. package/browser/chunk-STIS4QW6.js +0 -1
  143. package/browser/chunk-ZRCTLVL4.js +0 -1
@@ -1,14 +1,14 @@
1
- import{a as ni,b as sr}from"./chunk-NVWJ6HZD.js";import{a as ur,b as _r}from"./chunk-SEFALU4U.js";import{a as gr}from"./chunk-5BKBBN4I.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as cr}from"./chunk-KHILQH3P.js";import{a as Gt,b as dr}from"./chunk-5NDP4IKK.js";import"./chunk-YAFVFDTG.js";import{a as mr}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-W7I2T4SZ.js";import{a as he}from"./chunk-AY5QZ3W6.js";import{a as Ye}from"./chunk-C2CGBWBH.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as vt}from"./chunk-OXQJYOVG.js";import{a as Lo}from"./chunk-5HX73JZ3.js";import{b as No}from"./chunk-YPOODN5H.js";import"./chunk-SIRUW7U2.js";import{a as yn}from"./chunk-AAI6JWC5.js";import"./chunk-DAIHPIA2.js";import{a as pr}from"./chunk-BXQFYW4R.js";import{a as ar,b as or,d as rr,g as lr}from"./chunk-AZO64X7U.js";import"./chunk-BYXBJQAS.js";import{a as yi}from"./chunk-XKUQPHUA.js";import"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Wo}from"./chunk-T26KVRGE.js";import{a as Zo,b as $o,c as er,d as tr,e as ir,f as nr}from"./chunk-ZSOLQ2F4.js";import"./chunk-B5SDXVDR.js";import"./chunk-HIKFNCGX.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Oi,b as Jo,c as Sn,d as K,e as Si}from"./chunk-IC3DZAMU.js";import{a as cn,b as fi}from"./chunk-YPFMEFOD.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-DLONNLPI.js";import"./chunk-YEDKRNXU.js";import"./chunk-T2IJ4MCB.js";import"./chunk-7QWJJPNG.js";import{c as ko,d as De,e as hn}from"./chunk-TVEGYRXE.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as X}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-PAXXDG73.js";import{a as ae,b as ge,c as Oo}from"./chunk-FLCAZ4FS.js";import{a as bt,b as Xo}from"./chunk-HMER2IC5.js";import{d as Uo,f as fe}from"./chunk-MCQ4J3UT.js";import{a as Ko,b as zo,c as Q}from"./chunk-6CAS42OB.js";import{b as q}from"./chunk-JUT3PXG2.js";import{a as ne}from"./chunk-D5K5VZVN.js";import{a as Bo}from"./chunk-MGQ5I7BK.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-ADE4IPMV.js";import"./chunk-5VIFPZ5D.js";import"./chunk-5JJSLRVS.js";import{c as Ao}from"./chunk-LO3FAFDO.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Go,c as Qe}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as qo}from"./chunk-RK5QSVFP.js";import{b as W}from"./chunk-KGLFSTLG.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Ro,u as Ci,v as ei,w as _n}from"./chunk-EFDAS2KA.js";import{b as pe,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as Yo,C as ti,K as xi,N as jo,g as oe,o as Ho,s as gn,z as Qo}from"./chunk-46DETXA6.js";import{a as un,d as z}from"./chunk-XYB3YDKL.js";import"./chunk-6ZN7JR6K.js";import"./chunk-GIKR6Y2K.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Mo,b as Vo}from"./chunk-VFTGIP5A.js";import{a as Eo}from"./chunk-LE3BKIDY.js";import{a as Bi}from"./chunk-2FWFPV5I.js";import{la as Fo,ma as Zi,ua as bo}from"./chunk-EEEAUYZ6.js";import{F as At,G as Xi,a as vo,b as wo,c as ke,h as B,l as To,o as L,q as Po,s as Io}from"./chunk-RVXZOIFQ.js";import"./chunk-OZ5JEMRA.js";import"./chunk-4E2KYPJT.js";import{a as V,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-YAWVVMMS.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as Nt,E as ri,Eb as za,Fa as Gi,Fc as M,Gb as Ei,Hb as Mi,I as Fi,Ib as n,Jb as a,K as po,Kb as F,Kc as xo,Lb as se,M as mo,Ma as mt,Mb as ce,Mc as Ui,Nb as fo,Nc as ho,Ob as I,Od as Oe,Pc as Xa,Q as Ni,Qb as P,Qc as So,Qd as zi,Rb as s,Rd as A,Td as Vi,Ub as dt,Va as Pe,Vd as Ke,Wa as Hi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ua,ad as yo,cd as Ki,db as D,dc as Ze,ec as p,ed as ee,fa as kt,fc as T,gc as v,gd as ie,hc as Xt,ia as so,ib as uo,ja as co,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,na as Ge,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as st,u as qa,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as _o,wc as Co,wd as Do,xb as bi,za as Ka,zb as go,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as ll,g as Qt}from"./chunk-7DCB7DB2.js";var no=ll((ub,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{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:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-l)-(Ee-f)*(xt-l);return Vt>0||!(Vt<0)}function t(l,f,w,Ee,xt,ut,Vt,Wt){return r(l,f,xt,ut,Vt,Wt)!==r(w,Ee,xt,ut,Vt,Wt)&&r(l,f,w,Ee,xt,ut)!==r(l,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(l,f,w,Ee,xt,ut,Vt,Wt){return t(l,f,l+w,f,xt,ut,Vt,Wt)||t(l+w,f,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f+Ee,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f,l,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,xt){let{animObject:ut}=r,{format:Vt}=t,{setOptions:Wt}=l,{composed:tl}=f,{boxIntersectLine:ao,intersectRect:il}=Ee,{addEvent:oo,extend:ro,fireEvent:nl,isNumber:ki,pick:Ut,pushUnique:al,syncTimeout:ol}=xt;function pi(ct,Me,at,we,Pt){let it=ct.chart,$=ct.options.label||{},ze=Ut($.onArea,!!ct.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,It=Number.MAX_VALUE,ht,_t,gt,Kt,Ft,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(il(lt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let ot=it.series[Xe],Ve=ot.interpolatedPoints&&[...ot.interpolatedPoints];if(ot.visible&&Ve){let Ue=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ue)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(be=1;be<Ve.length;be+=1){if(Ve[be].chartX>=Me-16&&Ve[be-1].chartX<=Me+we.width+16){if(ao(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;ct===ot&&!gt&&Pt&&(gt=ao(Me-16,at-16,we.width+32,we.height+32,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))}(je||gt)&&(ct!==ot||ze)&&(Bt=Math.min(Bt,(Kt=Me+we.width/2-Ve[be].chartX)*Kt+(Ft=at+we.height/2-Ve[be].chartY)*Ft))}if(!ze&&je&&ct===ot&&(Pt&&!gt||Bt<Math.pow($.connectorNeighbourDistance||1,2))){for(be=1;be<Ve.length;be+=1)(ht=Math.min(Math.pow(Me+we.width/2-Ve[be].chartX,2)+Math.pow(at+we.height/2-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2)))<It&&(It=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?It:0),connectorPoint:_t}}function lo(ct){if(this.renderer){let Me=this,at=ut(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&xt.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Pt=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Pt.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Pt.minFontSize&&Pt.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,je)=>(ze||0)+(je||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),ct.type==="load"&&(at=Math.max(at,ut(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ol(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Pt=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(je=>{let{width:lt,height:Bt}=je.getBBox(),It=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:It,top:ht,right:It+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,It,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Kt=[],Ft=je.graph||je.area,Xe=Ft&&Ft.element,be=je.chart.inverted,ot=je.xAxis,Ve=je.yAxis,Ue=be?Ve.pos:ot.pos,$e=be?ot.pos:Ve.pos,Dt=be?ot.len:Ve.len,Ii=be?Ve.len:ot.len,ft=Ut((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},zt=be?"chartCenterX":"chartCenterY";function oi(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Kt.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&&gt.length<(je.chart.plotSizeX||0)/16){let nt=Ft.toD&&Ft.attr("d");for(Ft.toD&&Ft.attr({d:Ft.toD}),It=Xe.getTotalLength(),lt=0;lt<It;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Ii-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;oi({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&Ft.attr({d:nt});let St=gt[gt.length-1].pos();oi({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,It=gt.length;lt<It;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(ki(Lt)&&ki(Ct)){let rt={plotX:Lt,plotY:Ct,chartX:Ue+Lt,chartY:$e+Ct};if(ft&&(pt&&(rt.plotY=pt,rt.chartY=$e+pt),be?rt.chartCenterX=Ue+Ii-((pt||St.plotY||0)+Ut(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+Ut(St.yBottom,Ne))/2),nt&&(Bt=Math.max(Math.abs(rt.chartX-nt.chartX),Math.abs(rt.chartY-nt.chartY)))>16)for(_t=1,ht=Math.ceil(Bt/16);_t<ht;_t+=1)oi({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[zt]:(nt[zt]||0)+((rt[zt]||0)-(nt[zt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});oi(rt),nt=rt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+Ut($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,It=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,Ft=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=Ut(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Ii,ft,Ne,wt=$.labelBySeries,zt,oi,nt;function St(Ct,pt,rt){let Wi=Math.max(_t,Ut(oi,-1/0)),mi=Math.min(_t+Kt,Ut(nt,1/0));return Ct>Wi&&Ct<=mi-rt.width&&pt>=gt&&pt<=gt+Ft-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!wt){let Ct=$.name;if(typeof ze.format=="string"?Ct=Vt(ze.format,$,we):ze.formatter&&(Ct=ze.formatter.call($)),$.labelBySeries=wt=we.renderer.label(Ct,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+je),!we.renderer.styledMode){let pt=typeof $.color=="string"?$.color:"#666666";wt.css(ro({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&It&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(It-Bt)+"px"}),wt.attr({padding:0,zIndex:3}).add()}for((Ue=wt.getBBox()).width=Math.round(Ue.width),ft=Xe.length-1;ft>0;ft-=1)be?St($e=(Xe[ft].chartCenterX??Xe[ft].chartX)-Ue.width/2,Dt=(Xe[ft].chartCenterY??Xe[ft].chartY)-Ue.height/2,Ue)&&(Ne=pi($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Kt-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+Ft-Ue.height;Dt+=16)(Ii=pi($,$e,Dt,Ue,!0))&&ot.push(Ii);if(ot.length){ot.sort((pt,rt)=>rt.weight-pt.weight),Ne=ot[0],(we.boxesToAvoid||[]).push({left:Ne.x,right:Ne.x+Ue.width,top:Ne.y,bottom:Ne.y+Ue.height});let Ct=Math.sqrt(Math.pow(Math.abs(Ne.x-(wt.x||0)),2)+Math.pow(Math.abs(Ne.y-(wt.y||0)),2));if(Ct&&$.labelBySeries){let pt,rt={opacity:we.renderer.forExport?1:0,x:Ne.x,y:Ne.y},Wi={opacity:1};Ct<=10&&(Wi={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(ro(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(Wi,pt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);mi&&(wt.closest=[mi,Ne.x-(mi.plotX||0),Ne.y-(mi.plotY||0)])}}else Lt()}else Lt()}),nl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function rl(ct,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<ct+at/2?je:at-je),$>Me+we?ze.push(["L",ct+lt,Me+we]):$<Me?ze.push(["L",ct+lt,Me]):it<ct?ze.push(["L",ct,Me+we/2]):it>ct+at&&ze.push(["L",ct+at,Me+we/2])),ze||[]}return{compose:function(ct,Me){al(tl,"SeriesLabel")&&(oo(ct,"load",lo),oo(ct,"redraw",lo),Me.prototype.symbols.connector=rl,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var fr=(i,c)=>({"text-success":i,"text-danger":c});function pl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),v(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function ml(i,c){if(i&1){let e=I();n(0,"span",8),P("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),F(1,"i",9),a()}}function sl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),v(" ",C(8,2,e.Cost)," "),o(4),v(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function cl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,fr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,fr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function dl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),F(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),F(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,pl,4,4,"ng-container",6),d(25,"async"),g(26,ml,2,0,"ng-template",null,0,M),a(),F(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),F(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),F(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),F(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),F(72,"td"),a(),g(73,sl,13,7,"ng-container",3)(74,cl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),T(C(9,12,e.Orders)),o(8),T(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),T(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),T(C(55,25,e.Sales)),o(8),T(C(63,27,e.Tax)),o(8),T(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),D(G),D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),P("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,dl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,X,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Cr=i=>({ID:i});function _l(i,c){if(i&1){let e=I();n(0,"button",6),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function gl(i,c){if(i&1&&(n(0,"div",4),g(1,_l,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function fl(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(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",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),F(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Cl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function xl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.CustomerNameDisplay," - {0}"))}}function hl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.SalesName," - Sales: {0}"))}}function Sl(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" "," - Profit: "+C(2,1,e.Profit)," ")}}function yl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Dl(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function vl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function wl(i,c){if(i&1&&(se(0),F(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Tl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Cr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function Pl(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),v(" sold by ",e.Commissions.SalesName," ")}}function Il(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Fl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Pl,2,1,"i",68),F(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,Il,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),T(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(2),v(" ",C(17,13,e==null?null:e.UnitPrice)," "),o(4),v(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),v(" ",(e==null?null:e.DiscountAmount)==0?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),v(" ",C(26,17,e==null?null:e.Total)," ")}}function bl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e.CurrencySymbol," "),o(2),v(" ",C(8,3,e.Amount)," ")}}function El(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),F(10,"small",49),d(11,"date"),g(12,xl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,hl,3,4,"span",3),a(),g(17,Sl,3,3,"span",50)(18,yl,2,1,"i",53)(19,Dl,2,1,"span",54)(20,vl,2,0,"span",3),a(),g(21,wl,3,3,"ng-container",3)(22,Tl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Fl,27,19,"tr",58),a()(),n(28,"table",59),g(29,bl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,ul))("queryParams",U(24,Cr,e.ID)),o(2),v(" ",e.EntityName+" # "+e.Number,""),o(2),v(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",r.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ml(i,c){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Vl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Bl(i,c){if(i&1){let e=I();n(0,"div",4)(1,"a",85),P("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),F(2,"i",86),p(3," Next 100"),a()()}}function Ol(i,c){if(i&1){let e=I();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Cl,2,0,"th",34),n(15,"th",35),p(16,"@ Price"),a(),n(17,"th",32),p(18,"Disc."),a(),n(19,"th",35),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",36),g(24,El,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),P("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Ml,3,0,"span",43)(34,Vl,3,3,"span",3),p(35),a()(),g(36,Bl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),v(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,r,t,l,f,w,Ee,xt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=xt}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(Oe),D(j),D(Ke),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["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"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"text-end",2,"width","80px"],[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"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"lh-base"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[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"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[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-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,gl,2,1,"div",2),a(),n(3,"filters"),g(4,fl,46,26,"ng-template",null,0,M),a(),g(6,Ol,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Ho,gn,ie,ee,X,J],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 Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;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)(D(Zt),D($t))};static \u0275cmp=E({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),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,ei],encapsulation:2})};var Rl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],xr=i=>({ID:i}),kl=()=>["/menu/Contacts/Contact/Customers/Info"],Wl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Nl(i,c){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function Al(i,c){if(i&1){let e=I();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Gl(i,c){if(i&1){let e=I();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Hl(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Al,11,4,"ng-container",13)(19,Gl,3,6,"ng-template",null,1,M),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function Ql(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Yl(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function jl(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function ql(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Ul(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Kl(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function zl(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Xl(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Jl(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Zl(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function $l(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function ep(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function tp(i,c){i&1&&F(0,"br")}function ip(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Note)}}function np(i,c){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=s().$implicit;o(2),v(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),v(" ",y(6,5,e.Created,"HH:mm")," ")}}function ap(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,kl))("queryParams",U(4,xr,e.CustomerID)),o(),T(e.CustomerName)}}function op(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function rp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Groups," ")}}function lp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function pp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function mp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function sp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function cp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function up(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function _p(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",st(2,Wl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function gp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,tp,1,0,"br",4)(7,ip,2,1,"i",4),a(),g(8,np,7,8,"td",4)(9,ap,3,6,"td",4)(10,op,3,4,"td")(11,rp,2,1,"td")(12,lp,2,1,"td",4)(13,pp,3,3,"td",68)(14,mp,3,3,"td",69)(15,sp,3,3,"td",69)(16,cp,3,3,"td",70)(17,dp,3,3,"td",69)(18,up,3,3,"td",69)(19,_p,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),T(e.EntityName),o(2),m("routerLink",b(18,Rl))("queryParams",U(19,xr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),Nt(r.column.JoinDate.selected?10:-1),o(),Nt(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function fp(i,c){i&1&&F(0,"td",79)}function Cp(i,c){i&1&&F(0,"td",79)}function xp(i,c){i&1&&F(0,"td",79)}function hp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Sp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function yp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function vp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function wp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Tp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Pp(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),F(2,"td",79),g(3,fp,1,0,"td",80)(4,Cp,1,0,"td",80)(5,xp,1,0,"td",80)(6,hp,2,0,"td",81)(7,Sp,4,6,"td",68)(8,yp,4,6,"td",69)(9,Dp,4,6,"td",69)(10,vp,4,6,"td",70)(11,wp,4,6,"td",69)(12,Tp,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Ip(i,c){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Ql,2,0,"th",43)(9,Yl,2,0,"th",44)(10,jl,2,0,"th",45)(11,ql,2,0,"th",46)(12,Ul,2,0,"th",47)(13,Kl,2,0,"th",48)(14,zl,2,0,"th",49)(15,Xl,2,0,"th",50)(16,Jl,2,0,"th",51)(17,Zl,2,0,"th",52)(18,$l,2,0,"th",53)(19,ep,2,0,"th",54),a()(),n(20,"tbody"),g(21,gp,20,21,"tr",55),a(),g(22,Pp,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),Nt(e.column.JoinDate.selected?10:-1),o(),Nt(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Fp(i,c){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function bp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Ep(i,c){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(1,"i",86),p(2," Next"),a()}}function Mp(i,c){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),F(1,"i",88),p(2," Last"),a()}}function Vp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Ip,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Fp,3,0,"span",34)(9,bp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Ep,3,0,"a",36)(13,Mp,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),v(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.route.snapshot.queryParams.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate)}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Tn,{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 f=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(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more for 500 variants",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Nl,3,0,"button",3),a(),n(3,"filters"),g(4,Hl,36,22,"ng-template",null,0,M),a(),g(6,Vp,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,yi,Q,Ye,oe,ie,ee,X],encapsulation:2})};var Bp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Op=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Lp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Rp=i=>({ID:i}),kp=(i,c)=>({BrandID:i,Name:c});function Wp(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export"),a()}}function Np(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Ap(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function Gp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Hp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,Gp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Lp))("queryParams",U(12,Rp,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,kp,e.ID,e.BrandName)),o(),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.Total))}}function Qp(i,c){if(i&1){let e=I();n(0,"div",15)(1,"table",16),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Ap,2,0,"th",19),n(7,"th",20),p(8,"Sold"),a(),n(9,"th",21),p(10,"Total"),a()()(),n(11,"tbody"),g(12,Hp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),T(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),T(C(24,12,y(23,9,e.data.Data,"Total")))}}var In=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wp,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"),g(14,Np,9,6,"ng-template",null,0,M),a(),n(16,"content"),g(17,Qp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Bp)),o(3),m("routerLink",b(9,Op)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,J],encapsulation:2})};function Yp(i,c){if(i&1){let e=I();n(0,"label",3),P("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),F(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),T(e.Name)}}var Fn=class i{constructor(c,e){this.dialogRef=c;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(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Yp,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Up=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Xp=()=>["/menu/Contacts/Contact/Customers/Info"],Jp=i=>({ID:i});function Zp(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function $p(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function em(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function tm(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function im(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function nm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function am(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function om(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function rm(i,c){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),P("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),T(r==0?"":" , "),o(2),T(e.GroupName)}}function lm(i,c){if(i&1&&(n(0,"span"),g(1,rm,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function pm(i,c){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function mm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Orders)," ")}}function sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function cm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),v(" ",C(3,1,e.Cost)," ")}}function dm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function um(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function _m(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales+e.Tax)," ")}}function gm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,lm,2,1,"span",25)(6,pm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,mm,3,3,"td",43)(11,sm,3,3,"td",43)(12,cm,4,3,"ng-container",25)(13,dm,3,3,"td",43)(14,um,3,3,"td",44)(15,_m,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,Xp))("queryParams",U(14,Jp,e.CustomerID)),o(),v(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function fm(i,c){if(i&1&&(n(0,"tbody",37),g(1,gm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Cm(i,c){if(i&1){let e=I();n(0,"div",17)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,em,2,0,"th",23)(10,tm,2,0,"th",24)(11,im,3,0,"ng-container",25)(12,nm,2,0,"th",26)(13,am,2,0,"th",27)(14,om,2,0,"th",28),a()(),g(15,fm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("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 bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=Ge(G);columnService=Ge(vt);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=Cn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Rt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(Fn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["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,"container-fluid","mt-5"],[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"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["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"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Zp,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),F(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,$p,16,10,"ng-template",null,0,M),a(),n(26,"content"),g(27,Cm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,jp)),o(3),m("routerLink",b(13,qp)),o(3),m("routerLink",b(14,Up)),o(3),m("routerLink",b(15,Kp)),o(4),m("routerLink",b(16,zp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ii,ie,X,J],encapsulation:2})};var xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function vm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function wm(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Tm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),v(" ",e.Name," "),o(2),T(C(5,4,e.TotalOrders)),o(3),T(C(8,6,e.TotalCost)),o(3),T(C(11,8,e.TotalAmount))}}function Pm(i,c){if(i&1&&(n(0,"tbody",24),g(1,Tm,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Im(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,Pm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["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"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,vm,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"),g(23,wm,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,Im,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,xm)),o(3),m("routerLink",b(12,hm)),o(3),m("routerLink",b(13,Sm)),o(3),m("routerLink",b(14,ym)),o(3),m("routerLink",b(15,Dm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Bm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Om(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Lm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Rm(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function km(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Wm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalOrders))}}function Nm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalQuantity)," ")}}function Am(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalAmount))}}function Gm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Wm,3,3,"td",28)(4,Nm,3,3,"td",28)(5,Am,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function Hm(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Lm,2,0,"th",20)(7,Rm,2,0,"th",21)(8,km,2,0,"th",22),a()(),n(9,"tbody",23),g(10,Gm,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Rt(1))}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[R],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 135px","mat-sort-header","Total","arrowPosition","before","class","flex-right",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],["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"],["class","text-end",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Bm,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"),g(23,Om,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,Hm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Fm)),o(3),m("routerLink",b(13,bm)),o(3),m("routerLink",b(14,Em)),o(3),m("routerLink",b(15,Mm)),o(3),m("routerLink",b(16,Vm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,J],encapsulation:2})};var Sr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ym=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],jm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Um=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Km=()=>["/menu/Contacts/Contact/Suppliers/Info"],zm=i=>({ID:i}),Xm=(i,c,e)=>({From:i,SupplierID:c,To:e});function Jm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Zm(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function $m(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(19,Km))("queryParams",U(20,zm,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Sr))("queryParams",st(23,Xm,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function es(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),F(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),F(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),T(e.data.TotalQty),o(2),T(e.data.TotalSales)}}function ts(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,$m,17,27,"tr",25),a(),g(16,es,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Nt((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["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"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Jm,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"),g(26,Zm,16,10,"ng-template",null,0,M),a(),n(28,"content"),g(29,ts,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Sr)),o(3),m("routerLink",b(13,Qm)),o(3),m("routerLink",b(14,Ym)),o(3),m("routerLink",b(15,jm)),o(3),m("routerLink",b(16,qm)),o(3),m("routerLink",b(17,Um)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,J],encapsulation:2})};var yr=Qt(Oi());var ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],as=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ms=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),ss=i=>[i],cs=i=>({ID:i}),ds=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],us=(i,c,e)=>({VariantID:i,From:c,To:e}),_s=(i,c,e)=>({ProductID:i,From:c,To:e});function gs(i,c){if(i&1&&(n(0,"a",9),F(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,ms,(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 fs(i,c){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",12),p(2," Export "),a()}}function Cs(i,c){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function xs(i,c){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function hs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function Ss(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function ys(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ds(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function vs(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function ws(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Ts(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ps(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Is(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Fs(i,c){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function bs(i,c){if(i&1){let e=I();se(0),n(1,"img",72),P("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Es(i,c){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Ms(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",Co(4,ds,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(),T(C(3,2,r.Quantity))}}function Vs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.OnHand)," ")}}function Bs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitCost)," ")}}function Os(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function Ls(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Dr))("queryParams",st(12,us,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Rs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Dr))("queryParams",st(12,_s,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function ks(i,c){if(i&1&&(n(0,"td",75),g(1,Ls,5,16,"a",78)(2,Rs,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function Ws(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function Ns(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNTax)," ")}}function As(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function Gs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Margin)," ")}}function Hs(i,c){if(i&1&&(n(0,"tr",60),g(1,Fs,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,bs,2,1,"ng-container",8)(8,Es,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Ms,4,11,"td",67)(15,Vs,3,3,"td",67)(16,Bs,3,3,"td",68)(17,Os,3,3,"td",67)(18,ks,3,2,"td",67)(19,Ws,3,3,"td",69)(20,Ns,3,3,"td",67)(21,As,3,4,"td",70)(22,Gs,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),T(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,ss,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,cs,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Qs(i,c){i&1&&F(0,"td",75)}function Ys(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function js(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function qs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function Us(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function Ks(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function zs(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function Xs(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function Js(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function Zs(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function $s(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),v(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function e0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),F(2,"td",75),g(3,Qs,1,0,"td",67)(4,Ys,2,0,"td",67)(5,js,4,6,"td",67)(6,qs,4,6,"td",67)(7,Us,4,6,"td",68)(8,Ks,4,6,"td",67)(9,zs,5,6,"td",82)(10,Xs,5,6,"td",69)(11,Js,5,6,"td",82)(12,Zs,5,10,"td",70)(13,$s,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("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(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function t0(i,c){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,xs,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,hs,2,1,"th",37)(12,Ss,2,0,"th",38)(13,ys,2,0,"th",39)(14,Ds,2,0,"th",40)(15,vs,2,1,"th",41)(16,ws,2,0,"th",42)(17,Ts,2,1,"th",43)(18,Ps,2,0,"th",44)(19,Is,2,0,"th",45),a()(),n(20,"tbody"),g(21,Hs,23,21,"tr",46),a(),g(22,e0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("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 Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Ge(G);columnService=Ge(vt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=mt([]);queryParams=mt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Bi.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=et(Je({},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 f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return V.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return V.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return V.compare(t.Total,l.Total,f);case"Total_Tax":return V.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return V.compare(t.MinStock,l.MinStock,f);case"Gross":return V.compare(t.Gross,l.Gross,f);case"Margin":return V.compare(t.Margin,l.Margin,f);case"Profit":return V.compare(t.Profit,l.Profit,f);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(q,{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,yr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],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"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,gs,3,7,"a",2)(3,fs,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"),g(27,Cs,45,36,"ng-template",null,0,M),a(),g(29,t0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,ns)),o(3),m("routerLink",b(15,as)),o(3),m("routerLink",b(16,os)),o(3),m("routerLink",b(17,rs)),o(3),m("routerLink",b(18,ls)),o(3),m("routerLink",b(19,ps)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,wo,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ii,oe,ee,X,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var i0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],n0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],a0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],p0=i=>({ID:i});function m0(i,c){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",16),p(2," Export "),a()}}function s0(i,c){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function c0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;dt("matTooltip",r.Name),o(),v(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function d0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function u0(i,c){if(i&1&&(n(0,"tr",28)(1,"td")(2,"a",29),p(3),a()(),n(4,"td",30),p(5),a(),g(6,d0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,p0,e.ID)),o(),v(" ",e.Name,""),o(2),T(e.Code),o(),m("ngForOf",e.Quantities),o(2),T(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[R],decls:42,vars:19,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[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"],[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"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"border-bottom"],[3,"routerLink","queryParams"],[2,"text-align","right"],["class","text-end",4,"ngFor","ngForOf"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,m0,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"),g(26,s0,25,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,c0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,u0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,i0)),o(3),m("routerLink",b(14,n0)),o(3),m("routerLink",b(15,a0)),o(3),m("routerLink",b(16,o0)),o(3),m("routerLink",b(17,r0)),o(3),m("routerLink",b(18,l0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,fe,Q,Ye],encapsulation:2})};var _0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],f0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],C0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],x0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],S0=i=>[i],y0=i=>({ID:i});function D0(i,c){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function v0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a(),n(13,"h6"),p(14,"Year"),a(),n(15,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.MonthFrom),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.MonthTo),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.years),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function w0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,r=s();o(),v(" ",r.months[e.Month-1].ColumnLabel," ")}}function T0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),v(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function P0(i,c){if(i&1&&(n(0,"tr",26)(1,"td")(2,"a",27),p(3),a()(),n(4,"td"),p(5),a(),g(6,T0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",U(12,S0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,y0,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(),m("ngForOf",r.data==null?null:r.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function I0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function F0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),F(2,"td")(3,"td"),g(4,I0,3,4,"td",28),n(5,"td",29),p(6),d(7,"sum"),d(8,"number"),a()()()),i&2){let e=s();o(4),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(2),v(" ",y(8,5,y(7,2,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}var Ln=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{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 f=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(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[R],decls:43,vars:20,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Code",1,"align-left",2,"width","120px"],["class","text-end small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-end",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month From",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month To",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Scope",3,"modelChange","model","options"],[1,"text-end","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,D0,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"),g(26,v0,19,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,w0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,P0,11,16,"tr",14),a(),g(42,F0,9,8,"tfoot",15),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,_0)),o(3),m("routerLink",b(15,g0)),o(3),m("routerLink",b(16,f0)),o(3),m("routerLink",b(17,C0)),o(3),m("routerLink",b(18,x0)),o(3),m("routerLink",b(19,h0)),o(14),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,z,B,L,ae,ge,De,fe,Q,oe,ie],encapsulation:2})};var b0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],M0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],L0=i=>[i],R0=i=>({ID:i});function k0(i,c){if(i&1){let e=I();n(0,"button",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function W0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(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",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function N0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),T(e)}}function A0(i,c){if(i&1&&(n(0,"tr"),F(1,"th")(2,"th"),g(3,N0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function G0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function H0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,L0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,R0,r[1])),o(),T(r[e])}}function Q0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;v(" ",r[e]," ")}}function Y0(i,c){if(i&1&&(n(0,"td",13),g(1,H0,3,7,"ng-container",28)(2,Q0,1,1,"ng-template",null,1,M),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function j0(i,c){if(i&1&&(n(0,"tr",13),g(1,Y0,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[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","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,k0,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Product Sold "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",7),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",7),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",7),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,W0,16,10,"ng-template",null,0,M),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,A0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,G0,2,1,"th",14),a()(),n(39,"tbody"),g(40,j0,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,b0)),o(3),m("routerLink",b(15,E0)),o(3),m("routerLink",b(16,M0)),o(3),m("routerLink",b(17,V0)),o(3),m("routerLink",b(18,B0)),o(3),m("routerLink",b(19,O0)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var q0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],U0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],K0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],z0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],X0=(i,c,e)=>({CategoryID:i,From:c,To:e}),J0=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],wr=i=>({CategoryID:i});function Z0(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function $0(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function ec(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,$0,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Exclude Zero"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function tc(i,c){i&1&&(n(0,"th",42),p(1," Cost "),F(2,"p-treeTableSortIcon",43),a())}function ic(i,c){i&1&&(n(0,"th",44),p(1," Profit "),F(2,"p-treeTableSortIcon",45),a())}function nc(i,c){i&1&&(n(0,"th",46),p(1," % "),F(2,"p-treeTableSortIcon",47),a())}function ac(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),F(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),F(6,"p-treeTableSortIcon",32),a(),g(7,tc,3,0,"th",33),n(8,"th",34),p(9," Gross "),F(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),F(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),F(16,"p-treeTableSortIcon",39),a(),g(17,ic,3,0,"th",40)(18,nc,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function oc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),T(C(5,6,e.DisplayedCost))}}function rc(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),T(C(5,6,e.DisplayedProfit))}}function lc(i,c){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=s(2).rowData;dt("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),v("",C(4,8,e.DisplayedPercentage),"%")}}function pc(i,c){if(i&1&&(n(0,"td"),g(1,lc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function mc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),F(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,oc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,rc,6,8,"td",55)(34,pc,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,vr))("queryParams",st(51,X0,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(r.Name),o(2),dt("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),T(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),T(C(19,36,r.DisplayedGross)),o(3),dt("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,J0))("queryParams",U(56,wr,r.ID)),o(3),T(C(25,42,r.DisplayedTotalDiscount)),o(3),dt("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,vr))("queryParams",U(59,wr,r.ID)),o(),T(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function sc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function cc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function dc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function uc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,sc,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,cc,3,3,"td",61)(18,dc,3,3,"td",63),a()),i&2){let e=s(2);o(4),v(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),T(C(10,9,e.data.Aggregate.TotalGross)),o(3),v(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function _c(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,ac,19,3,"ng-template",25)(4,mc,35,61,"ng-template",26)(5,uc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,z0))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Z0,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"),g(17,ec,29,15,"ng-template",null,0,M),a(),g(19,_c,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,q0)),o(3),m("routerLink",b(11,U0)),o(3),m("routerLink",b(12,K0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,Zo,Fo,ir,$o,er,tr,fe,Q,Ye,un,ie,ee,X,J],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 gc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Cc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function xc(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function hc(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function Sc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function yc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Value)}}function Dc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Value))}}function vc(i,c){if(i&1&&(n(0,"td"),g(1,yc,2,1,"span",22)(2,Dc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function wc(i,c){if(i&1&&(n(0,"tr"),g(1,vc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function Tc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e),"")}}function Pc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,Tc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Ic(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,Sc,2,2,"th",20),a()(),n(5,"tbody"),g(6,wc,2,1,"tr",21),a(),g(7,Pc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{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 f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=l.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xc,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"),g(17,hc,16,9,"ng-template",null,0,M),a(),n(19,"content"),g(20,Ic,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,gc)),o(3),m("routerLink",b(11,fc)),o(3),m("routerLink",b(12,Cc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],bc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Mc(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Vc(i,c){if(i&1&&(n(0,"div",11),F(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],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"],["class","container-fluid mt-5",4,"ngIf"],[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"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),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"),g(16,Mc,10,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,Vc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Fc)),o(3),m("routerLink",b(9,bc)),o(3),m("routerLink",b(10,Ec)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ni],encapsulation:2})};var Bc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Oc(i,c){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Lc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),F(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),F(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{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 f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),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,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),F(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,Oc,13,9,"ng-template",null,0,M),a(),g(8,Lc,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,Bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,Et,Q],encapsulation:2})};function Rc(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function kc(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Wc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(C(3,5,e.Visitor)),o(3),T(C(6,7,e.Orders)),o(3),T(C(9,9,e.TotalVisitor)),o(3),T(C(12,11,e.Sales)),o(3),T(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Nc(i,c){if(i&1&&(n(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),p(5,"Number of Person"),a(),n(6,"th",15),p(7,"Orders"),a(),n(8,"th",15),p(9,"Total Visitor"),a(),n(10,"th",15),p(11,"Sales"),a(),n(12,"th",16),p(13,"Average Spending"),a()()(),n(14,"tbody"),g(15,Wc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),T(C(23,8,y(22,5,e.data,"Orders"))),o(4),T(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),T(C(31,18,y(30,15,e.data,"Sales"))),o(4),T(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Rc,3,0,"a",2),a(),n(3,"filters"),g(4,kc,10,6,"ng-template",null,0,M),a(),n(6,"content"),g(7,Nc,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Ac=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Gc(i,c){if(i&1){let e=I();n(0,"a",18),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",19),p(2," Export "),a()}}function Hc(i,c){if(i&1){let e=I();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Yc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Revenue))}}function jc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",15),p(4),d(5,"number"),a(),n(6,"td",15),p(7),d(8,"quantityFraction"),a(),n(9,"td",15),p(10),d(11,"amountFraction"),a(),n(12,"td",16),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",15),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),g(20,Yc,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),T(e.TimeFormat),o(2),T(C(5,7,e.Count)),o(3),T(C(8,9,e.Quantity)),o(3),T(C(11,11,e.Sales)),o(3),T(C(15,15,C(14,13,e.Tax))),o(4),T(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function qc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),T(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[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"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Gc,3,0,"a",2),n(3,"a",3),F(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Hc,10,6,"ng-template",null,0,M),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(),g(26,Qc,2,0,"th",11),a()(),n(27,"tbody"),g(28,jc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),F(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,qc,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Ac)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),T(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),T(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),T(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),T(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),T(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,Qo,ie,X,J],encapsulation:2})};var Uc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],$a=(i,c)=>({From:i,To:c}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],zc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Xc(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Jc(i,c){if(i&1&&(n(0,"content")(1,"div",12),F(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(c,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(D(W),D(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],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"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),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"),g(16,Xc,13,11,"ng-template",null,0,M),a(),g(18,Jc,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,Uc))("queryParams",de(12,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,Kc))("queryParams",de(16,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,zc))("queryParams",de(20,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var td={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,Jo]},{provide:nn,useValue:td}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),F(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);_o("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[At,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
- `],encapsulation:2})};var nd=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function ad(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function od(i,c){if(i&1&&(n(0,"div",14),F(1,"POS-line-chart",15),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var jn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ee=>this.series?.name==Ee?.name);let l=[],f="",w=this.point.index;return r.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(l=Ee.name.split(" "),f+=`
1
+ import{a as ni,b as sr}from"./chunk-NVWJ6HZD.js";import{a as ur,b as _r}from"./chunk-SEFALU4U.js";import{a as gr}from"./chunk-53ACYG5V.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as cr}from"./chunk-KHILQH3P.js";import{a as Gt,b as dr}from"./chunk-UQP7S73H.js";import"./chunk-YAFVFDTG.js";import{a as mr}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-W7I2T4SZ.js";import{a as he}from"./chunk-FNUNWZ2W.js";import{a as Ye}from"./chunk-C2CGBWBH.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as vt}from"./chunk-OXQJYOVG.js";import{a as Lo}from"./chunk-5HX73JZ3.js";import{b as No}from"./chunk-QJ4LGJCR.js";import"./chunk-DKPNAGIM.js";import{a as yn}from"./chunk-47W54HJY.js";import"./chunk-DAIHPIA2.js";import{a as pr}from"./chunk-BXQFYW4R.js";import{a as ar,b as or,d as rr,g as lr}from"./chunk-NXXNEU5Q.js";import"./chunk-BYXBJQAS.js";import{a as yi}from"./chunk-XKUQPHUA.js";import"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Wo}from"./chunk-EMP32K7Q.js";import{a as Zo,b as $o,c as er,d as tr,e as ir,f as nr}from"./chunk-QFO3KUMD.js";import"./chunk-B5SDXVDR.js";import"./chunk-7275MAOI.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Oi,b as Jo,c as Sn,d as K,e as Si}from"./chunk-6G37ZXRX.js";import{a as cn,b as fi}from"./chunk-BXAYNP7A.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-6CQ6XYJG.js";import"./chunk-YEDKRNXU.js";import"./chunk-TQZQYUFG.js";import"./chunk-7QWJJPNG.js";import{c as ko,d as De,e as hn}from"./chunk-VSF6PYZW.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as X}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-TRUZ46QL.js";import{a as ae,b as ge,c as Oo}from"./chunk-ITLMINSX.js";import{a as bt,b as Xo}from"./chunk-HMER2IC5.js";import{d as Uo,f as fe}from"./chunk-HA6VJJLI.js";import{a as Ko,b as zo,c as Q}from"./chunk-SV4HJFAL.js";import{b as q}from"./chunk-TZ74SUXJ.js";import{a as ne}from"./chunk-V52QD5BS.js";import{a as Bo}from"./chunk-IU526HWZ.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-TSBV5MA4.js";import"./chunk-BVVYVR6R.js";import"./chunk-5JJSLRVS.js";import{c as Ao}from"./chunk-GINOZV6C.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Go,c as Qe}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as qo}from"./chunk-VGNMBCUC.js";import{b as W}from"./chunk-DV4MQXAE.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Ro,u as Ci,v as ei,w as _n}from"./chunk-CD3BSGAP.js";import{b as pe,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as Yo,C as ti,K as xi,N as jo,g as oe,o as Ho,s as gn,z as Qo}from"./chunk-5OS5VELO.js";import{a as un,d as z}from"./chunk-XYB3YDKL.js";import"./chunk-6ZN7JR6K.js";import"./chunk-GIKR6Y2K.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Mo,b as Vo}from"./chunk-VFTGIP5A.js";import{a as Eo}from"./chunk-LE3BKIDY.js";import{a as Bi}from"./chunk-2FWFPV5I.js";import{la as Io,ma as Zi,ua as bo}from"./chunk-EEEAUYZ6.js";import{F as At,G as Xi,a as vo,b as wo,c as ke,h as B,l as To,o as L,q as Po,s as Fo}from"./chunk-RVXZOIFQ.js";import"./chunk-TDO7VOF5.js";import"./chunk-NOQM2VPB.js";import{a as M,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-PZANARAM.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as Nt,E as ri,Eb as za,Fa as Gi,Fc as V,Gb as Ei,Hb as Mi,I as Ii,Ib as n,Jb as a,K as po,Kb as I,Kc as xo,Lb as se,M as mo,Ma as mt,Mb as ce,Mc as Ui,Nb as fo,Nc as ho,Ob as F,Od as Oe,Pc as Xa,Q as Ni,Qb as P,Qc as So,Qd as zi,Rb as s,Rd as A,Td as Vi,Ub as dt,Va as Pe,Vd as Ke,Wa as Hi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ua,ad as yo,cd as Ki,db as D,dc as Ze,ec as p,ed as ee,fa as kt,fc as T,gc as v,gd as ie,hc as Xt,ia as so,ib as uo,ja as co,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,na as Ge,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as st,u as qa,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as _o,wc as Co,wd as Do,xb as bi,za as Ka,zb as go,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as ll,g as Qt}from"./chunk-7DCB7DB2.js";var no=ll((ub,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{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:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-l)-(Ee-f)*(xt-l);return Vt>0||!(Vt<0)}function t(l,f,w,Ee,xt,ut,Vt,Wt){return r(l,f,xt,ut,Vt,Wt)!==r(w,Ee,xt,ut,Vt,Wt)&&r(l,f,w,Ee,xt,ut)!==r(l,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(l,f,w,Ee,xt,ut,Vt,Wt){return t(l,f,l+w,f,xt,ut,Vt,Wt)||t(l+w,f,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f+Ee,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f,l,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,xt){let{animObject:ut}=r,{format:Vt}=t,{setOptions:Wt}=l,{composed:tl}=f,{boxIntersectLine:ao,intersectRect:il}=Ee,{addEvent:oo,extend:ro,fireEvent:nl,isNumber:ki,pick:Ut,pushUnique:al,syncTimeout:ol}=xt;function pi(ct,Me,at,we,Pt){let it=ct.chart,$=ct.options.label||{},ze=Ut($.onArea,!!ct.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,ht,_t,gt,Kt,It,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(il(lt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let ot=it.series[Xe],Ve=ot.interpolatedPoints&&[...ot.interpolatedPoints];if(ot.visible&&Ve){let Ue=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ue)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(be=1;be<Ve.length;be+=1){if(Ve[be].chartX>=Me-16&&Ve[be-1].chartX<=Me+we.width+16){if(ao(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;ct===ot&&!gt&&Pt&&(gt=ao(Me-16,at-16,we.width+32,we.height+32,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))}(je||gt)&&(ct!==ot||ze)&&(Bt=Math.min(Bt,(Kt=Me+we.width/2-Ve[be].chartX)*Kt+(It=at+we.height/2-Ve[be].chartY)*It))}if(!ze&&je&&ct===ot&&(Pt&&!gt||Bt<Math.pow($.connectorNeighbourDistance||1,2))){for(be=1;be<Ve.length;be+=1)(ht=Math.min(Math.pow(Me+we.width/2-Ve[be].chartX,2)+Math.pow(at+we.height/2-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2)))<Ft&&(Ft=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?Ft:0),connectorPoint:_t}}function lo(ct){if(this.renderer){let Me=this,at=ut(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&xt.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Pt=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Pt.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Pt.minFontSize&&Pt.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,je)=>(ze||0)+(je||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),ct.type==="load"&&(at=Math.max(at,ut(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ol(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Pt=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(je=>{let{width:lt,height:Bt}=je.getBBox(),Ft=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:Ft,top:ht,right:Ft+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,Ft,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Kt=[],It=je.graph||je.area,Xe=It&&It.element,be=je.chart.inverted,ot=je.xAxis,Ve=je.yAxis,Ue=be?Ve.pos:ot.pos,$e=be?ot.pos:Ve.pos,Dt=be?ot.len:Ve.len,Fi=be?Ve.len:ot.len,ft=Ut((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},zt=be?"chartCenterX":"chartCenterY";function oi(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Kt.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&&gt.length<(je.chart.plotSizeX||0)/16){let nt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=Xe.getTotalLength(),lt=0;lt<Ft;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Fi-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;oi({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&It.attr({d:nt});let St=gt[gt.length-1].pos();oi({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,Ft=gt.length;lt<Ft;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(ki(Lt)&&ki(Ct)){let rt={plotX:Lt,plotY:Ct,chartX:Ue+Lt,chartY:$e+Ct};if(ft&&(pt&&(rt.plotY=pt,rt.chartY=$e+pt),be?rt.chartCenterX=Ue+Fi-((pt||St.plotY||0)+Ut(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+Ut(St.yBottom,Ne))/2),nt&&(Bt=Math.max(Math.abs(rt.chartX-nt.chartX),Math.abs(rt.chartY-nt.chartY)))>16)for(_t=1,ht=Math.ceil(Bt/16);_t<ht;_t+=1)oi({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[zt]:(nt[zt]||0)+((rt[zt]||0)-(nt[zt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});oi(rt),nt=rt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+Ut($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,Ft=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,It=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=Ut(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Fi,ft,Ne,wt=$.labelBySeries,zt,oi,nt;function St(Ct,pt,rt){let Wi=Math.max(_t,Ut(oi,-1/0)),mi=Math.min(_t+Kt,Ut(nt,1/0));return Ct>Wi&&Ct<=mi-rt.width&&pt>=gt&&pt<=gt+It-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!wt){let Ct=$.name;if(typeof ze.format=="string"?Ct=Vt(ze.format,$,we):ze.formatter&&(Ct=ze.formatter.call($)),$.labelBySeries=wt=we.renderer.label(Ct,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+je),!we.renderer.styledMode){let pt=typeof $.color=="string"?$.color:"#666666";wt.css(ro({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(Ft-Bt)+"px"}),wt.attr({padding:0,zIndex:3}).add()}for((Ue=wt.getBBox()).width=Math.round(Ue.width),ft=Xe.length-1;ft>0;ft-=1)be?St($e=(Xe[ft].chartCenterX??Xe[ft].chartX)-Ue.width/2,Dt=(Xe[ft].chartCenterY??Xe[ft].chartY)-Ue.height/2,Ue)&&(Ne=pi($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Kt-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+It-Ue.height;Dt+=16)(Fi=pi($,$e,Dt,Ue,!0))&&ot.push(Fi);if(ot.length){ot.sort((pt,rt)=>rt.weight-pt.weight),Ne=ot[0],(we.boxesToAvoid||[]).push({left:Ne.x,right:Ne.x+Ue.width,top:Ne.y,bottom:Ne.y+Ue.height});let Ct=Math.sqrt(Math.pow(Math.abs(Ne.x-(wt.x||0)),2)+Math.pow(Math.abs(Ne.y-(wt.y||0)),2));if(Ct&&$.labelBySeries){let pt,rt={opacity:we.renderer.forExport?1:0,x:Ne.x,y:Ne.y},Wi={opacity:1};Ct<=10&&(Wi={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(ro(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(Wi,pt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);mi&&(wt.closest=[mi,Ne.x-(mi.plotX||0),Ne.y-(mi.plotY||0)])}}else Lt()}else Lt()}),nl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function rl(ct,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<ct+at/2?je:at-je),$>Me+we?ze.push(["L",ct+lt,Me+we]):$<Me?ze.push(["L",ct+lt,Me]):it<ct?ze.push(["L",ct,Me+we/2]):it>ct+at&&ze.push(["L",ct+at,Me+we/2])),ze||[]}return{compose:function(ct,Me){al(tl,"SeriesLabel")&&(oo(ct,"load",lo),oo(ct,"redraw",lo),Me.prototype.symbols.connector=rl,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var fr=(i,c)=>({"text-success":i,"text-danger":c});function pl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),v(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function ml(i,c){if(i&1){let e=F();n(0,"span",8),P("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),I(1,"i",9),a()}}function sl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),v(" ",C(8,2,e.Cost)," "),o(4),v(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function cl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,fr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,fr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function dl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),I(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),I(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,pl,4,4,"ng-container",6),d(25,"async"),g(26,ml,2,0,"ng-template",null,0,V),a(),I(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),I(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),I(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),I(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),I(72,"td"),a(),g(73,sl,13,7,"ng-container",3)(74,cl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),T(C(9,12,e.Orders)),o(8),T(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),T(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),T(C(55,25,e.Sales)),o(8),T(C(63,27,e.Tax)),o(8),T(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),D(G),D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),P("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,dl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,X,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Cr=i=>({ID:i});function _l(i,c){if(i&1){let e=F();n(0,"button",6),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function gl(i,c){if(i&1&&(n(0,"div",4),g(1,_l,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function fl(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(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",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),I(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Cl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function xl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.CustomerNameDisplay," - {0}"))}}function hl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.SalesName," - Sales: {0}"))}}function Sl(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" "," - Profit: "+C(2,1,e.Profit)," ")}}function yl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Dl(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function vl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function wl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Tl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Cr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function Pl(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),v(" sold by ",e.Commissions.SalesName," ")}}function Fl(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Il(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Pl,2,1,"i",68),I(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,Fl,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),T(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(2),v(" ",C(17,13,e==null?null:e.UnitPrice)," "),o(4),v(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),v(" ",(e==null?null:e.DiscountAmount)==0?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),v(" ",C(26,17,e==null?null:e.Total)," ")}}function bl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e.CurrencySymbol," "),o(2),v(" ",C(8,3,e.Amount)," ")}}function El(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),I(10,"small",49),d(11,"date"),g(12,xl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,hl,3,4,"span",3),a(),g(17,Sl,3,3,"span",50)(18,yl,2,1,"i",53)(19,Dl,2,1,"span",54)(20,vl,2,0,"span",3),a(),g(21,wl,3,3,"ng-container",3)(22,Tl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Il,27,19,"tr",58),a()(),n(28,"table",59),g(29,bl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,ul))("queryParams",U(24,Cr,e.ID)),o(2),v(" ",e.EntityName+" # "+e.Number,""),o(2),v(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",r.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ml(i,c){if(i&1){let e=F();n(0,"span",83),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Vl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Bl(i,c){if(i&1){let e=F();n(0,"div",4)(1,"a",85),P("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),I(2,"i",86),p(3," Next 100"),a()()}}function Ol(i,c){if(i&1){let e=F();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Cl,2,0,"th",34),n(15,"th",35),p(16,"@ Price"),a(),n(17,"th",32),p(18,"Disc."),a(),n(19,"th",35),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",36),g(24,El,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),P("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Ml,3,0,"span",43)(34,Vl,3,3,"span",3),p(35),a()(),g(36,Bl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),v(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,r,t,l,f,w,Ee,xt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=xt}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(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(Oe),D(j),D(Ke),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["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"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"text-end",2,"width","80px"],[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"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"lh-base"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[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"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[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-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,gl,2,1,"div",2),a(),n(3,"filters"),g(4,fl,46,26,"ng-template",null,0,V),a(),g(6,Ol,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Ho,gn,ie,ee,X,J],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 Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;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)(D(Zt),D($t))};static \u0275cmp=E({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),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,ei],encapsulation:2})};var Rl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],xr=i=>({ID:i}),kl=()=>["/menu/Contacts/Contact/Customers/Info"],Wl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Nl(i,c){if(i&1){let e=F();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Al(i,c){if(i&1){let e=F();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Gl(i,c){if(i&1){let e=F();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Hl(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Al,11,4,"ng-container",13)(19,Gl,3,6,"ng-template",null,1,V),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function Ql(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Yl(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function jl(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function ql(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Ul(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Kl(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function zl(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Xl(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Jl(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Zl(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function $l(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function ep(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function tp(i,c){i&1&&I(0,"br")}function ip(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Note)}}function np(i,c){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=s().$implicit;o(2),v(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),v(" ",y(6,5,e.Created,"HH:mm")," ")}}function ap(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,kl))("queryParams",U(4,xr,e.CustomerID)),o(),T(e.CustomerName)}}function op(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function rp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Groups," ")}}function lp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function pp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function mp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function sp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function cp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function up(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function _p(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",st(2,Wl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function gp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,tp,1,0,"br",4)(7,ip,2,1,"i",4),a(),g(8,np,7,8,"td",4)(9,ap,3,6,"td",4)(10,op,3,4,"td")(11,rp,2,1,"td")(12,lp,2,1,"td",4)(13,pp,3,3,"td",68)(14,mp,3,3,"td",69)(15,sp,3,3,"td",69)(16,cp,3,3,"td",70)(17,dp,3,3,"td",69)(18,up,3,3,"td",69)(19,_p,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),T(e.EntityName),o(2),m("routerLink",b(18,Rl))("queryParams",U(19,xr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),Nt(r.column.JoinDate.selected?10:-1),o(),Nt(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function fp(i,c){i&1&&I(0,"td",79)}function Cp(i,c){i&1&&I(0,"td",79)}function xp(i,c){i&1&&I(0,"td",79)}function hp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Sp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function yp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function vp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function wp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Tp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Pp(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),I(2,"td",79),g(3,fp,1,0,"td",80)(4,Cp,1,0,"td",80)(5,xp,1,0,"td",80)(6,hp,2,0,"td",81)(7,Sp,4,6,"td",68)(8,yp,4,6,"td",69)(9,Dp,4,6,"td",69)(10,vp,4,6,"td",70)(11,wp,4,6,"td",69)(12,Tp,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Fp(i,c){if(i&1){let e=F();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Ql,2,0,"th",43)(9,Yl,2,0,"th",44)(10,jl,2,0,"th",45)(11,ql,2,0,"th",46)(12,Ul,2,0,"th",47)(13,Kl,2,0,"th",48)(14,zl,2,0,"th",49)(15,Xl,2,0,"th",50)(16,Jl,2,0,"th",51)(17,Zl,2,0,"th",52)(18,$l,2,0,"th",53)(19,ep,2,0,"th",54),a()(),n(20,"tbody"),g(21,gp,20,21,"tr",55),a(),g(22,Pp,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),Nt(e.column.JoinDate.selected?10:-1),o(),Nt(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Ip(i,c){if(i&1){let e=F();n(0,"span",83),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function bp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Ep(i,c){if(i&1){let e=F();n(0,"a",85),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",86),p(2," Next"),a()}}function Mp(i,c){if(i&1){let e=F();n(0,"a",87),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",88),p(2," Last"),a()}}function Vp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Fp,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Ip,3,0,"span",34)(9,bp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Ep,3,0,"a",36)(13,Mp,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),v(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>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(Tn,{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 f=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(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{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)(D(W),D(O),D(H),D(Oe),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Nl,3,0,"button",3),a(),n(3,"filters"),g(4,Hl,36,22,"ng-template",null,0,V),a(),g(6,Vp,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,yi,Q,Ye,oe,ie,ee,X],encapsulation:2})};var Bp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Op=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Lp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Rp=i=>({ID:i}),kp=(i,c)=>({BrandID:i,Name:c});function Wp(i,c){if(i&1){let e=F();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export"),a()}}function Np(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Ap(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function Gp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Hp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,Gp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Lp))("queryParams",U(12,Rp,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,kp,e.ID,e.BrandName)),o(),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.Total))}}function Qp(i,c){if(i&1){let e=F();n(0,"div",15)(1,"table",16),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Ap,2,0,"th",19),n(7,"th",20),p(8,"Sold"),a(),n(9,"th",21),p(10,"Total"),a()()(),n(11,"tbody"),g(12,Hp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),T(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),T(C(24,12,y(23,9,e.data.Data,"Total")))}}var Fn=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wp,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"),g(14,Np,9,6,"ng-template",null,0,V),a(),n(16,"content"),g(17,Qp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Bp)),o(3),m("routerLink",b(9,Op)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,J],encapsulation:2})};function Yp(i,c){if(i&1){let e=F();n(0,"label",3),P("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),I(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),T(e.Name)}}var In=class i{constructor(c,e){this.dialogRef=c;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(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Yp,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Up=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Xp=()=>["/menu/Contacts/Contact/Customers/Info"],Jp=i=>({ID:i});function Zp(i,c){if(i&1){let e=F();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function $p(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function em(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function tm(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function im(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function nm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function am(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function om(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function rm(i,c){if(i&1){let e=F();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),P("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),T(r==0?"":" , "),o(2),T(e.GroupName)}}function lm(i,c){if(i&1&&(n(0,"span"),g(1,rm,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function pm(i,c){if(i&1){let e=F();n(0,"a",45),P("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function mm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Orders)," ")}}function sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function cm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),v(" ",C(3,1,e.Cost)," ")}}function dm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function um(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function _m(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales+e.Tax)," ")}}function gm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,lm,2,1,"span",25)(6,pm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,mm,3,3,"td",43)(11,sm,3,3,"td",43)(12,cm,4,3,"ng-container",25)(13,dm,3,3,"td",43)(14,um,3,3,"td",44)(15,_m,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,Xp))("queryParams",U(14,Jp,e.CustomerID)),o(),v(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function fm(i,c){if(i&1&&(n(0,"tbody",37),g(1,gm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Cm(i,c){if(i&1){let e=F();n(0,"div",17)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,em,2,0,"th",23)(10,tm,2,0,"th",24)(11,im,3,0,"ng-container",25)(12,nm,2,0,"th",26)(13,am,2,0,"th",27)(14,om,2,0,"th",28),a()(),g(15,fm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("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 bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=Ge(G);columnService=Ge(vt);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=Cn.maskingField;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(Rt(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 f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(In,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["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,"container-fluid","mt-5"],[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"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["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"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Zp,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),I(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,$p,16,10,"ng-template",null,0,V),a(),n(26,"content"),g(27,Cm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,jp)),o(3),m("routerLink",b(13,qp)),o(3),m("routerLink",b(14,Up)),o(3),m("routerLink",b(15,Kp)),o(4),m("routerLink",b(16,zp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ii,ie,X,J],encapsulation:2})};var xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function vm(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function wm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Tm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),v(" ",e.Name," "),o(2),T(C(5,4,e.TotalOrders)),o(3),T(C(8,6,e.TotalCost)),o(3),T(C(11,8,e.TotalAmount))}}function Pm(i,c){if(i&1&&(n(0,"tbody",24),g(1,Tm,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Fm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,Pm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}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 f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["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"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,vm,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"),g(23,wm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Fm,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,xm)),o(3),m("routerLink",b(12,hm)),o(3),m("routerLink",b(13,Sm)),o(3),m("routerLink",b(14,ym)),o(3),m("routerLink",b(15,Dm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Bm(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Om(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Lm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Rm(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function km(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Wm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalOrders))}}function Nm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalQuantity)," ")}}function Am(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalAmount))}}function Gm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Wm,3,3,"td",28)(4,Nm,3,3,"td",28)(5,Am,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function Hm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Lm,2,0,"th",20)(7,Rm,2,0,"th",21)(8,km,2,0,"th",22),a()(),n(9,"tbody",23),g(10,Gm,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);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 f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Rt(1))}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[R],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 135px","mat-sort-header","Total","arrowPosition","before","class","flex-right",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],["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"],["class","text-end",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Bm,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"),g(23,Om,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Hm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Im)),o(3),m("routerLink",b(13,bm)),o(3),m("routerLink",b(14,Em)),o(3),m("routerLink",b(15,Mm)),o(3),m("routerLink",b(16,Vm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,J],encapsulation:2})};var Sr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ym=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],jm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Um=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Km=()=>["/menu/Contacts/Contact/Suppliers/Info"],zm=i=>({ID:i}),Xm=(i,c,e)=>({From:i,SupplierID:c,To:e});function Jm(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Zm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function $m(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(19,Km))("queryParams",U(20,zm,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Sr))("queryParams",st(23,Xm,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function es(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),I(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),I(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),T(e.data.TotalQty),o(2),T(e.data.TotalSales)}}function ts(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,$m,17,27,"tr",25),a(),g(16,es,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Nt((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose 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"],[1,"container-fluid","mt-5"],["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"],["class","border-bottom",4,"ngFor","ngForOf"],[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=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Jm,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"),g(26,Zm,16,10,"ng-template",null,0,V),a(),n(28,"content"),g(29,ts,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Sr)),o(3),m("routerLink",b(13,Qm)),o(3),m("routerLink",b(14,Ym)),o(3),m("routerLink",b(15,jm)),o(3),m("routerLink",b(16,qm)),o(3),m("routerLink",b(17,Um)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,J],encapsulation:2})};var yr=Qt(Oi());var ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],as=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ms=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),ss=i=>[i],cs=i=>({ID:i}),ds=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],us=(i,c,e)=>({VariantID:i,From:c,To:e}),_s=(i,c,e)=>({ProductID:i,From:c,To:e});function gs(i,c){if(i&1&&(n(0,"a",9),I(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,ms,(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 fs(i,c){if(i&1){let e=F();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function Cs(i,c){if(i&1){let e=F();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function xs(i,c){if(i&1){let e=F();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function hs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function Ss(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function ys(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ds(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function vs(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function ws(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Ts(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ps(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Fs(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Is(i,c){if(i&1){let e=F();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function bs(i,c){if(i&1){let e=F();se(0),n(1,"img",72),P("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Es(i,c){if(i&1){let e=F();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Ms(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",Co(4,ds,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(),T(C(3,2,r.Quantity))}}function Vs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.OnHand)," ")}}function Bs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitCost)," ")}}function Os(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function Ls(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Dr))("queryParams",st(12,us,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Rs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Dr))("queryParams",st(12,_s,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function ks(i,c){if(i&1&&(n(0,"td",75),g(1,Ls,5,16,"a",78)(2,Rs,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function Ws(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function Ns(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNTax)," ")}}function As(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function Gs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Margin)," ")}}function Hs(i,c){if(i&1&&(n(0,"tr",60),g(1,Is,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,bs,2,1,"ng-container",8)(8,Es,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Ms,4,11,"td",67)(15,Vs,3,3,"td",67)(16,Bs,3,3,"td",68)(17,Os,3,3,"td",67)(18,ks,3,2,"td",67)(19,Ws,3,3,"td",69)(20,Ns,3,3,"td",67)(21,As,3,4,"td",70)(22,Gs,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),T(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,ss,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,cs,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Qs(i,c){i&1&&I(0,"td",75)}function Ys(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function js(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function qs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function Us(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function Ks(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function zs(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function Xs(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function Js(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function Zs(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function $s(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),v(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function e0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),I(2,"td",75),g(3,Qs,1,0,"td",67)(4,Ys,2,0,"td",67)(5,js,4,6,"td",67)(6,qs,4,6,"td",67)(7,Us,4,6,"td",68)(8,Ks,4,6,"td",67)(9,zs,5,6,"td",82)(10,Xs,5,6,"td",69)(11,Js,5,6,"td",82)(12,Zs,5,10,"td",70)(13,$s,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("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(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function t0(i,c){if(i&1){let e=F();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,xs,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,hs,2,1,"th",37)(12,Ss,2,0,"th",38)(13,ys,2,0,"th",39)(14,Ds,2,0,"th",40)(15,vs,2,1,"th",41)(16,ws,2,0,"th",42)(17,Ts,2,1,"th",43)(18,Ps,2,0,"th",44)(19,Fs,2,0,"th",45),a()(),n(20,"tbody"),g(21,Hs,23,21,"tr",46),a(),g(22,e0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("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 Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Ge(G);columnService=Ge(vt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=mt([]);queryParams=mt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},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,Bi.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=et(Je({},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 f=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(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return M.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return M.compare(t.Total,l.Total,f);case"Total_Tax":return M.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return M.compare(t.MinStock,l.MinStock,f);case"Gross":return M.compare(t.Gross,l.Gross,f);case"Margin":return M.compare(t.Margin,l.Margin,f);case"Profit":return M.compare(t.Profit,l.Profit,f);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(q,{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,yr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],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"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,gs,3,7,"a",2)(3,fs,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"),g(27,Cs,45,36,"ng-template",null,0,V),a(),g(29,t0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,ns)),o(3),m("routerLink",b(15,as)),o(3),m("routerLink",b(16,os)),o(3),m("routerLink",b(17,rs)),o(3),m("routerLink",b(18,ls)),o(3),m("routerLink",b(19,ps)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,wo,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ii,oe,ee,X,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var i0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],n0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],a0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],p0=i=>({ID:i});function m0(i,c){if(i&1){let e=F();n(0,"a",15),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function s0(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function c0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;dt("matTooltip",r.Name),o(),v(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function d0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function u0(i,c){if(i&1&&(n(0,"tr",28)(1,"td")(2,"a",29),p(3),a()(),n(4,"td",30),p(5),a(),g(6,d0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,p0,e.ID)),o(),v(" ",e.Name,""),o(2),T(e.Code),o(),m("ngForOf",e.Quantities),o(2),T(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[R],decls:42,vars:19,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[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"],[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"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"border-bottom"],[3,"routerLink","queryParams"],[2,"text-align","right"],["class","text-end",4,"ngFor","ngForOf"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,m0,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"),g(26,s0,25,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,c0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,u0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,i0)),o(3),m("routerLink",b(14,n0)),o(3),m("routerLink",b(15,a0)),o(3),m("routerLink",b(16,o0)),o(3),m("routerLink",b(17,r0)),o(3),m("routerLink",b(18,l0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,fe,Q,Ye],encapsulation:2})};var _0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],f0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],C0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],x0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],S0=i=>[i],y0=i=>({ID:i});function D0(i,c){if(i&1){let e=F();n(0,"a",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function v0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a(),n(13,"h6"),p(14,"Year"),a(),n(15,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.MonthFrom),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.MonthTo),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.years),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function w0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,r=s();o(),v(" ",r.months[e.Month-1].ColumnLabel," ")}}function T0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),v(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function P0(i,c){if(i&1&&(n(0,"tr",26)(1,"td")(2,"a",27),p(3),a()(),n(4,"td"),p(5),a(),g(6,T0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",U(12,S0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,y0,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(),m("ngForOf",r.data==null?null:r.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function F0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function I0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),I(2,"td")(3,"td"),g(4,F0,3,4,"td",28),n(5,"td",29),p(6),d(7,"sum"),d(8,"number"),a()()()),i&2){let e=s();o(4),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(2),v(" ",y(8,5,y(7,2,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}var Ln=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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"}];openExportModal(){this.matDialog.open(q,{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 f=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(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[R],decls:43,vars:20,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Code",1,"align-left",2,"width","120px"],["class","text-end small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-end",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month From",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month To",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Scope",3,"modelChange","model","options"],[1,"text-end","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,D0,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"),g(26,v0,19,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,w0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,P0,11,16,"tr",14),a(),g(42,I0,9,8,"tfoot",15),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,_0)),o(3),m("routerLink",b(15,g0)),o(3),m("routerLink",b(16,f0)),o(3),m("routerLink",b(17,C0)),o(3),m("routerLink",b(18,x0)),o(3),m("routerLink",b(19,h0)),o(14),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,z,B,L,ae,ge,De,fe,Q,oe,ie],encapsulation:2})};var b0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],M0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],L0=i=>[i],R0=i=>({ID:i});function k0(i,c){if(i&1){let e=F();n(0,"button",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function W0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(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",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function N0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),T(e)}}function A0(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,N0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function G0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function H0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,L0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,R0,r[1])),o(),T(r[e])}}function Q0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;v(" ",r[e]," ")}}function Y0(i,c){if(i&1&&(n(0,"td",13),g(1,H0,3,7,"ng-container",28)(2,Q0,1,1,"ng-template",null,1,V),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function j0(i,c){if(i&1&&(n(0,"tr",13),g(1,Y0,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[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","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,k0,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Product Sold "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",7),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",7),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",7),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,W0,16,10,"ng-template",null,0,V),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,A0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,G0,2,1,"th",14),a()(),n(39,"tbody"),g(40,j0,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,b0)),o(3),m("routerLink",b(15,E0)),o(3),m("routerLink",b(16,M0)),o(3),m("routerLink",b(17,V0)),o(3),m("routerLink",b(18,B0)),o(3),m("routerLink",b(19,O0)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var q0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],U0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],K0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],z0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],X0=(i,c,e)=>({CategoryID:i,From:c,To:e}),J0=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],wr=i=>({CategoryID:i});function Z0(i,c){if(i&1){let e=F();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function $0(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function ec(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,$0,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Exclude Zero"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function tc(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function ic(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function nc(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function ac(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),I(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),I(6,"p-treeTableSortIcon",32),a(),g(7,tc,3,0,"th",33),n(8,"th",34),p(9," Gross "),I(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),I(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),I(16,"p-treeTableSortIcon",39),a(),g(17,ic,3,0,"th",40)(18,nc,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function oc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),T(C(5,6,e.DisplayedCost))}}function rc(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),T(C(5,6,e.DisplayedProfit))}}function lc(i,c){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=s(2).rowData;dt("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),v("",C(4,8,e.DisplayedPercentage),"%")}}function pc(i,c){if(i&1&&(n(0,"td"),g(1,lc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function mc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),I(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,oc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,rc,6,8,"td",55)(34,pc,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,vr))("queryParams",st(51,X0,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(r.Name),o(2),dt("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),T(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),T(C(19,36,r.DisplayedGross)),o(3),dt("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,J0))("queryParams",U(56,wr,r.ID)),o(3),T(C(25,42,r.DisplayedTotalDiscount)),o(3),dt("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,vr))("queryParams",U(59,wr,r.ID)),o(),T(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function sc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function cc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function dc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function uc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,sc,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,cc,3,3,"td",61)(18,dc,3,3,"td",63),a()),i&2){let e=s(2);o(4),v(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),T(C(10,9,e.data.Aggregate.TotalGross)),o(3),v(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function _c(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,ac,19,3,"ng-template",25)(4,mc,35,61,"ng-template",26)(5,uc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,z0))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Z0,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"),g(17,ec,29,15,"ng-template",null,0,V),a(),g(19,_c,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,q0)),o(3),m("routerLink",b(11,U0)),o(3),m("routerLink",b(12,K0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,Zo,Io,ir,$o,er,tr,fe,Q,Ye,un,ie,ee,X,J],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 gc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Cc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function xc(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function hc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function Sc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function yc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Value)}}function Dc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Value))}}function vc(i,c){if(i&1&&(n(0,"td"),g(1,yc,2,1,"span",22)(2,Dc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function wc(i,c){if(i&1&&(n(0,"tr"),g(1,vc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function Tc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e),"")}}function Pc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,Tc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Fc(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,Sc,2,2,"th",20),a()(),n(5,"tbody"),g(6,wc,2,1,"tr",21),a(),g(7,Pc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{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 f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=l.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xc,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"),g(17,hc,16,9,"ng-template",null,0,V),a(),n(19,"content"),g(20,Fc,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,gc)),o(3),m("routerLink",b(11,fc)),o(3),m("routerLink",b(12,Cc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var Ic=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],bc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Mc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Vc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{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)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],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"],["class","container-fluid mt-5",4,"ngIf"],[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"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),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"),g(16,Mc,10,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,Vc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Ic)),o(3),m("routerLink",b(9,bc)),o(3),m("routerLink",b(10,Ec)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ni],encapsulation:2})};var Bc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Oc(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Lc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),I(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),I(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{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 f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),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,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[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=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,Oc,13,9,"ng-template",null,0,V),a(),g(8,Lc,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,Bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,Et,Q],encapsulation:2})};function Rc(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function kc(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Wc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(C(3,5,e.Visitor)),o(3),T(C(6,7,e.Orders)),o(3),T(C(9,9,e.TotalVisitor)),o(3),T(C(12,11,e.Sales)),o(3),T(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Nc(i,c){if(i&1&&(n(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),p(5,"Number of Person"),a(),n(6,"th",15),p(7,"Orders"),a(),n(8,"th",15),p(9,"Total Visitor"),a(),n(10,"th",15),p(11,"Sales"),a(),n(12,"th",16),p(13,"Average Spending"),a()()(),n(14,"tbody"),g(15,Wc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),T(C(23,8,y(22,5,e.data,"Orders"))),o(4),T(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),T(C(31,18,y(30,15,e.data,"Sales"))),o(4),T(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Rc,3,0,"a",2),a(),n(3,"filters"),g(4,kc,10,6,"ng-template",null,0,V),a(),n(6,"content"),g(7,Nc,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Ac=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Gc(i,c){if(i&1){let e=F();n(0,"a",18),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",19),p(2," Export "),a()}}function Hc(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Yc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Revenue))}}function jc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",15),p(4),d(5,"number"),a(),n(6,"td",15),p(7),d(8,"quantityFraction"),a(),n(9,"td",15),p(10),d(11,"amountFraction"),a(),n(12,"td",16),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",15),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),g(20,Yc,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),T(e.TimeFormat),o(2),T(C(5,7,e.Count)),o(3),T(C(8,9,e.Quantity)),o(3),T(C(11,11,e.Sales)),o(3),T(C(15,15,C(14,13,e.Tax))),o(4),T(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function qc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),T(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[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"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Gc,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Hc,10,6,"ng-template",null,0,V),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(),g(26,Qc,2,0,"th",11),a()(),n(27,"tbody"),g(28,jc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),I(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,qc,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Ac)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),T(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),T(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),T(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),T(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),T(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,Qo,ie,X,J],encapsulation:2})};var Uc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],$a=(i,c)=>({From:i,To:c}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],zc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Xc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Jc(i,c){if(i&1&&(n(0,"content")(1,"div",12),I(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.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 c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(c,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(D(W),D(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],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"],[4,"ngIf"],[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=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),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"),g(16,Xc,13,11,"ng-template",null,0,V),a(),g(18,Jc,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,Uc))("queryParams",de(12,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,Kc))("queryParams",de(16,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,zc))("queryParams",de(20,$a,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var td={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=M.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,Jo]},{provide:nn,useValue:td}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);_o("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[At,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
+ `],encapsulation:2})};var nd=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function ad(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function od(i,c){if(i&1&&(n(0,"div",14),I(1,"POS-line-chart",15),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var jn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ee=>this.series?.name==Ee?.name);let l=[],f="",w=this.point.index;return r.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(l=Ee.name.split(" "),f+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
5
5
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(Ee.points[w].y)}</br>
6
- `)}),f}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[R],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"a",3),F(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),g(7,ad,22,13,"ng-template",null,0,M),a(),n(9,"content"),g(10,od,2,2,"div",5),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(3),m("routerLink",b(6,nd)),o(7),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,pe,De,Et,li,fe,Q],encapsulation:2})};var rd=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ld=(i,c)=>({"text-success":i,"text-danger":c}),Tr=(i,c)=>({"text-success fw-bold":i,"text-danger fw-bold":c});function pd(i,c){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function md(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(5),x("ngModel",e.pageData.Filter.FromYear),m("items",e.Years),o(2),x("ngModel",e.pageData.Filter.ToYear),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Option.Currencies)}}function sd(i,c){if(i&1&&(n(0,"th",29),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=c.$implicit,r=s(2);m("colSpan",y(2,5,r.filterSales(y(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),v(" ",e,"")}}function cd(i,c){i&1&&(n(0,"th",33),p(1," Sales"),a())}function dd(i,c){i&1&&(n(0,"th",32),p(1," Tax"),a())}function ud(i,c){if(i&1&&(se(0),g(1,cd,2,0,"th",30),d(2,"GetChildrenArray"),d(3,"sum"),g(4,dd,2,0,"th",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"th",32),p(8," Sales + Tax"),a(),ce()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",y(3,5,r.filterSales(y(2,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,11,r.filterSales(y(5,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0)}}function _d(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit,t=s(2);o(),v(" ",C(3,4,y(2,1,t.filterSales(r.Sales,"Year",e),"Sales")),"")}}function gd(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit,t=s(2);o(),v(" ",C(3,4,y(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function fd(i,c){if(i&1&&(se(0),g(1,_d,4,6,"td",31),d(2,"GetChildrenArray"),d(3,"sum"),g(4,gd,4,6,"td",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",32),p(8),d(9,"sum"),d(10,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,r=s().$implicit,t=s(2);o(),m("ngIf",y(3,6,t.filterSales(y(2,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,12,t.filterSales(y(5,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0),o(4),v(" ",C(10,18,y(9,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")),"")}}function Cd(i,c){if(i&1&&(n(0,"tr",34)(1,"td"),p(2),d(3,"Month"),a(),g(4,fd,11,20,"ng-container",24),n(5,"td",28),d(6,"sum"),d(7,"sum"),p(8),d(9,"sum"),d(10,"number"),a(),n(11,"td",28),d(12,"sum"),d(13,"sum"),p(14),d(15,"sum"),d(16,"number"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(C(3,6,e.Month)),o(2),m("ngForOf",r.data.HeaderList),o(),m("ngClass",de(30,Tr,y(6,8,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,y(7,11,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),v(" ",C(10,17,y(9,14,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),m("ngClass",de(33,Tr,y(12,19,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,y(13,22,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),v(" ",C(16,28,y(15,25,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function xd(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(4,7,y(3,4,r.filterSales(y(2,1,r.data.Data,"Sales"),"Year",e),"Sales")),"")}}function hd(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(4,7,y(3,4,r.filterSales(y(2,1,r.data.Data,"Sales"),"Year",e),"Tax")),"")}}function Sd(i,c){if(i&1&&(se(0),g(1,xd,5,9,"td",35),d(2,"GetChildrenArray"),d(3,"sum"),g(4,hd,5,9,"td",36),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",37),p(8),d(9,"GetChildrenArray"),d(10,"sum"),d(11,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",y(3,6,r.filterSales(y(2,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,12,r.filterSales(y(5,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(4),v(" ",C(11,21,y(10,18,r.filterSales(y(9,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")),"")}}function yd(i,c){if(i&1&&(n(0,"div",18)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Month"),a(),g(6,sd,4,8,"th",22),n(7,"th",23),p(8,"Diff"),a(),n(9,"th",23),p(10,"%"),a()(),n(11,"tr"),g(12,ud,9,14,"ng-container",24),a()(),n(13,"tbody"),g(14,Cd,17,36,"tr",25),a(),n(15,"tfoot",26)(16,"tr")(17,"td",27),p(18,"Total :"),a(),g(19,Sd,12,23,"ng-container",24),n(20,"td",28),p(21),d(22,"number"),a()()()()()),i&2){let e=s();o(6),m("ngForOf",e.data.HeaderList),o(6),m("ngForOf",e.data.HeaderList),o(2),m("ngForOf",e.data.Data),o(5),m("ngForOf",e.data.HeaderList),o(),m("ngClass",de(8,ld,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),v(" ",C(22,6,e.data.TotalDiff),"")}}var qn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(q,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],["class"," text-center border-start border-end",3,"colSpan",4,"ngFor","ngForOf"],["rowspan","2",1,"text-end"],[4,"ngFor","ngForOf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-center","border-start","border-end",3,"colSpan"],["class","text-end border-start",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],[1,"text-end","border-start"],[1,"border-bottom"],["class","text-end text-success",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,pd,3,0,"a",2),n(3,"a",3),F(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,md,23,15,"ng-template",null,0,M),a(),n(9,"content"),g(10,yd,23,11,"div",5),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,rd)),o(7),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,fe,Q,Ye,oe,fn,Yo,ie,X],encapsulation:2})};var Dd=()=>["/menu/Reports/Sales_Report/Standard/Daily"],eo=(i,c)=>({From:i,To:c}),vd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],wd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],Pr=i=>({"is-weekend":i});function Td(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Pd(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),x("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Id(i,c){i&1&&(n(0,"th",39),p(1," Tax "),a())}function Fd(i,c){i&1&&(n(0,"th",40),p(1,"Net Sales + Tax"),a())}function bd(i,c){i&1&&(n(0,"th",41),p(1,"Cost"),a())}function Ed(i,c){i&1&&(n(0,"th",42),p(1," Profit "),a())}function Md(i,c){i&1&&(n(0,"th",43),p(1," Profit + Tax Include "),a())}function Vd(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Tax))}}function Bd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v("",C(2,1,e.SalesNetWithTax)," ")}}function Od(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost),"")}}function Ld(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit),"")}}function Rd(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.ProfitWithTax),"")}}function kd(i,c){if(i&1&&(n(0,"tr",44)(1,"td",44),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",34),p(8),d(9,"number"),a(),n(10,"td",34),p(11),d(12,"quantityFraction"),a(),n(13,"td",34),p(14),d(15,"amountFraction"),a(),n(16,"td",34),p(17),d(18,"amountFraction"),a(),g(19,Vd,3,3,"td",45)(20,Bd,3,3,"td",35)(21,Od,3,3,"td",36)(22,Ld,3,4,"td",38)(23,Rd,3,4,"td",38),a()),i&2){let e=c.$implicit,r=s(2);m("ngClass",U(27,Pr,r.data.DayOfWeekend)),o(),m("ngClass",U(29,Pr,e.DayOfWeekend)),o(),v(" ",y(3,13,e.Day,"EEEE")," "),o(3),T(y(6,16,e.Day,"dd")),o(3),T(C(9,19,e.Count)),o(3),T(C(12,21,e.Quantity)),o(3),T(C(15,23,e.Gross)),o(3),T(C(18,25,e.SalesNet)),o(2),m("ngIf",r.data.ShowTax),o(),m("ngIf",r.data.ShowTax),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost),o(),m("ngIf",!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost)}}function Wd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax")),"")}}function Nd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"SalesNetWithTax")),"")}}function Ad(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost")),"")}}function Gd(i,c){if(i&1&&(n(0,"td",49),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.data.Data,"Profit")),"")}}function Hd(i,c){if(i&1&&(n(0,"td",48),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.data.Data,"ProfitWithTax")),"")}}function Qd(i,c){if(i&1){let e=I();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Day"),a(),n(6,"th",22),p(7,"Dt."),a(),n(8,"th",23),p(9,"Orders "),a(),n(10,"th",24),p(11," Quantity"),a(),n(12,"th",25),p(13," Gross"),a(),n(14,"th",26),p(15," Net Sales"),a(),g(16,Id,2,0,"th",27)(17,Fd,2,0,"th",28)(18,bd,2,0,"th",29)(19,Ed,2,0,"th",30)(20,Md,2,0,"th",31),a()(),n(21,"tbody"),g(22,kd,24,31,"tr",32),a(),n(23,"tfoot")(24,"tr"),F(25,"td",33)(26,"td",33),n(27,"td",34),p(28),d(29,"sum"),d(30,"number"),a(),n(31,"td",34),p(32),d(33,"sum"),d(34,"quantityFraction"),a(),n(35,"td",34),p(36),d(37,"sum"),d(38,"amountFraction"),a(),n(39,"td",34),p(40),d(41,"sum"),d(42,"amountFraction"),a(),g(43,Wd,4,6,"td",35)(44,Nd,4,6,"td",35)(45,Ad,4,6,"td",36)(46,Gd,5,10,"td",37)(47,Hd,5,10,"td",38),a()()()()}if(i&2){let e=s();o(16),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(6),T(C(30,18,y(29,15,e.data.Data,"Count"))),o(4),T(C(34,23,y(33,20,e.data.Data,"Quantity"))),o(4),T(C(38,28,y(37,25,e.data.Data,"Gross"))),o(4),T(C(42,33,y(41,30,e.data.Data,"SalesNet"))),o(3),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost)}}var Un=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.activatedRoute=w}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(q,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[R],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["style","width: 120px","class"," flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","SalesNetWithTax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["style","width: 160px","class"," flex-right","mat-sort-header","ProfitWithTax","arrowPosition","before",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-danger",3,"ngClass",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Td,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),g(17,Pd,22,16,"ng-template",null,0,M),a(),n(19,"content"),g(20,Qd,48,35,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Dd))("queryParams",de(13,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(16,vd))("queryParams",de(17,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(20,wd))("queryParams",de(21,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,ae,ge,Gt,fe,Q,Ye,oe,ie,ee,X,J],encapsulation:2})};var Yd=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function jd(i,c){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function qd(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Currency"),a(),n(15,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",15),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Ud(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function Kd(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function zd(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function Xd(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Profit)," ")}}function Jd(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",25),p(5),d(6,"number"),a(),n(7,"td",25),p(8),d(9,"quantityFraction"),a(),g(10,zd,3,3,"td",26),n(11,"td",25),p(12),d(13,"amountFraction"),a(),n(14,"td",25),p(15),d(16,"amountFraction"),a(),n(17,"td",27),p(18),d(19,"amountFraction"),a(),n(20,"td",28),p(21),d(22,"amountFraction"),a(),g(23,Xd,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(C(3,9,e.Month)),o(3),T(C(6,11,e.Count)),o(3),T(C(9,13,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),T(C(13,15,e.Gross)),o(3),T(C(16,17,e.Sales)),o(3),T(C(19,19,e.Tax)),o(3),T(C(22,21,e.SalesNetWithTax)),o(2),m("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Zd(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost")),"")}}function $d(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Profit")),"")}}function eu(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Month"),a(),n(6,"th",20),p(7,"Orders"),a(),n(8,"th",21),p(9,"Quantity"),a(),g(10,Ud,2,0,"th",22),n(11,"th",21),p(12,"Gross"),a(),n(13,"th",21),p(14,"Sales"),a(),n(15,"th",21),p(16,"Tax"),a(),n(17,"th",21),p(18,"Sales + Tax"),a(),g(19,Kd,2,0,"th",22),a()(),n(20,"tbody"),g(21,Jd,24,23,"tr",23),a(),n(22,"tfoot")(23,"tr",24),F(24,"td"),n(25,"td",25),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",25),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),g(33,Zd,4,6,"td",26),n(34,"td",25),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",25),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",27),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",28),p(47),d(48,"sum"),d(49,"amountFraction"),a(),g(50,$d,4,6,"td",29),a()()()()),i&2){let e=s();o(10),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(5),v("",C(28,14,y(27,11,e.data.Data,"Count"))," "),o(4),T(C(32,19,y(31,16,e.data.Data,"Quantity"))),o(3),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),v("",C(37,24,y(36,21,e.data.Data,"Gross"))," "),o(4),v("",C(41,29,y(40,26,e.data.Data,"Sales"))," "),o(4),v(" ",C(45,34,y(44,31,e.data.Data,"Tax")),""),o(4),v(" ",C(49,39,y(48,36,e.data.Data,"SalesNetWithTax")),""),o(3),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var Kn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,jd,3,0,"a",2),n(3,"a",3),F(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,qd,22,14,"ng-template",null,0,M),a(),n(9,"content"),g(10,eu,51,41,"div",5),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,Yd)),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,B,L,pe,De,fe,Q,Ye,oe,fn,ie,X,J],encapsulation:2})};var tu=()=>["/menu/Reports/Sales_Report/Standard/Daily"],Ir=(i,c)=>({From:i,To:c}),iu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],nu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function au(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",12),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function ou(i,c){if(i&1&&(n(0,"content")(1,"div",13),F(2,"POS-line-chart",14),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var zn=class i extends ne{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(f=>`${f.getDate()} ${V.Months[f.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[R],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,au,13,12,"ng-template",null,0,M),a(),g(18,ou,3,2,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(10,tu))("queryParams",de(11,Ir,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(14,iu))("queryParams",de(15,Ir,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(18,nu)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var ru=()=>["/menu/Reports/Sales_Report/Standard/Daily"],lu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],pu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function mu(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function su(i,c){if(i&1&&(n(0,"div",12),F(1,"POS-line-chart",13),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.ChartData)}}var Xn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(f=>parseInt(f)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),g(16,mu,13,9,"ng-template",null,0,M),a(),n(18,"content"),g(19,su,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,ru)),o(3),m("routerLink",b(9,lu)),o(3),m("routerLink",b(10,pu)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,Et,fe,Q],encapsulation:2})};var cu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],du=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],uu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function _u(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function gu(i,c){if(i&1&&(n(0,"div",13),F(1,"POS-pie-chart",14),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Jn=class i extends ne{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),g(16,_u,13,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,gu,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,cu)),o(3),m("routerLink",b(9,du)),o(3),m("routerLink",b(10,uu)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,fe],encapsulation:2})};var to=Qt(Oi());var fu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],Cu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],xu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],hu=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),Su=(i,c,e)=>({EntityIDs:i,From:c,To:e}),vi=(i,c)=>({"text-danger":i,"text-success":c}),yu=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Du=(i,c,e)=>({EntityID:i,From:c,To:e}),Fr=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),br=(i,c)=>({"text-success":i,"text-danger":c});function vu(i,c){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",13),p(2," Export "),a()}}function wu(i,c){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),S("selectedOutletGroupIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),F(24,"i",23),a(),n(25,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),x("ngModel",e.pageData.Filter.TagIDs),o(3),m("showClear",!0),x("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption)}}function Tu(i,c){i&1&&(n(0,"th",55),p(1," Prev "),a())}function Pu(i,c){i&1&&(n(0,"th",56),p(1," Now "),a())}function Iu(i,c){i&1&&(n(0,"th",57),p(1," Orders "),a())}function Fu(i,c){i&1&&(n(0,"th",58),p(1," Qty "),a())}function bu(i,c){i&1&&(n(0,"th",59),p(1," Gross "),a())}function Eu(i,c){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function Mu(i,c){i&1&&(n(0,"th",61),p(1," Sales "),a())}function Vu(i,c){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function Bu(i,c){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function Ou(i,c){i&1&&(se(0),n(1,"th",64),p(2," Target "),a(),ce())}function Lu(i,c){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function Ru(i,c){if(i&1&&(se(0),g(1,Lu,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),ce()),i&2){let e=s(2);o(),m("ngIf",y(2,1,e.data.Data,"AchievementWithTax")||y(3,4,e.data.Data,"Achievement"))}}function ku(i,c){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function Wu(i,c){i&1&&(n(0,"th",68),p(1," Tax "),a())}function Nu(i,c){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Au(i,c){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function Gu(i,c){i&1&&(n(0,"th",71),p(1," Cost "),a())}function Hu(i,c){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Qu(i,c){i&1&&(n(0,"th",72),p(1," Expense "),a())}function Yu(i,c){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function ju(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,hu,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function qu(i,c){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(5,Su,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),T(y(3,2,e.Count,"1.0-0"))}}function Uu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function Ku(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function zu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function Xu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function Ju(i,c){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.AverageDailySales))}}function Zu(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.InventoryValue))}}function $u(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.RangeSalesTarget)," ")}}function e_(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;o(),m("ngClass",de(4,vi,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),v(" ",C(3,2,e.AchievementWithTax)," ")}}function t_(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,vi,e.Achievement<100,e.Achievement>100)),o(),v(" ",C(2,2,e.Achievement)," ")}}function i_(i,c){if(i&1&&(n(0,"td",70),g(1,e_,4,7,"ng-container",78)(2,t_,3,7,"ng-template",null,1,M),a()),i&2){let e=Ze(3),r=s(3);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function n_(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.SalesTarget))}}function a_(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function o_(i,c){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(11,yu))("queryParams",st(12,Du,e.EntityID,y(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),T(C(6,9,e.SalesWithTax))}}function r_(i,c){if(i&1&&(se(0),p(1),d(2,"number"),ce()),i&2){let e=s(2).$implicit;o(),v(" ",y(2,1,e.Increase,"1.0-0")," ")}}function l_(i,c){if(i&1&&p(0),i&2){let e=s(2).$implicit;v(" ",e.Increase," ")}}function p_(i,c){if(i&1&&(n(0,"td",79),g(1,r_,3,4,"ng-container",78)(2,l_,1,1,"ng-template",null,2,M),a()),i&2){let e=Ze(3),r=s().$implicit;m("ngClass",de(3,Fr,r.IsNegative,r.IsPositive)),o(),m("ngIf",r.Increase!=="-")("ngIfElse",e)}}function m_(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function s_(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;o(),m("ngClass",de(4,vi,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),v(" ",C(3,2,e.ProfitWithTax),"")}}function c_(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,vi,e.Profit<0,e.Profit>0)),o(),v(" ",C(2,2,e.Profit),"")}}function d_(i,c){if(i&1&&(n(0,"td",70),g(1,s_,4,7,"ng-container",78)(2,c_,3,7,"ng-template",null,3,M),a()),i&2){let e=Ze(3),r=s(3);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function u_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Expense)," ")}}function __(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),g(5,Yu,2,1,"td",73)(6,ju,2,5,"td",74)(7,qu,4,9,"td",43)(8,Uu,3,3,"td",43)(9,Ku,3,3,"td",43)(10,zu,3,4,"td",43)(11,Xu,3,3,"td",43)(12,Ju,4,3,"td",43)(13,Zu,4,3,"td",43)(14,$u,3,3,"td",43),se(15),g(16,i_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),ce(),g(19,n_,4,3,"td",43)(20,a_,3,3,"td",51)(21,o_,7,16,"td",43)(22,p_,4,6,"td",53)(23,m_,3,3,"td",54)(24,d_,4,2,"td",43)(25,u_,3,3,"td",43),d(26,"sum"),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),T(e.Name),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.column.Orders.selected),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.Gross.selected),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.Sales.selected),o(),m("ngIf",t.column.AvgDaily.selected),o(),m("ngIf",t.column.Inventory.selected),o(),m("ngIf",t.column.TargetDaily.selected),o(2),m("ngIf",y(17,20,t.data.Data,"AchievementWithTax")||y(18,23,t.data.Data,"Achievement")),o(3),m("ngIf",t.column.DailyTarget.selected),o(),m("ngIf",t.column.Tax.selected),o(),m("ngIf",t.column.SalesNTax.selected),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&y(26,26,t.data.Data,"Expense")!=0)}}function g_(i,c){i&1&&F(0,"td",50)}function f_(i,c){i&1&&F(0,"td",50)}function C_(i,c){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=s(2);o(2),v(" ",y(4,4,y(3,1,e.data.Data,"Count"),"1.0-0"),"")}}function x_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function h_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Gross"))," ")}}function S_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function y_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function D_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"AverageDailySales"))," ")}}function v_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"InventoryValue"))," ")}}function w_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function T_(i,c){if(i&1&&(se(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),ce()),i&2){let e=s(3);o(),m("ngClass",de(13,vi,y(2,2,e.data.Data,"AchievementWithTax")<100,y(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),v(" ",C(6,11,y(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function P_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,vi,y(1,2,e.data.Data,"Achievement")<100,y(2,5,e.data.Data,"Achievement")>100)),o(3),v(" ",C(5,11,y(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)),"")}}function I_(i,c){if(i&1&&(n(0,"td",70),g(1,T_,7,16,"ng-container",78)(2,P_,6,16,"ng-template",null,4,M),a()),i&2){let e=Ze(3),r=s(2);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function F_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"SalesTarget"))," ")}}function b_(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function E_(i,c){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function M_(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Fr,e.comparation<0,e.comparation>0)),o(),v(" ",y(2,2,e.comparation,"1.0-0")," ")}}function V_(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function B_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,br,y(1,2,e.data.Data,"Profit")>0,y(2,5,e.data.Data,"Profit")<0)),o(3),T(C(5,11,y(4,8,e.data.Data,"Profit")))}}function O_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,br,y(1,2,e.data.Data,"ProfitWithTax")>0,y(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),v("",C(5,11,y(4,8,e.data.Data,"ProfitWithTax"))," ")}}function L_(i,c){if(i&1&&(n(0,"td",70),g(1,B_,6,16,"span",53)(2,O_,6,16,"span",53),a()),i&2){let e=s(2);o(),m("ngIf",e.pageData.IgnoreTax),o(),m("ngIf",!e.pageData.IgnoreTax)}}function R_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function k_(i,c){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),g(8,Tu,2,0,"th",30)(9,Pu,2,0,"th",31)(10,Iu,2,0,"th",32)(11,Fu,2,0,"th",33)(12,bu,2,0,"th",34)(13,Eu,2,0,"th",35)(14,Mu,2,0,"th",36)(15,Vu,2,0,"th",37)(16,Bu,2,0,"th",38)(17,Ou,3,0,"ng-container",39)(18,Ru,4,7,"ng-container",39)(19,ku,2,0,"th",40)(20,Wu,2,0,"th",41)(21,Nu,2,1,"th",42)(22,Au,2,0,"th",43)(23,Gu,2,0,"th",44)(24,Hu,2,1,"th",42)(25,Qu,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),g(28,__,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),F(31,"td",48),g(32,g_,1,0,"td",49)(33,f_,1,0,"td",49),F(34,"td",50),g(35,C_,5,7,"td",43)(36,x_,4,6,"td",43)(37,h_,4,6,"td",43)(38,S_,4,7,"td",43)(39,y_,4,6,"td",43)(40,D_,4,6,"td",43)(41,v_,4,6,"td",43)(42,w_,4,6,"td",43),se(43),g(44,I_,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),ce(),g(47,F_,4,6,"td",43)(48,b_,4,6,"td",51)(49,E_,5,6,"td",52)(50,M_,3,8,"td",53)(51,V_,4,6,"td",54)(52,L_,3,2,"td",43)(53,R_,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=s();o(8),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.AvgDaily.selected),o(),m("ngIf",e.column.Inventory.selected),o(),m("ngIf",e.column.TargetDaily.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.DailyTarget.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(26,37,e.data.Data,"Expense")!=0),o(3),m("ngForOf",e.data.Data),o(4),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(2),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.AvgDaily.selected),o(),m("ngIf",e.column.Inventory.selected),o(),m("ngIf",e.column.TargetDaily.selected),o(2),m("ngIf",y(45,40,e.data.Data,"AchievementWithTax")||y(46,43,e.data.Data,"Achievement")),o(3),m("ngIf",e.column.DailyTarget.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(54,46,e.data.Data,"Expense")!=0)}}var Zn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);case"Expense":return this.compare(t.Expense,l.Expense,f);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,f);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,f);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,f);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,to.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,to.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,vu,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,wu,26,16,"ng-template",null,0,M),a(),n(19,"content"),g(20,k_,55,49,"div",11),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,fu)),o(3),m("routerLink",b(11,Cu)),o(3),m("routerLink",b(12,xu)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,fe,yn,oe,ti,ie,ee,X,J],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var W_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],N_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],A_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],G_=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),Er=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function H_(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Q_(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),S("modelChange",function(t){u(e);let l=s();return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s();o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.isCompare)}}function Y_(i,c){i&1&&(n(0,"th",41),p(1," Prev "),a())}function j_(i,c){i&1&&(n(0,"th",42),p(1," Now "),a())}function q_(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function U_(i,c){i&1&&(n(0,"th",44),p(1," Cost "),a())}function K_(i,c){if(i&1&&(n(0,"th",26),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function z_(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function X_(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,G_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function J_(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Er,e.IsNegative,e.IsPositive)),o(),v(" ",C(2,2,e.Increase)," ")}}function Z_(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function $_(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function eg(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,z_,2,1,"td",45)(4,X_,2,5,"td",46),n(5,"td",35),p(6),d(7,"number"),a(),n(8,"td",35),p(9),d(10,"quantityFraction"),a(),n(11,"td",35),p(12),d(13,"amountFraction"),a(),n(14,"td",35),p(15),d(16,"amountFraction"),a(),n(17,"td",36),p(18),d(19,"amountFraction"),a(),n(20,"td",37),p(21),d(22,"amountFraction"),a(),g(23,J_,3,7,"td",38)(24,Z_,3,3,"td",39)(25,$_,3,3,"td",40),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(2),T(y(7,12,e.Count,".0-0")),o(3),T(C(10,15,e.Quantity)),o(3),T(C(13,17,e.Gross)),o(3),T(C(16,19,e.SalesNet)),o(3),v(" ",C(19,21,e.Tax)," "),o(3),v(" ",C(22,23,e.SalesWithTax)," "),o(2),m("ngIf",r.showCompareColumn&&r.roleService.report.Profit),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function tg(i,c){i&1&&F(0,"td",34)}function ig(i,c){i&1&&F(0,"td",34)}function ng(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Er,e.comparation,e.comparation)),o(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function ag(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function og(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",e.pageData.IgnoreTax?C(3,4,y(2,1,e.data==null?null:e.data.Data,"Profit")):C(5,9,y(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function rg(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Outlet"),a(),g(6,Y_,2,0,"th",20)(7,j_,2,0,"th",21),n(8,"th",22),p(9," Orders "),a(),n(10,"th",23),p(11," Quantity "),a(),n(12,"th",24),p(13," Gross "),a(),n(14,"th",25),p(15," Sales "),a(),n(16,"th",26),p(17," Tax "),a(),n(18,"th",27),p(19," Sales + Tax "),a(),g(20,q_,2,0,"th",28)(21,U_,2,0,"th",29)(22,K_,2,1,"th",30),a()(),n(23,"tbody"),g(24,eg,26,25,"tr",31),a(),n(25,"tfoot")(26,"tr",32),g(27,tg,1,0,"td",33)(28,ig,1,0,"td",33),F(29,"td",34),n(30,"td",35),p(31),d(32,"sum"),d(33,"number"),a(),n(34,"td",35),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),n(38,"td",35),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",35),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",36),p(47),d(48,"sum"),d(49,"amountFraction"),a(),n(50,"td",37)(51,"a"),p(52),d(53,"sum"),d(54,"amountFraction"),a()(),g(55,ng,3,8,"td",38)(56,ag,4,6,"td",39)(57,og,6,11,"td",40),a()()()()}if(i&2){let e=s();o(6),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(9),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),dt("altpropcond",e.pageData.IgnoreTax),o(2),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data==null?null:e.data.Data),o(3),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(3),v(" ",y(33,22,y(32,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),v(" ",C(37,28,y(36,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),v(" ",C(41,33,y(40,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),v(" ",C(45,38,y(44,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),v(" ",C(49,43,y(48,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),T(C(54,48,y(53,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}var $n=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[R],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],["style","width: 60px","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["style","width: 120px","arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,H_,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,Q_,13,5,"ng-template",null,0,M),a(),n(19,"content"),g(20,rg,58,50,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(9,W_)),o(3),m("routerLink",b(10,N_)),o(3),m("routerLink",b(11,A_)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,oe,ie,X,J],encapsulation:2})};var lg=()=>["/menu/Reports/Sales_Report/Standard/Compare"],pg=i=>({"flex-right":i});function mg(i,c){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function sg(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function cg(i,c){if(i&1&&(n(0,"th",17),p(1),a()),i&2){let e=c.$implicit,r=c.index;dt("arrowPosition",r?"before":"after"),m("mat-sort-header",e)("ngClass",U(4,pg,e!="Outlet")),o(),v(" ",e,"")}}function dg(i,c){if(i&1&&(n(0,"div",20),p(1),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(r[e])}}function ug(i,c){if(i&1&&(n(0,"div",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),v("",C(2,1,r[e])," ")}}function _g(i,c){if(i&1&&(n(0,"td"),g(1,dg,2,1,"div",18)(2,ug,3,3,"div",19),a()),i&2){let e=c.$implicit;o(),m("ngIf",e=="Outlet"),o(),m("ngIf",e!="Outlet")}}function gg(i,c){if(i&1&&(n(0,"tr"),g(1,_g,3,2,"td",15),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngForOf",r.getKeys(e))}}function fg(i,c){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),T(C(2,1,e))}}function Cg(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,fg,3,3,"td",23),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.DataFooter)}}function xg(i,c){if(i&1){let e=I();n(0,"div",11)(1,"table",12),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr"),g(4,cg,2,6,"th",14),a()(),n(5,"tbody"),g(6,gg,2,1,"tr",15),a(),g(7,Cg,5,1,"tfoot",16),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var ea=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w])return this.compare(t[this.data.Dataheader[w]],l[this.data.Dataheader[w]],f)})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","arrowPosition","ngClass"],["style","color: black",4,"ngIf"],["style","color: black;text-align:right",4,"ngIf"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,mg,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),g(6,sg,10,5,"ng-template",null,0,M),a(),n(8,"content"),g(9,xg,8,3,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,lg)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,ae,ge,Ye,X],encapsulation:2})};var hg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Sg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],yg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Dg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],vg=(i,c)=>({From:i,To:c}),wg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],Tg=i=>({ID:i}),Pg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Ig=(i,c,e,r,t)=>({SalesPersonID:i,From:c,To:e,ListIDs:r,IncludeComplementary:t}),Fg=(i,c,e,r)=>({ID:i,from:c,to:e,IncludeComplementary:r}),bg=i=>({SalesID:i});function Eg(i,c){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",11),p(2," Export"),a()}}function Mg(i,c){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),x("ngModel",e.pageData.Filter.SalesGroupID),m("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),x("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Vg(i,c){i&1&&(n(0,"th",45),p(1," Sales Group"),a())}function Bg(i,c){i&1&&(n(0,"th",46),p(1," Orders"),a())}function Og(i,c){i&1&&(n(0,"th",47),p(1," Sales"),a())}function Lg(i,c){i&1&&(se(0),n(1,"th",48),p(2,"Avg. Daily"),a(),ce())}function Rg(i,c){i&1&&(n(0,"th",49),p(1,"Tax "),a())}function kg(i,c){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Wg(i,c){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Ng(i,c){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Ag(i,c){i&1&&(n(0,"th",55),p(1,"Target "),a())}function Gg(i,c){i&1&&(n(0,"th",56),p(1,"Ach(%) "),a())}function Hg(i,c){if(i&1&&(se(0),g(1,Ag,2,0,"th",53)(2,Gg,2,0,"th",54),ce()),i&2){let e=s(2);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function Qg(i,c){i&1&&(n(0,"th",57),p(1,"Quantity"),a())}function Yg(i,c){i&1&&(n(0,"th",58),p(1,"Basket Size"),a())}function jg(i,c){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function qg(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Group)}}function Ug(i,c){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(12,Pg))("queryParams",qi(13,Ig,e.ID,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),T(y(5,9,e.Orders,".0-0"))}}function Kg(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Sales))}}function zg(i,c){if(i&1&&(se(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.AvgDailySales))}}function Xg(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax),"")}}function Jg(i,c){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",qt(10,Fg,e.ID,y(2,2,r.pageData.Filter.From,"ddMMyyyy"),y(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),v(" ",C(5,8,e.SalesNTax)," ")}}function Zg(i,c){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Cost))}}function $g(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v("",C(2,1,e.Profit)," ")}}function e1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e.Target)," ")}}function t1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e.Achievement),"")}}function i1(i,c){if(i&1&&(se(0),g(1,e1,3,3,"td",44)(2,t1,3,3,"td",44),ce()),i&2){let e=s(3);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function n1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Quantity,"1.0-2")," ")}}function a1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function o1(i,c){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=s().$implicit;o(2),m("queryParams",U(4,bg,e.ID)),o(),T(C(4,2,e.Commission))}}function r1(i,c){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),g(4,qg,2,1,"td",9)(5,Ug,6,19,"td",40)(6,Kg,3,3,"td",41),d(7,"HideSumZero"),g(8,zg,4,3,"ng-container",9)(9,Xg,3,3,"td",42),d(10,"HideSumZero"),g(11,Jg,6,15,"td",40)(12,Zg,3,3,"td",43)(13,$g,3,3,"td",44)(14,i1,3,2,"ng-container",9)(15,n1,3,4,"td",41)(16,a1,3,4,"td",41)(17,o1,5,6,"td",41),a()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(21,wg))("queryParams",U(22,Tg,e.ID)),o(),T(e.Name),o(),m("ngIf",r.data.Show),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",y(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),m("ngIf",r.isShowOutletTarget),o(),m("ngIf",y(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),m("ngIf",r.column.SalesNTax.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),m("ngIf",r.isShowOutletTarget),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Commission.selected)}}function l1(i,c){i&1&&F(0,"td")}function p1(i,c){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),T(y(3,4,y(2,1,e.data.List,"Orders"),".0-0"))}}function m1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.List,"Sales")))}}function s1(i,c){if(i&1&&(se(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),ce()),i&2){let e=s(2);o(2),v(" ",C(4,4,y(3,1,e.data.List,"AvgDailySales"))," ")}}function c1(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"Tax"),e.pageData.FractionDigit),"")}}function d1(i,c){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v("",C(3,4,y(2,1,e.data.List,"SalesNTax"))," ")}}function u1(i,c){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Cost")),"")}}function _1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Profit")),"")}}function g1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.data.List,"Target")),"")}}function f1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(4,7,y(2,1,e.data.List,"Sales")/y(3,4,e.data.List,"Target")*100)," ")}}function C1(i,c){if(i&1&&(se(0),g(1,g1,4,6,"td",44)(2,f1,5,9,"td",44),ce()),i&2){let e=s(2);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function x1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"Quantity"),"1.0-2"),"")}}function h1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"BasketSize"),"1.0-2"),"")}}function S1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Commission")),"")}}function y1(i,c){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),g(8,Vg,2,0,"th",27)(9,Bg,2,0,"th",28)(10,Og,2,0,"th",29),d(11,"HideSumZero"),g(12,Lg,3,0,"ng-container",9)(13,Rg,2,0,"th",30),d(14,"HideSumZero"),g(15,kg,2,0,"th",31)(16,Wg,2,0,"th",32)(17,Ng,2,0,"th",33)(18,Hg,3,2,"ng-container",9)(19,Qg,2,0,"th",34)(20,Yg,2,0,"th",35)(21,jg,2,0,"th",36),a()(),n(22,"tbody"),g(23,r1,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),g(26,l1,1,0,"td",9),n(27,"td",39),p(28,"Total:"),a(),g(29,p1,4,7,"td",40)(30,m1,4,6,"td",41),d(31,"HideSumZero"),g(32,s1,5,6,"ng-container",9)(33,c1,4,7,"td",42),d(34,"HideSumZero"),g(35,d1,4,6,"td",40)(36,u1,4,6,"td",43)(37,_1,4,6,"td",44)(38,C1,3,2,"ng-container",9)(39,x1,4,7,"td",41)(40,h1,4,7,"td",41)(41,S1,4,6,"td",41),a()()()()()()}if(i&2){let e=s();o(8),m("ngIf",e.data.Show),o(),m("ngIf",e.column.Orders.selected),o(),m("ngIf",y(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",y(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Commission.selected),o(2),m("ngForOf",e.data.List),o(3),m("ngIf",e.data.Show),o(3),m("ngIf",e.column.Orders.selected),o(),m("ngIf",y(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",y(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Commission.selected)}}var ta=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=f}isShowCommission=!1;roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission"},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,f);case"Target":return this.compare(t.Target,l.Target,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,f);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,f);case"Commission":return this.compare(t.Commission,l.Commission,f);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(Yt(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>et(Je({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Bo),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[R],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px;","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px;","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),g(3,Eg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,Mg,22,13,"ng-template",null,0,M),a(),g(25,y1,42,37,"content",9),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(3),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(18,hg)),o(3),m("routerLink",b(19,Sg)),o(3),m("routerLink",b(20,yg)),o(3),m("routerLink",b(21,Dg))("queryParams",de(22,vg,y(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,ae,ge,De,Q,oe,ti,ie,ee,X],encapsulation:2})};var D1=()=>["/menu/Reports/Sales_Report/Standard/Person"],v1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],w1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],T1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],P1=(i,c)=>({From:i,To:c}),Mr=i=>({ID:i}),Vr=(i,c,e,r)=>({SalesID:i,From:c,To:e,VariantName:r});function I1(i,c){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",18),p(2," Export "),a()}}function F1(i,c){if(i&1){let e=I();se(0),n(1,"div",24)(2,"div",25)(3,"datepicker",26),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",27)(5,"app-timepicker",28),S("timeChange",function(t){u(e);let l=s(3);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=s(3);return _(l.timeFromChange(t))}),a()()(),n(6,"div",29)(7,"div",25)(8,"datepicker",30),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"div",27)(10,"app-timepicker",28),S("timeChange",function(t){u(e);let l=s(3);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=s(3);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(3);o(3),m("width",100),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),m("width",100),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function b1(i,c){if(i&1){let e=I();n(0,"div")(1,"datepicker",31),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",32)(3,"datepicker",33),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(3);o(),x("date",e.pageData.Filter.From),m("width",100),o(2),x("date",e.pageData.Filter.To),m("width",100)}}function E1(i,c){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),g(9,F1,11,6,"ng-container",22)(10,b1,4,4,"ng-template",null,1,M),n(12,"h6"),p(13,"Filter Invoice By"),a(),n(14,"radio-options",23),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=Ze(11),r=s(2);o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.ID),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),m("options",r.filterInvoiceBy),x("model",r.pageData.Filter.isCreated)}}function M1(i,c){i&1&&F(0,"app-empty-state")}function V1(i,c){i&1&&(n(0,"th",41),p(1," Commission "),a())}function B1(i,c){i&1&&(n(0,"th",41),p(1," Total Commission "),a())}function O1(i,c){if(i&1&&(n(0,"thead",36)(1,"tr",37)(2,"th",38)(3,"h2")(4,"a",39),p(5),a()()()(),n(6,"tr")(7,"th",40),p(8,"Product"),a(),n(9,"th",41),p(10,"Qty"),a(),n(11,"th",41),p(12,"Sales"),a(),g(13,V1,2,0,"th",42)(14,B1,2,0,"th",42),a()()),i&2){let e=s().$implicit,r=s(2);o(4),m("queryParams",U(5,Mr,e.ID)),o(),Xt("",e.Name," - ",e.Code,""),o(8),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function L1(i,c){if(i&1&&(n(0,"div")(1,"a",48),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,r=s(4);bi("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),m("queryParams",qt(14,Vr,e.SalesID,y(2,6,r.pageData.Filter.From,"ddMMyyyy"),y(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),T(C(5,12,e.VariantCommission))}}function R1(i,c){if(i&1&&(n(0,"div")(1,"a",49),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,r=s(4);o(),m("queryParams",qt(10,Vr,e.SalesID,y(2,2,r.pageData.Filter.From,"ddMMyyyy"),y(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),T(C(5,8,e.GroupCommission))}}function k1(i,c){if(i&1&&(n(0,"td",45),g(1,L1,6,19,"div",47)(2,R1,6,15,"div",14),a()),i&2){let e=s().$implicit;o(),m("ngIf",e.VariantCommission||!e.GroupCommission),o(),m("ngIf",e.GroupCommission)}}function W1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalCommission)," ")}}function N1(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",44),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",45),p(7),d(8,"quantityFraction"),a(),n(9,"td",45),p(10),d(11,"amountFraction"),a(),g(12,k1,3,2,"td",46)(13,W1,3,3,"td",46),a()),i&2){let e=c.$implicit,r=s(4);o(2),m("queryParams",U(11,Mr,e.VariantID)),o(),T(e.Name),o(2),T(e.Code),o(2),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.NettSales)),o(2),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function A1(i,c){if(i&1&&(n(0,"tbody"),g(1,N1,14,13,"tr",43),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Item)}}function G1(i,c){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",51),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=s(3).$implicit;bi("text-decoration-line-through",y(1,5,e.Item,"VariantCommission")&&y(2,8,e.Item,"GroupCommission"))("text-danger",y(3,11,e.Item,"VariantCommission")&&y(4,14,e.Item,"GroupCommission")),o(6),T(C(8,20,y(7,17,e.Item,"VariantCommission")))}}function H1(i,c){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3).$implicit;o(),v(" ",C(3,4,y(2,1,e.Item,"GroupCommission"))," ")}}function Q1(i,c){if(i&1&&(n(0,"td",45),g(1,G1,9,22,"div",47),d(2,"sum"),d(3,"sum"),g(4,H1,4,6,"div",14),d(5,"sum"),a()),i&2){let e=s(2).$implicit;o(),m("ngIf",y(2,2,e.Item,"VariantCommission")||!y(3,5,e.Item,"GroupCommission")),o(3),m("ngIf",y(5,8,e.Item,"GroupCommission"))}}function Y1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(3,4,y(2,1,e.Item,"TotalCommission"))," ")}}function j1(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",50)(2,"td"),p(3,"Total"),a(),n(4,"td",45),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",45),p(9),d(10,"sum"),d(11,"amountFraction"),a(),g(12,Q1,6,11,"td",46)(13,Y1,4,6,"td",46),a()()),i&2){let e=s().$implicit,r=s(2);o(5),v(" ",C(7,7,y(6,4,e.Item,"Quantity"))," "),o(4),v(" ",C(11,12,y(10,9,e.Item,"NettSales"))," "),o(3),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function q1(i,c){if(i&1&&(n(0,"table",34),g(1,O1,15,7,"thead",35)(2,A1,2,1,"tbody",14)(3,j1,14,14,"tfoot",14),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Name),o(),m("ngIf",e.Name),o(),m("ngIf",e.Name)}}function U1(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",3),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",4)(3,"a",5),P("click",function(){u(e);let t=s();return _(t.print())}),F(4,"i",6),p(5," Print"),a(),g(6,I1,3,0,"a",7),n(7,"div",8)(8,"button",9),p(9," More "),a(),n(10,"ul",10)(11,"li")(12,"a",11),p(13,"Summary"),a()(),n(14,"li")(15,"a",11),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",11),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",12),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,E1,15,9,"ng-template",null,0,M),a(),n(28,"content")(29,"div",13),g(30,M1,1,0,"app-empty-state",14),n(31,"div",15),g(32,q1,4,3,"table",16),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),o(6),m("routerLink",b(18,D1)),o(3),m("routerLink",b(19,v1)),o(3),m("routerLink",b(20,w1)),o(3),m("routerLink",b(21,T1))("queryParams",de(22,P1,y(22,12,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,15,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.length)==0),o(2),m("ngForOf",e.data.Data)}}var ia=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.activatedRoute=w}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[4,"ngIf"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[4,"ngIf","ngIfElse"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],["id","tableGrid",1,"table","border-bottom","mb-10"],["class","thead-light",4,"ngIf"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["style","width: 100px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"text-decoration-line-through","text-danger",4,"ngIf"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&g(0,U1,33,25,"mainpanel-cmp",2),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,K,B,L,pe,De,yi,Q,Ye,pr,oe,ee,X,J],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var K1=()=>["/menu/Reports/Sales_Report/Standard/Person"],z1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],X1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],J1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Z1=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],$1=i=>({ID:i});function ef(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function tf(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),x("ngModel",e.pageData.Filter.SalesID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function nf(i,c){i&1&&(n(0,"th",21),p(1," Commission "),a())}function af(i,c){i&1&&(n(0,"th",21),p(1," Total Commission "),a())}function of(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function rf(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.Total,r.pageData.FractionDigit)," ")}}function lf(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"date"),a(),n(4,"td"),p(5),a(),n(6,"td")(7,"a",35),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",26),p(14),d(15,"number"),a(),g(16,of,3,4,"td",36)(17,rf,3,4,"td",36),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(y(3,10,e.Date,"dd MMM yyyy")),o(3),T(e.EntityName),o(2),m("routerLink",b(15,Z1))("queryParams",U(16,$1,e.ID)),o(),T(e.Number),o(2),T(e.VariantName),o(2),T(e.SalesName),o(2),T(C(15,13,e.Quantity)),o(2),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function pf(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function mf(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function sf(i,c){if(i&1){let e=I();n(0,"span",39),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",40),p(2,"?"),a()()}}function cf(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function df(i,c){if(i&1){let e=I();n(0,"div",41)(1,"a",42),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(2,"i",43),p(3," Next"),a(),n(4,"a",44),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),F(5,"i",45),p(6," Show All"),a()()}}function uf(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),p(5,"Date"),a(),n(6,"th",20),p(7,"Outlet"),a(),n(8,"th",20),p(9,"Number"),a(),n(10,"th"),p(11,"Name"),a(),n(12,"th"),p(13,"Sales Person"),a(),n(14,"th",21),p(15,"Quantity"),a(),g(16,nf,2,0,"th",22)(17,af,2,0,"th",22),a()(),n(18,"tbody"),g(19,lf,18,18,"tr",23),a(),n(20,"tfoot")(21,"tr",24)(22,"td",25),p(23,"Total:"),a(),n(24,"td",26),p(25),d(26,"sum"),d(27,"number"),a(),g(28,pf,4,7,"td",27)(29,mf,4,7,"td",28),a()()(),n(30,"div",29)(31,"div",30)(32,"div",31),p(33),d(34,"number"),g(35,sf,3,0,"span",32)(36,cf,3,3,"span",33),p(37),a()(),g(38,df,7,0,"div",34),a()()),i&2){let e=s();o(16),m("ngIf",e.roleService.product.CommissionView),o(),m("ngIf",e.roleService.product.CommissionView),o(2),m("ngForOf",e.infiniteList),o(6),v(" ",C(27,14,y(26,11,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.CommissionView),o(),m("ngIf",e.roleService.product.CommissionView),o(4),v(" Showing 1 - ",C(34,16,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var na=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,f);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.roleService=w;this.matDialog=Ee}datasource=[];transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(q,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[R],decls:24,vars:14,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","120px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success","colspan","1",4,"ngIf"],["class","text-end text-success","colspan","2",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["class","btn-group",4,"ngIf"],["h","",3,"routerLink","queryParams"],["class","text-end text-success",4,"ngIf"],["colspan","1",1,"text-end","text-success"],["colspan","2",1,"text-end","text-success"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.VariantName,w)||(t.pageData.Filter.VariantName=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(w){return u(l),_(t.getFilterData(w))}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,ef,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),g(20,tf,13,7,"ng-template",null,0,M),a(),n(22,"content"),g(23,uf,39,18,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.VariantName),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,K1)),o(3),m("routerLink",b(11,z1)),o(3),m("routerLink",b(12,X1)),o(3),m("routerLink",b(13,J1)),o(6),m("ngIf",t.infiniteList))},dependencies:[N,Y,k,A,K,B,L,pe,Q,Ye,oe,ie,ee,J],encapsulation:2})};var Br=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Or=i=>({ID:i});function _f(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function gf(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",11)(16,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",14),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",17),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),o(2),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.IsDesc),m("options",e.AscDscRadio),o(3),m("items",e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("model",e.pageData.Filter.NoteVisible),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ff(i,c){if(i&1&&(n(0,"th",33),p(1),a()),i&2){let e=s(2);o(),v(" Cost(",e.data.Symbol,") ")}}function Cf(i,c){i&1&&(n(0,"th",34),p(1," Disc "),a())}function xf(i,c){if(i&1&&(n(0,"th",35),p(1),a()),i&2){let e=s(2);o(),v(" Total(",e.data.Symbol,") ")}}function hf(i,c){i&1&&(n(0,"span"),p(1," /"),a())}function Sf(i,c){if(i&1&&(n(0,"a",38)(1,"span",48),p(2),a()()),i&2){let e=s().$implicit;m("routerLink",b(3,Br))("queryParams",U(4,Or,e.Data.ID)),o(2),T("#"+e.PONumber)}}function yf(i,c){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitPrice)," ")}}function Df(i,c){if(i&1&&(n(0,"div",62),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e==null?null:e.DiscountAmount)," ")}}function vf(i,c){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),g(3,Df,3,3,"div",61),a()),i&2){let e=s().$implicit;o(),v(" ",(e==null?null:e.Discount)==0?"":C(2,2,e==null?null:e.Discount)+"%"," "),o(2),m("ngIf",(e==null?null:e.DiscountAmount)>0)}}function wf(i,c){if(i&1&&(n(0,"th",63),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.Total)," ")}}function Tf(i,c){if(i&1&&(n(0,"tr")(1,"th",49)(2,"div",50)(3,"span"),p(4),a(),F(5,"small",51),a()(),n(6,"th",52),p(7),a(),n(8,"th",53),p(9),d(10,"quantityFraction"),a(),n(11,"th",54),p(12),d(13,"quantityFraction"),a(),n(14,"th",55),p(15),a(),g(16,yf,3,3,"th",56)(17,vf,4,4,"th",57)(18,wf,3,3,"th",58),a()),i&2){let e=c.$implicit,r=s(3);o(4),T(e==null?null:e.Name),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(10,9,e==null?null:e.QtyRequested)," "),o(3),v(" ",C(13,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost)}}function Pf(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",70),p(3),a(),n(4,"th",71),p(5),a(),n(6,"th",72),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e==null?null:e.CurrencySymbol," "),o(2),v(" ",C(8,3,e==null?null:e.Amount)," ")}}function If(i,c){if(i&1&&(n(0,"table",64),g(1,Pf,9,5,"ng-container",31),a()),i&2){let e=s(2).$implicit;o(),m("ngForOf",e==null?null:e.Aggregate)}}function Ff(i,c){if(i&1&&(n(0,"tfoot",64)(1,"tr",65)(2,"td",66),p(3,"Total"),a(),n(4,"td",67)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),F(9,"td",68),n(10,"td",69),g(11,If,2,1,"table",47),a()()()),i&2){let e=s().$implicit,r=s(2);o(6),T(C(8,5,y(7,2,e.Items,"Quantity"))),o(5),m("ngIf",r.roleService.product.Cost)}}function bf(i,c){if(i&1&&(n(0,"div")(1,"div",36)(2,"div",37)(3,"a",38)(4,"span",39),p(5),a()(),g(6,hf,2,0,"span",3)(7,Sf,3,6,"a",40),n(8,"span"),p(9),d(10,"date"),a(),F(11,"span",24),n(12,"strong",41),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),F(17,"small",42),a(),n(18,"div",43)(19,"label",44),p(20),a()()(),n(21,"table",45),F(22,"thead"),n(23,"tbody",46),g(24,Tf,19,13,"tr",31),a(),g(25,Ff,12,7,"tfoot",47),a()()),i&2){let e=c.$implicit,r=s(2);o(3),m("routerLink",b(22,Br))("queryParams",U(23,Or,e.Data.ID)),o(2),T(e.Data.EntityName+" #"+e.Data.Number),o(),m("ngIf",r.pageData.DualReceiptNumber),o(),m("ngIf",r.pageData.DualReceiptNumber),o(2),T(" - "+y(10,11,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),v(" ","[Q: "+y(14,14,e.Items,"Quantity")+", T: "+C(16,20,y(15,17,e.Items,"Total"))+"]"," "),o(4),m("innerHtml",e==null||e.Data==null?null:e.Data.Note,Pe),o(3),T(e.Data==null?null:e.Data.PaymentStateLabel),o(4),m("ngForOf",e.Items),o(),m("ngIf",r.roleService.product.Cost)}}function Ef(i,c){if(i&1&&(n(0,"div",75)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",70),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",70),p(11),d(12,"amountFraction"),a()()()),i&2){let e=s(3);o(5),T(C(6,2,e.data.Aggregate.TaxAdd)),o(6),T(C(12,4,e.data.Aggregate.PurchaseWithTax))}}function Mf(i,c){if(i&1&&(n(0,"div",75)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",70),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",70),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",70),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",70),p(23),d(24,"amountFraction"),a()()()),i&2){let e=s(3);o(5),T(C(6,4,e.data.Aggregate.Gross)),o(6),T(C(12,6,e.data.Aggregate.Discount)),o(6),T(C(18,8,e.data.Aggregate.TaxInclude)),o(6),T(C(24,10,e.data.Aggregate.NetPurchase))}}function Vf(i,c){if(i&1&&(n(0,"div",73),g(1,Ef,13,6,"div",74),n(2,"div",75)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",70),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",70),p(13),d(14,"quantityFraction"),a()()(),g(15,Mf,25,12,"div",74),a()),i&2){let e=s(2);o(),m("ngIf",e.roleService.product.Cost),o(6),T(C(8,4,e.data.Aggregate.TotalTransaction)),o(6),T(C(14,6,e.data.Aggregate.UnitQuantity)),o(2),m("ngIf",e.roleService.product.Cost)}}function Bf(i,c){if(i&1&&(n(0,"content")(1,"div",18)(2,"table",19)(3,"thead",20)(4,"tr")(5,"th",21),p(6,"Name"),a(),n(7,"th",22),p(8,"Code"),a(),n(9,"th",23)(10,"span",24),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",25),p(14,"Qty"),a(),n(15,"th",26),p(16,"UOM"),a(),g(17,ff,2,1,"th",27)(18,Cf,2,0,"th",28)(19,xf,2,1,"th",29),a()(),n(20,"tbody")(21,"tr")(22,"td",30),g(23,bf,26,25,"div",31),a()()()(),g(24,Vf,16,8,"div",32),a()()),i&2){let e=s();o(17),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(3),jt("colspan",e.roleService.product.Cost?8:6),o(),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var aa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=f;this.matDialog=w}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],["class","red","style","width: 30px",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngIf"],[1,"px-0","border-bottom-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],["class","h5 text-primary fw-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","table table-sm table-borderless",4,"ngIf"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],["class","fw-normal border-start border-end text-end","style","width: 80px",4,"ngIf"],["class","fw-normal border-start border-end text-end text-danger","style","width: 30px",4,"ngIf"],["class","fw-normal border-start border-end text-end","style","width: 140px",4,"ngIf"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"row","justify-content-end"],["class","zebra col-auto",4,"ngIf"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_f,3,0,"button",2),a(),n(3,"filters"),g(4,gf,32,20,"ng-template",null,0,M),a(),g(6,Bf,25,6,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,De,Le,fe,Q,oe,ee,X,J],encapsulation:2})};var Lr=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],io=i=>({ID:i}),Of=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Lf(i,c){if(i&1){let e=I();n(0,"button",26),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",27),p(2," Export "),a()}}function Rf(i,c){if(i&1){let e=I();n(0,"div")(1,"div",28)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",29),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",30),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",31)(10,"datepicker",32),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",33),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",34),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",35),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",36),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s(2);o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.StateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.contactDisplay),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function kf(i,c){i&1&&(n(0,"th",37),p(1," Purchase "),a())}function Wf(i,c){i&1&&(n(0,"th",38),p(1," Tax "),a())}function Nf(i,c){i&1&&(n(0,"th",39),p(1," Total Amount "),a())}function Af(i,c){i&1&&(n(0,"th",40),p(1," Payment "),a())}function Gf(i,c){i&1&&F(0,"br")}function Hf(i,c){if(i&1&&(n(0,"a",41),p(1),a()),i&2){let e=s().$implicit;m("routerLink",b(3,Lr))("queryParams",U(4,io,e.PurchaseOrderID)),o(),T(e.PONumber)}}function Qf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function Yf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function jf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalAmount)," ")}}function qf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.PaymentAmount)," ")}}function Uf(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",41),p(5),a(),g(6,Gf,1,0,"br",42)(7,Hf,2,6,"a",43),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",41),p(13),a()(),n(14,"td",22),p(15),d(16,"quantityFraction"),a(),g(17,Qf,3,3,"td",23)(18,Yf,3,3,"td",24)(19,jf,3,3,"td",23)(20,qf,3,3,"td",23),n(21,"td"),p(22),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(25,Lr))("queryParams",U(26,io,e.ID)),o(),T(e.Number),o(),m("ngIf",r.pageData.DualNumber),o(),m("ngIf",r.pageData.DualNumber),o(2),T(y(10,20,e.Date,"dd MMM yyyy")),o(3),m("routerLink",b(28,Of))("queryParams",U(29,io,e.SupplierID)),o(),v(" ",e.SupplierNameDisplay," "),o(2),v(" ",C(16,23,e.TotalItemQuantity)," "),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),bi("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),v(" ",e.PaymentStateLabel," ")}}function Kf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function zf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function Xf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"TotalAmount"))," ")}}function Jf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"PaymentAmount"))," ")}}function Zf(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",2),S("textChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Lf,3,0,"button",3),a(),n(3,"filters"),g(4,Rf,23,14,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),g(22,kf,2,0,"th",13)(23,Wf,2,0,"th",14)(24,Nf,2,0,"th",15)(25,Af,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),g(29,Uf,23,31,"tr",18),a(),n(30,"tfoot")(31,"tr",19),F(32,"td",20),n(33,"td",21),p(34,"Total:"),a(),n(35,"td",22),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),g(39,Kf,4,6,"td",23)(40,zf,4,6,"td",24)(41,Xf,4,6,"td",23)(42,Jf,4,6,"td",23),F(43,"td",25),a()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(20),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(4),m("ngForOf",e.data.Data),o(7),v(" ",C(38,18,y(37,15,e.data.Data,"TotalItemQuantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost)}}var oa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=f;this.matDialog=w}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"SupplierNameDisplay":return this.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),f);case"TotalItemQuantity":return this.compare(t.TotalItemQuantity,l.TotalItemQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"PaymentAmount":return this.compare(t.PaymentAmount,l.PaymentAmount,f);case"PaymentState":return this.compare(t.PaymentStateLabel,l.PaymentStateLabel,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Total","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentAmount","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"empty-column"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){r&1&&g(0,Zf,44,20,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,De,Le,Q,oe,ee,X,J],encapsulation:2})};var $f=()=>["/menu/Contacts/Contact/Suppliers/Info"],eC=i=>({ID:i}),tC=(i,c,e)=>({SupplierID:i,From:c,To:e}),iC=()=>["/menu/Reports/Purchases_Report/Summary"];function nC(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function aC(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",10)(13,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function oC(i,c){i&1&&(n(0,"th",29),p(1," Purchase "),a())}function rC(i,c){if(i&1&&(n(0,"td",25)(1,"a",34),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(11,tC,e.SupplierID,y(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",b(15,iC)),o(3),T(C(5,9,e.Total))}}function lC(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),a(),n(3,"td",31)(4,"a",32),p(5),a()(),n(6,"td",25),p(7),a(),n(8,"td",33),p(9),d(10,"quantityFraction"),a(),g(11,rC,6,16,"td",26),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(9,$f))("queryParams",U(10,eC,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,7,e.Quantity)," "),o(2),m("ngIf",r.roleService.product.Cost)}}function pC(i,c){i&1&&(n(0,"th",25),p(1," Total Purchase "),a())}function mC(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(2,1,e.data.TotalSales)," ")}}function sC(i,c){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Rank"),a(),n(8,"th",18),p(9,"Supplier"),a(),n(10,"th",19),p(11," Code "),a(),n(12,"th",20),p(13," Quantity "),a(),g(14,oC,2,0,"th",21),a()(),n(15,"tbody"),g(16,lC,12,12,"tr",22),a(),n(17,"tfoot")(18,"tr",23),F(19,"th",24),n(20,"th",25),p(21,"Total Quantity"),a(),g(22,pC,2,0,"th",26),a(),n(23,"tr"),F(24,"td",27),n(25,"td",25),p(26),d(27,"quantityFraction"),a(),g(28,mC,3,3,"td",26),a()()(),n(29,"POS-complex-pagination",28),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(6),m("ngIf",e.roleService.product.Cost),o(4),T(C(27,7,e.data.TotalQty)),o(2),m("ngIf",e.roleService.product.Cost),o(),m("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ra=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["class","text-end",4,"ngIf"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,nC,3,0,"button",2),a(),n(3,"filters"),g(4,aC,17,11,"ng-template",null,0,M),a(),g(6,sC,30,9,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,bt,Q,ee,X,J],encapsulation:2})};var cC=i=>[i],dC=i=>({ID:i}),uC=(i,c,e,r)=>({VariantID:i,ProductID:c,From:e,To:r});function _C(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function gC(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",11)(16,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.GroupByProduct),m("options",e.GroupByRadio),o(3),m("multiple",!1),x("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function fC(i,c){i&1&&(n(0,"th",31),p(1," Amount "),a())}function CC(i,c){i&1&&(n(0,"th",32),p(1," Avg Cost "),a())}function xC(i,c){if(i&1&&(n(0,"td",28)(1,"a",34),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",qt(4,uC,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),T(C(3,2,e.Total))}}function hC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.AvgPrice)," ")}}function SC(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",33),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",28),p(9),d(10,"number"),a(),n(11,"td",28),p(12),d(13,"quantityFraction"),a(),g(14,xC,4,9,"td",29)(15,hC,3,3,"td",29),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),m("routerLink",U(13,cC,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(15,dC,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(2),T(C(10,9,e.Order)),o(3),T(C(13,11,e.Quantity)),o(2),m("ngIf",t.roleService.product.Cost),o(),m("ngIf",t.roleService.product.Cost)}}function yC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Total"))," ")}}function DC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"AvgPrice"))," ")}}function vC(i,c){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18),P("matSortChange",function(t){u(e);let l=s();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",19),p(7,"No"),a(),n(8,"th"),p(9,"Name"),a(),n(10,"th",20),p(11,"Code"),a(),n(12,"th",21),p(13," Orders "),a(),n(14,"th",22),p(15," Quantity "),a(),g(16,fC,2,0,"th",23)(17,CC,2,0,"th",24),a()(),n(18,"tbody"),g(19,SC,16,17,"tr",25),a(),n(20,"tfoot")(21,"tr",26),F(22,"td")(23,"td",27),n(24,"td"),p(25,"Total :"),a(),n(26,"td",28),p(27),d(28,"sum"),d(29,"number"),a(),n(30,"td",28),p(31),d(32,"sum"),d(33,"quantityFraction"),a(),g(34,yC,4,6,"td",29)(35,DC,4,6,"td",29),a()()()(),n(36,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.infiniteList),o(8),v(" ",C(29,16,y(28,13,e.infiniteList,"Order"))," "),o(4),v(" ",C(33,21,y(32,18,e.infiniteList,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("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 la=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=Xa(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=Xa(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(q,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 140px","class","text-end","mat-sort-header","Total","arrowPosition","before",4,"ngIf"],["style","width: 120px","class","text-end","mat-sort-header","AvgPrice","arrowPosition","before",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Total","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","AvgPrice","arrowPosition","before",1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_C,3,0,"button",2),a(),n(3,"filters"),g(4,gC,23,15,"ng-template",null,0,M),a(),g(6,vC,37,23,"content",3),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,De,fe,Q,ii,oe,ie,X,J],encapsulation:2})};var wC=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],pa=i=>({ID:i}),TC=()=>["/menu/Products/Catalog/Variants/Info"],PC=()=>["/menu/Contacts/Contact/Suppliers/Info"],IC=()=>["/menu/Products/Catalog/Products/Info"];function FC(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function bC(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID),m("inputTextValue",e.pageData.ProductName)}}function EC(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function MC(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()(),g(11,bC,4,2,"div",3)(12,EC,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),x("model",e.pageData.Filter.ByProduct),m("options",e.ScopeRadio),o(),m("ngIf",e.pageData.Filter.ByProduct),o(),m("ngIf",!e.pageData.Filter.ByProduct),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.OrderByNumber),m("options",e.OrderByRadio),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("multiple",!1),x("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function VC(i,c){i&1&&(n(0,"th",38),p(1,"Date"),a())}function BC(i,c){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function OC(i,c){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function LC(i,c){i&1&&(n(0,"th"),p(1," Supplier "),a())}function RC(i,c){i&1&&(n(0,"th"),p(1,"Product"),a())}function kC(i,c){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function WC(i,c){i&1&&(n(0,"th",40),p(1," Qty "),a())}function NC(i,c){i&1&&(n(0,"th",41),p(1," Measurement "),a())}function AC(i,c){i&1&&(n(0,"th",42),p(1," Cost "),a())}function GC(i,c){i&1&&(n(0,"th",43),p(1," Total Cost "),a())}function HC(i,c){i&1&&(n(0,"th",40),p(1," Item(%) "),a())}function QC(i,c){i&1&&(n(0,"th",44),p(1," Item Disc "),a())}function YC(i,c){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function jC(i,c){i&1&&(n(0,"th",44),p(1," Bill Disc "),a())}function qC(i,c){if(i&1&&(n(0,"th",45),p(1),a()),i&2){let e=s(2);o(),v(" Total(",e.data.CurrencySymbol,") ")}}function UC(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Date,"dd MMM yyyy")," ")}}function KC(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.EntityName)}}function zC(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryStatus," ")}}function XC(i,c){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,PC))("queryParams",U(4,pa,e.SupplierID)),o(),T(e.SupplierName)}}function JC(i,c){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,IC))("queryParams",U(4,pa,e.ProductID)),o(),T(e.Name)}}function ZC(i,c){if(i&1&&F(0,"td",50),i&2){let e=s().$implicit;m("innerHTML",e.Note,Pe)}}function $C(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function ex(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.VariantUnitQuantity)," ")}}function tx(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitPrice)," ")}}function ix(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SumUnitPrice)," ")}}function nx(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Discount>0?e.Discount:""," ")}}function ax(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",e.ItemDiscountAmount>0?C(2,1,e.ItemDiscountAmount):""," ")}}function ox(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DiscountInvoice>0?e.DiscountInvoice:""," ")}}function rx(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.OrderDiscountAmount>0?e.OrderDiscountAmount:""," ")}}function lx(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Total)," ")}}function px(i,c){if(i&1&&(n(0,"tr",46),g(1,UC,3,4,"td",3)(2,KC,2,1,"td",3),n(3,"td")(4,"a",47),p(5),a()(),g(6,zC,2,1,"td",3)(7,XC,3,6,"td",3)(8,JC,3,6,"td",3),n(9,"td")(10,"a",47),p(11),a()(),g(12,ZC,1,1,"td",48)(13,$C,3,3,"td",35)(14,ex,3,3,"td",35)(15,tx,3,3,"td",49)(16,ix,3,3,"td",49)(17,nx,2,1,"td",35)(18,ax,3,3,"td",35)(19,ox,2,1,"td",35)(20,rx,2,1,"td",35)(21,lx,3,3,"td",35),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Outlet.selected),o(2),m("routerLink",b(21,wC))("queryParams",U(22,pa,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",r.column.Fulfillment.selected),o(),m("ngIf",r.column.Supplier.selected),o(),m("ngIf",r.pageData.Filter.ByProduct),o(2),m("routerLink",b(24,TC))("queryParams",U(25,pa,e.VariantID)),o(),T(e.Model),o(),m("ngIf",r.column.ItemNote.selected),o(),m("ngIf",r.column.Qty.selected),o(),m("ngIf",(e==null||e.Data==null?null:e.Data.VariantQuantity)>1),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.TotalCost.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Total.selected)}}function mx(i,c){i&1&&F(0,"td",34)}function sx(i,c){i&1&&F(0,"td",34)}function cx(i,c){i&1&&F(0,"td",34)}function dx(i,c){i&1&&F(0,"td",34)}function ux(i,c){i&1&&(n(0,"td",51),p(1," Total : "),a())}function _x(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function gx(i,c){i&1&&F(0,"td",34)}function fx(i,c){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Total"))," ")}}function Cx(i,c){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),g(6,VC,2,0,"th",22)(7,BC,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),g(10,OC,2,0,"th",24)(11,LC,2,0,"th",3)(12,RC,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),g(15,kC,2,0,"th",3)(16,WC,2,0,"th",25)(17,NC,2,0,"th",26)(18,AC,2,0,"th",27)(19,GC,2,0,"th",28)(20,HC,2,0,"th",25)(21,QC,2,0,"th",29)(22,YC,2,0,"th",25)(23,jC,2,0,"th",29)(24,qC,2,1,"th",30),a()(),n(25,"tbody"),g(26,px,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),g(29,mx,1,0,"td",33)(30,sx,1,0,"td",33)(31,cx,1,0,"td",33)(32,dx,1,0,"td",33),F(33,"td",34),g(34,ux,2,0,"td",35)(35,_x,4,6,"td",35)(36,gx,1,0,"td",33)(37,fx,4,6,"td",36),a()()()(),n(38,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Outlet.selected),o(3),m("ngIf",e.column.Fulfillment.selected),o(),m("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),m("ngIf",e.pageData.Filter.ByProduct),o(3),m("ngIf",e.column.ItemNote.selected),o(),m("ngIf",e.column.Qty.selected),o(),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.TotalCost.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(2),m("ngForOf",e.data.Data),o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Outlet.selected),o(),m("ngIf",e.column.Fulfillment.selected),o(),m("ngIf",e.column.Supplier.selected),o(2),m("ngIf",e.column.Qty.selected||e.column.Total.selected),o(),m("ngIf",e.column.Qty.selected),o(),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),m("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(),m("total",e.data.Data.length)("pageData",e.pageData)}}var ma=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=f;this.matDialog=w}columnService=Ge(vt);column={Date:{selected:!0},Outlet:{selected:!0},Fulfillment:{selected:!1},Supplier:{selected:!0},ItemNote:{selected:!1,name:"Item Note"},Qty:{selected:!0,name:"Qty"},Cost:{selected:!0,name:"Cost"},TotalCost:{selected:!1,name:"Total Cost"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},Total:{selected:!0,name:"Total (RP)"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=e.From??this.pageData.Filter.From,this.pageData.Filter.To=e.To??this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Cost for one quantity before discount",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end","title","Cost multiplied by quantity after discount",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],["title","Cost for one quantity before discount",1,"text-end",2,"width","75px"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],[1,"text-end",2,"width","70px"],["title","Cost multiplied by quantity after discount",1,"text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,FC,3,0,"button",2),a(),n(3,"filters"),g(4,MC,28,18,"ng-template",null,0,M),a(),g(6,Cx,39,26,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,De,Le,bt,Q,oe,ee,X,J],encapsulation:2})};var xx=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function hx(i,c){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function Sx(i,c){if(i&1){let e=I();n(0,"div")(1,"div",7)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio)}}function yx(i,c){i&1&&(n(0,"th",18),p(1," Purchases "),a())}function Dx(i,c){if(i&1&&(n(0,"td",18),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.PurchaseTotal)," ")}}function vx(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",18),p(5),d(6,"number"),a(),n(7,"td",18),p(8),d(9,"quantityFraction"),a(),g(10,Dx,3,3,"td",19),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(y(3,4,e.Date,"EEEE")),o(3),T(C(6,7,e.Day)),o(3),T(C(9,9,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost)}}function wx(i,c){if(i&1&&(n(0,"td",18),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"PurchaseTotal"))," ")}}function Tx(i,c){if(i&1&&(n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",18),p(9,"Date (Day)"),a(),n(10,"th",18),p(11,"Quantity"),a(),g(12,yx,2,0,"th",19),a()(),n(13,"tbody"),g(14,vx,11,11,"tr",20),a(),n(15,"tr")(16,"td",21),p(17,"Total"),a(),n(18,"td",18),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),g(22,wx,4,6,"td",19),a()()()()()),i&2){let e=s();o(12),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(5),v(" ",C(21,7,y(20,4,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost)}}var sa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=V.GenerateYears(w.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[R],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-end"],[1,"border-bottom"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,hx,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),g(6,Sx,20,14,"ng-template",null,0,M),a(),g(8,Tx,23,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,xx)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,B,L,pe,De,fe,Q,oe,ie,ee,X,J],encapsulation:2})};var Px=()=>["/menu/Reports/Purchases_Report/Daily"];function Ix(i,c){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",14),p(2," Export "),a()}}function Fx(i,c){if(i&1){let e=I();n(0,"div")(1,"div",15)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",17),S("selectedCategoryIDChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",20),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio),o(3),x("ngModel",e.pageData.Filter.SupplierID)}}function bx(i,c){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function Ex(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Income)," ")}}function Mx(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),g(6,Ex,3,3,"td",9),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.MonthLabel),o(2),T(C(5,3,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost)}}function Vx(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Income"))," ")}}function Bx(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Ix,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),g(6,Fx,20,13,"ng-template",null,0,M),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),g(17,bx,2,0,"th",9),a()(),n(18,"tbody"),g(19,Mx,7,5,"tr",10),a(),n(20,"tr",11)(21,"td",12),p(22,"Total"),a(),n(23,"td",8),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),g(27,Vx,4,6,"td",9),a()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(),m("routerLink",b(15,Px)),o(14),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(5),v(" ",C(26,13,y(25,10,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost)}}var ca=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=V.GenerateYears(w.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"border-bottom"]],template:function(r,t){r&1&&g(0,Bx,28,16,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,B,L,pe,De,Le,fe,Q,oe,X,J],encapsulation:2})};function Ox(i,c){if(i&1){let e=I();n(0,"div")(1,"div",3)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",4),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",5),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years)}}function Lx(i,c){if(i&1&&(n(0,"content")(1,"div",7),F(2,"POS-line-chart",8),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var da=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[R],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),F(1,"actions"),n(2,"filters"),g(3,Ox,11,8,"ng-template",null,0,M),a(),g(5,Lx,3,2,"content",2),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(5),m("ngIf",t.data))},dependencies:[N,k,z,B,L,Et,fe,Q],encapsulation:2})};var Rx=()=>["/menu/Products/Catalog/Products/Info"],kx=i=>({ID:i});function Wx(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export"),a()}}function Nx(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",10)(13,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Ax(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td")(4,"a",23),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"quantityFraction"),a(),n(14,"td",25),p(15),d(16,"number"),a()()),i&2){let e=c.$implicit,r=c.index;o(2),T(r+1),o(2),m("routerLink",b(14,Rx))("queryParams",U(15,kx,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(2),T(C(10,8,e.PurchaseQuantity)),o(3),T(C(13,10,e.SellQuantity)),o(3),T(C(16,12,e.Ratio))}}function Gx(i,c){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th",17),p(7," Now "),a(),n(8,"th",18),p(9,"Name"),a(),n(10,"th",19),p(11,"Code"),a(),n(12,"th",20),p(13,"Purchase"),a(),n(14,"th",20),p(15,"Sold"),a(),n(16,"th",20),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),g(19,Ax,17,17,"tr",21),a()()()()()),i&2){let e=s();o(19),m("ngForOf",e.data.Data)}}var ua=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wx,3,0,"button",2),a(),n(3,"filters"),g(4,Nx,17,10,"ng-template",null,0,M),a(),g(6,Gx,20,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,ke,B,L,Qe,fe,Q,ie,J],encapsulation:2})};var Hx=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],Qx=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Yx=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),jx=(i,c,e)=>({EntityID:i,From:c,To:e}),qx=()=>["/menu/Reports/Purchases_Report/Summary"];function Ux(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Kx(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",15),S("modelChange",function(t){u(e);let l=s(2);return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("model",e.isCompare)}}function zx(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",16),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",17)(6,"datepicker",18),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Xx(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",19)(4,"div",20)(5,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Year=null)}),a()(),n(6,"div",22)(7,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=s(2);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function Jx(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.YearMonthToDateRange())}),a(),g(10,Kx,4,1,"div",7)(11,zx,7,2,"div",7)(12,Xx,8,4,"div",7),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",14),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.IsPredefined),m("options",e.RadioDateFilterType),o(),m("ngIf",e.IsPredefined),o(),m("ngIf",!e.IsPredefined),o(),m("ngIf",e.IsPredefined),o(3),x("model",e.pageData.Filter.ExcludeComplementary)}}function Zx(i,c){i&1&&(n(0,"th",43),p(1," Prev "),a())}function $x(i,c){i&1&&(n(0,"th",44),p(1," Now "),a())}function eh(i,c){i&1&&(n(0,"th",45),p(1," Orders "),a())}function th(i,c){i&1&&(n(0,"th",46),p(1," Purchase "),a())}function ih(i,c){if(i&1&&(n(0,"th",47),p(1," Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function nh(i,c){if(i&1&&(n(0,"th",48),p(1," Purchase + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function ah(i,c){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function oh(i,c){if(i&1&&(n(0,"td",50),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,Yx,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function rh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Count,".0-0")," ")}}function lh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function ph(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function mh(i,c){if(i&1&&(n(0,"td",41)(1,"a",52),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(11,jx,e.EntityID,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",b(15,qx)),o(4),T(C(6,9,e.SalesWithTax))}}function sh(i,c){if(i&1&&(n(0,"tr")(1,"td",38),p(2),a(),g(3,ah,2,1,"td",40)(4,oh,2,5,"td",49)(5,rh,3,4,"td",40),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),g(9,lh,3,3,"td",40)(10,ph,3,3,"td",42),d(11,"HideSumZero"),g(12,mh,7,16,"td",40),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",!r.data.WithCategory),o(2),T(C(8,8,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",!r.data.WithCategory&&y(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost),o(2),m("ngIf",!r.data.WithCategory&&r.roleService.product.Cost)}}function ch(i,c){i&1&&F(0,"td",53)}function dh(i,c){i&1&&F(0,"td",53)}function uh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function _h(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function gh(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function fh(i,c){if(i&1&&(n(0,"td",41)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function Ch(i,c){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Outlet"),a(),g(8,Zx,2,0,"th",29)(9,$x,2,0,"th",30)(10,eh,2,0,"th",31),n(11,"th",32),p(12," Qty "),a(),g(13,th,2,0,"th",33)(14,ih,2,1,"th",34),d(15,"HideSumZero"),g(16,nh,2,1,"th",35),a()(),n(17,"tbody"),g(18,sh,13,13,"tr",36),a(),n(19,"tfoot")(20,"tr",37),F(21,"td",38),g(22,ch,1,0,"td",39)(23,dh,1,0,"td",39)(24,uh,4,7,"td",40),n(25,"td",41),p(26),d(27,"sum"),d(28,"quantityFraction"),a(),g(29,_h,4,6,"td",40)(30,gh,4,6,"td",42),d(31,"HideSumZero"),g(32,fh,5,6,"td",40),a()()()()()()}if(i&2){let e=s();o(8),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",!e.data.WithCategory&&y(15,14,e.data.Data,"Tax")&&e.roleService.product.Cost),o(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(4),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(2),v(" ",C(28,20,y(27,17,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",!e.data.WithCategory&&y(31,22,e.data.Data,"Tax")&&e.roleService.product.Cost),o(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost)}}var _a=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=V.GenerateYears(w.getFullYear(),11,!0),this.Year=w.getFullYear(),this.Month=w.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Count":return V.compare(t.Count,l.Count,f);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,f);case"Quantity":return V.compare(t.Quantity,l.Quantity,f);case"SalesNet":return V.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,f);case"Tax":return V.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[R],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above","style","width: 100px","class","text-end",4,"ngIf"],["style","width: 100px","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","flex-right","style","width: 100px",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before","style","width: 100px","class","flex-right",4,"ngIf"],["style","width: 100px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],["style","width: 150px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"queryParams","routerLink"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Ux,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Jx,16,10,"ng-template",null,0,M),a(),g(16,Ch,33,25,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Hx)),o(3),m("routerLink",b(9,Qx)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,fe,oe,ti,ie,ee,X,J],encapsulation:2})};var xh=()=>["/menu/Reports/Purchases_Report/Outlet"],hh=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Sh=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),yh=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function Dh(i,c){if(i&1){let e=I();n(0,"button",27),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",28),p(2," Export"),a()}}function vh(i,c){if(i&1){let e=I();se(0),n(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",32),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",33)(6,"datepicker",34),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),ce()}if(i&2){let e=s(3);o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function wh(i,c){if(i&1){let e=I();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",35)(4,"div",36)(5,"ng-select",37),S("ngModelChange",function(t){u(e);let l=s(3);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Year=null)}),a()(),n(6,"div",38)(7,"ng-select",39),S("ngModelChange",function(t){u(e);let l=s(3);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(3);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function Th(i,c){if(i&1){let e=I();se(0),n(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",40),S("modelChange",function(t){u(e);let l=s(3);return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),ce()}if(i&2){let e=s(3);o(3),x("model",e.isCompare)}}function Ph(i,c){if(i&1){let e=I();n(0,"div")(1,"div",29)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",30),S("modelChange",function(t){u(e);let l=s(2);return h(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),g(5,vh,7,2,"ng-container",25)(6,wh,8,4,"ng-container",25),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",31),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),g(10,Th,4,1,"ng-container",25),a()()}if(i&2){let e=s(2);o(4),x("model",e.IsPredefined),m("options",e.RadioDateFilterType),o(),m("ngIf",!e.IsPredefined),o(),m("ngIf",e.IsPredefined),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),m("ngIf",e.IsPredefined)}}function Ih(i,c){i&1&&(n(0,"th",41),p(1,"Prev"),a())}function Fh(i,c){i&1&&(n(0,"th",42),p(1,"Now"),a())}function bh(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function Eh(i,c){if(i&1&&(n(0,"td",24),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function Mh(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,Sh,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function Vh(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",de(5,yh,e.IsNegative,e.IsPositive)),o(),v(" ",y(2,2,e.Increase,".0-0")," ")}}function Bh(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Eh,2,1,"td",44)(4,Mh,2,5,"td",45),n(5,"td",24),p(6),d(7,"number"),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"amountFraction"),a(),g(14,Vh,3,8,"td",46),n(15,"td",26),p(16),d(17,"amountFraction"),a(),n(18,"td",24),p(19),d(20,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(2),T(y(7,9,e.Count,".0-0")),o(3),T(C(10,12,e.Quantity)),o(3),T(C(13,14,e.Sales)),o(2),m("ngIf",r.showCompareColumn),o(2),T(C(17,16,e.Tax)),o(3),v(" ",C(20,18,e.SalesWithTax)," ")}}function Oh(i,c){i&1&&F(0,"td",23)}function Lh(i,c){i&1&&F(0,"td",23)}function Rh(i,c){i&1&&F(0,"td")}function kh(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Dh,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Ph,11,7,"ng-template",null,0,M),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),g(23,Ih,2,0,"th",12)(24,Fh,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),g(31,bh,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),g(37,Bh,21,20,"tr",20),a(),n(38,"tfoot")(39,"tr",21),g(40,Oh,1,0,"td",22)(41,Lh,1,0,"td",22),F(42,"td",23),n(43,"td",24),p(44),d(45,"sum"),d(46,"number"),a(),n(47,"td",24),p(48),d(49,"sum"),d(50,"quantityFraction"),a(),n(51,"td",24),p(52),d(53,"sum"),d(54,"amountFraction"),a(),g(55,Rh,1,0,"td",25),n(56,"td",26),p(57),d(58,"sum"),d(59,"amountFraction"),a(),n(60,"td",24)(61,"a"),p(62),d(63,"sum"),d(64,"amountFraction"),a()()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(6),m("routerLink",b(47,xh)),o(3),m("routerLink",b(48,hh)),o(12),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(7),m("ngIf",e.showCompareColumn),o(),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),m("ngForOf",e.data==null?null:e.data.Data),o(3),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(3),T(y(46,24,y(45,21,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),T(C(50,30,y(49,27,e.data==null?null:e.data.Data,"Quantity"))),o(4),v(" ",C(54,35,y(53,32,e.data==null?null:e.data.Data,"Sales"))," "),o(3),m("ngIf",e.showCompareColumn),o(2),v(" ",C(59,40,y(58,37,e.data==null?null:e.data.Data,"Tax"))," "),o(5),T(C(64,45,y(63,42,e.data==null?null:e.data.Data,"SalesWithTax")))}}var ga=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=V.GenerateYears(w.getFullYear(),11,!0),this.Year=w.getFullYear(),this.Month=w.getMonth(),this.Months=V.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesNet":return this.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["style","width: 100px;","class","text-end",4,"ngIf"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&g(0,kh,65,49,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,oe,ie,X,J],encapsulation:2})};var Wh=()=>["/menu/Reports/Purchases_Report/Outlet"],Nh=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function Ah(i,c){if(i&1){let e=I();n(0,"button",14),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",15),p(2," Export"),a()}}function Gh(i,c){if(i&1){let e=I();n(0,"div")(1,"div",16)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Hh(i,c){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function Qh(i,c){if(i&1&&(n(0,"p",21),p(1),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(r[e])}}function Yh(i,c){if(i&1&&(n(0,"p",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(C(2,1,r[e]))}}function jh(i,c){if(i&1&&(n(0,"td"),g(1,Qh,2,1,"p",20)(2,Yh,3,3,"p",20),a()),i&2){let e=c.$implicit;o(),m("ngIf",e=="Outlet"),o(),m("ngIf",e!="Outlet")}}function qh(i,c){if(i&1&&(n(0,"tr"),g(1,jh,3,2,"td",12),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngForOf",r.getKey(e))}}function Uh(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),T(C(2,1,e))}}function Kh(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,Uh,3,3,"td",12),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.DataFooter)}}function zh(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Ah,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),g(14,Gh,8,4,"ng-template",null,0,M),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),g(21,Hh,2,2,"th",11),a()(),n(22,"tbody"),g(23,qh,2,1,"tr",12),a(),g(24,Kh,5,1,"tfoot",13),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(6),m("routerLink",b(10,Wh)),o(3),m("routerLink",b(11,Nh)),o(10),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var fa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=V.GenerateYears(w.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,f)=>{let w=e.direction==="asc";for(let Ee=0;Ee<this.data.Dataheader.length;Ee++)if(e.active==this.data.Dataheader[Ee])return typeof l[this.data.Dataheader[Ee]]=="string"?t(l[this.data.Dataheader[Ee]].toLocaleLowerCase(),f[this.data.Dataheader[Ee]].toLocaleLowerCase(),w):t(l[this.data.Dataheader[Ee]],f[this.data.Dataheader[Ee]],w)});function t(l,f,w){return(l<f?-1:1)*(w?1:-1)}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[3,"mat-sort-header"],["style","color: black;",4,"ngIf"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&g(0,zh,25,12,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,B,L,ae,ge,X],encapsulation:2})};var Xh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Jh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Zh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],$h=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],eS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],tS=i=>({ID:i});function iS(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function nS(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(4),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function aS(i,c){if(i&1&&(n(0,"a",30),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,tS,e.CityID)),o(),T(e.CityName)}}function oS(i,c){if(i&1&&(se(0),p(1),ce()),i&2){let e=s().$implicit;o(),v(" ",e.CityName," ")}}function rS(i,c){if(i&1&&(n(0,"tr"),F(1,"td",27),n(2,"td"),g(3,aS,2,4,"a",28)(4,oS,2,1,"ng-container",7),a(),F(5,"td",29),d(6,"number"),F(7,"td",29),d(8,"number"),F(9,"td",29),d(10,"number"),a()),i&2){let e=c.$implicit;o(),m("innerHtml",e.CityCode,Pe),o(2),m("ngIf",e.CityID),o(),m("ngIf",!e.CityID),o(),m("innerHtml",C(6,6,e.Quantity),Pe),o(2),m("innerHtml",C(8,8,e.Total),Pe),o(2),m("innerHtml",C(10,10,e.Average),Pe)}}function lS(i,c){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",18)(4,"tr")(5,"th",19),p(6,"Code"),a(),n(7,"th",20),p(8," Regional Name "),a(),n(9,"th",21),p(10," Quantity "),a(),n(11,"th",22),p(12," Total "),a(),n(13,"th",23),p(14," Avg. Price "),a()()(),n(15,"tbody"),g(16,rS,11,12,"tr",24),a(),n(17,"tfoot")(18,"tr",25),F(19,"td",26),n(20,"td",26),p(21,"Total :"),a(),n(22,"td",26),p(23),d(24,"sum"),d(25,"quantityFraction"),a(),n(26,"td",26),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",26),p(31),d(32,"sum"),d(33,"sum"),d(34,"amountFraction"),a()()()()()()}if(i&2){let e=s();o(16),m("ngForOf",e.data.List),o(7),v(" ",C(25,7,y(24,4,e.data.List,"Quantity"))," "),o(4),v(" ",C(29,12,y(28,9,e.data.List,"Total"))," "),o(4),v(" ",C(34,20,y(32,14,e.data.List,"Total")/y(33,17,e.data.List,"Quantity"))," ")}}var Ca=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,f);case"CityName":return this.compare(t.CityName,l.CityName,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Average":return this.compare(t.Average,l.Average,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[R],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams",4,"ngIf"],[1,"text-end",3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,iS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,nS,13,6,"ng-template",null,0,M),a(),g(25,lS,35,22,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Xh)),o(3),m("routerLink",b(12,Jh)),o(3),m("routerLink",b(13,Zh)),o(3),m("routerLink",b(14,$h)),o(3),m("routerLink",b(15,eS)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,fe,oe,ie,X,J],encapsulation:2})};var pS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],mS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],sS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],cS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],dS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function uS(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function _S(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function gS(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function fS(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function CS(i,c){if(i&1&&(F(0,"td",34),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.Cost),Pe)}}function xS(i,c){if(i&1&&(F(0,"td",31),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.Profit),Pe)}}function hS(i,c){if(i&1&&(n(0,"tr"),F(1,"td",29)(2,"td",30),d(3,"number"),F(4,"td",30),d(5,"quantityFraction"),F(6,"td",30),d(7,"amountFraction"),F(8,"td",31),d(9,"amountFraction"),g(10,CS,2,3,"td",32)(11,xS,2,3,"td",33),a()),i&2){let e=c.$implicit,r=s(2);o(),m("innerHtml",e.GroupName,Pe),o(),m("innerHtml",C(3,7,e.Count),Pe),o(2),m("innerHtml",C(5,9,e.Quantity),Pe),o(2),m("innerHtml",C(7,11,e.Gross),Pe),o(2),m("innerHtml",C(9,13,e.Sales),Pe),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function SS(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.Data,"Cost")))}}function yS(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.Data,"Profit")))}}function DS(i,c){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"div",16)(3,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",18)(5,"tr")(6,"th",19),p(7,"Group Name"),a(),n(8,"th",20),p(9,"Orders"),a(),n(10,"th",21),p(11,"Quantity"),a(),n(12,"th",21),p(13,"Gross"),a(),n(14,"th",21),p(15,"Sales"),a(),g(16,gS,2,0,"th",22)(17,fS,2,0,"th",22),a()(),n(18,"tbody"),g(19,hS,12,15,"tr",23),a(),n(20,"tfoot")(21,"tr",24),F(22,"td",25),n(23,"td",25),p(24),d(25,"sum"),d(26,"number"),a(),n(27,"td",25),p(28),d(29,"sum"),d(30,"quantityFraction"),a(),n(31,"td",25),p(32),d(33,"sum"),d(34,"amountFraction"),a(),n(35,"td",26),p(36),d(37,"sum"),d(38,"amountFraction"),a(),g(39,SS,4,6,"td",27)(40,yS,4,6,"td",28),a()()()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(5),T(C(26,12,y(25,9,e.data.Data,"Count"))),o(4),T(C(30,17,y(29,14,e.data.Data,"Quantity"))),o(4),T(C(34,22,y(33,19,e.data.Data,"Gross"))),o(4),T(C(38,27,y(37,24,e.data.Data,"Sales"))),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}var xa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,f);case"Trans":return this.compare(t.Trans,l.Trans,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[R],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],["class","text-end text-danger",3,"innerHtml",4,"ngIf"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-danger",3,"innerHtml"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,uS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,_S,9,5,"ng-template",null,0,M),a(),g(25,DS,41,29,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,pS)),o(3),m("routerLink",b(12,mS)),o(3),m("routerLink",b(13,sS)),o(3),m("routerLink",b(14,cS)),o(3),m("routerLink",b(15,dS)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,Q,oe,ie,X,J],encapsulation:2})};var vS=()=>["/menu/Reports/Sales_Report/Standard/Person"],wS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],TS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],PS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],IS=(i,c)=>({From:i,To:c});function FS(i,c){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",11),p(2," Export "),a()}}function bS(i,c){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ES(i,c){i&1&&(n(0,"th",22),p(1,"Profit"),a())}function MS(i,c){if(i&1&&(F(0,"td",32),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.ActualProfit),Pe)}}function VS(i,c){if(i&1&&(n(0,"tr"),F(1,"td",29)(2,"td",30),d(3,"number"),F(4,"td",30),d(5,"amountFraction"),F(6,"td",30),d(7,"amountFraction"),F(8,"td",30),g(9,MS,2,3,"td",31),a()),i&2){let e=c.$implicit,r=s(2);o(),m("innerHtml",e.Name,Pe),o(),m("innerHtml",C(3,6,e.InvoiceCount),Pe),o(2),m("innerHtml",C(5,8,e.NetRevenue),Pe),o(2),m("innerHtml",C(7,10,e.SalesTarget),Pe),o(2),m("innerHtml",e.Percentage+"%",Pe),o(),m("ngIf",r.roleService.report.Profit)}}function BS(i,c){if(i&1&&(n(0,"td",27),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"ActualProfit")),"")}}function OS(i,c){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22),p(15,"Percentage"),a(),g(16,ES,2,0,"th",23),a()(),n(17,"tbody"),g(18,VS,10,12,"tr",24),a(),n(19,"tfoot")(20,"tr",25),F(21,"td",26)(22,"td",26),n(23,"td",27),p(24),d(25,"sum"),d(26,"amountFraction"),a(),F(27,"td",26)(28,"td",26),g(29,BS,4,6,"td",28),a()()()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(6),T(C(26,7,y(25,4,e.data.Data,"GrossRevenue"))),o(5),m("ngIf",e.roleService.report.Profit)}}var ha=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[R],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end ",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2),g(3,FS,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,bS,9,5,"ng-template",null,0,M),a(),g(25,OS,30,9,"content",9),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(3),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(17,vS)),o(3),m("routerLink",b(18,wS)),o(3),m("routerLink",b(19,TS)),o(3),m("routerLink",b(20,PS))("queryParams",de(21,IS,y(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,Q,oe,ie,ee,X],encapsulation:2})};var LS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],RS=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],kS=i=>({ID:i});function WS(i,c){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&m("routerLink",b(1,LS))}function NS(i,c){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function AS(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),x("date",e.pageData.Filter.From),o(3),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function GS(i,c){if(i&1&&F(0,"th",41),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function HS(i,c){if(i&1&&(F(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",C(2,5,_i(1,1,t.data.Compenents,r,e)),Pe)}}function QS(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),g(19,HS,3,7,"td",45),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(17,RS))("queryParams",U(18,kS,e.ID)),o(),T(e.Number),o(2),T(e.Name),o(2),T(e.TaxName),o(2),T(y(12,10,e.Date,"dd MMM yyyy")),o(3),T(C(15,13,e.Sales)),o(3),v(" ",C(18,15,e.Tax)," "),o(2),m("ngForOf",r.getComponent(r.data))}}function YS(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e.SumTaxAmount)," ")}}function jS(i,c){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function qS(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function US(i,c){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(1,"i",51),p(2," Next"),a()}}function KS(i,c){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),F(1,"i",53),p(2," Show All"),a()}}function zS(i,c){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),g(20,GS,1,1,"th",28),a()(),n(21,"tbody"),g(22,QS,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),F(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),g(34,YS,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),g(40,jS,3,0,"span",37)(41,qS,3,3,"span",4),p(42),a()(),n(43,"div",38),g(44,US,3,0,"a",39)(45,KS,3,0,"a",40),a()()()()}if(i&2){let e=s();o(20),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.infiniteList),o(5),v(" ",C(29,14,y(28,11,e.infiniteList,"Sales"))," "),o(4),v(" ",C(33,19,y(32,16,e.infiniteList,"Tax"))," "),o(3),m("ngForOf",e.data.Compenents),o(4),v(" Showing 1 - ",C(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var Sa=class i extends dn{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[R],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,WS,2,2,"a",2)(3,NS,3,0,"a",3),a(),n(4,"filters"),g(5,AS,18,10,"ng-template",null,0,M),a(),g(7,zS,46,23,"content",4),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,oe,xi,ie,ee,X],encapsulation:2})};var XS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function JS(i,c){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function ZS(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function $S(i,c){i&1&&(n(0,"th",26),p(1,"Total Tax"),a())}function ey(i,c){if(i&1&&F(0,"th",27),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function ty(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),T(y(2,1,e.Tax,r.pageData.FractionDigit))}}function iy(i,c){if(i&1&&(F(0,"td",27),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",y(2,5,_i(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Pe)}}function ny(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",28),p(4),d(5,"number"),a(),g(6,ty,3,4,"td",29)(7,iy,3,8,"td",30),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),T(y(5,4,e.Sales,r.pageData.FractionDigit)),o(2),m("ngIf",r.data.Compenents.length==0),o(),m("ngForOf",r.getComponent(e))}}function ay(i,c){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit),"")}}function oy(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function ry(i,c){if(i&1){let e=I();n(0,"div",13)(1,"table",14),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",15)(3,"tr")(4,"th",16),p(5,"Outlet"),a(),n(6,"th",17),p(7,"Sales"),a(),g(8,$S,2,0,"th",18)(9,ey,1,1,"th",19),a()(),n(10,"tbody"),g(11,ny,8,7,"tr",20),a(),n(12,"tfoot")(13,"tr",21),F(14,"td",22),n(15,"td",23),p(16),d(17,"sum"),d(18,"number"),a(),g(19,ay,4,7,"td",24)(20,oy,3,4,"td",25),a()()()()}if(i&2){let e=s();o(8),m("ngIf",e.data.Compenents.length==0),o(),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.data.Data),o(5),T(y(18,9,y(17,6,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),m("ngIf",e.data.Compenents.length==0),o(),m("ngForOf",e.data.Compenents)}}var ya=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[R],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["style","width: 150px","class","text-end flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 150px","class","text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),g(4,JS,3,0,"a",3),a(),n(5,"filters"),g(6,ZS,12,8,"ng-template",null,0,M),a(),n(8,"content"),g(9,ry,21,12,"div",4),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(8,XS)),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,ae,ge,Q,oe,xi,ie],encapsulation:2})};var ly=()=>["/menu/Products/Catalog/Variants/Info"],py=i=>({ID:i});function my(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function sy(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID)}}function cy(i,c){i&1&&(n(0,"th",25),p(1," Category "),a())}function dy(i,c){i&1&&(n(0,"th",26),p(1,"Code"),a())}function uy(i,c){i&1&&(n(0,"th",27),p(1," Release Date "),a())}function _y(i,c){i&1&&(n(0,"th",28),p(1," Days Count "),a())}function gy(i,c){i&1&&(n(0,"th",29),p(1," Last Sold "),a())}function fy(i,c){i&1&&(n(0,"th",30),p(1," Last Purchased "),a())}function Cy(i,c){i&1&&(n(0,"th",31),p(1," Qty "),a())}function xy(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Category)}}function hy(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Sy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.Released?y(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function yy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",e.DaysCount!=null?C(2,1,e.DaysCount):"-"," ")}}function Dy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.LastSold?y(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function vy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.LastPurchased?y(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function wy(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function Ty(i,c){if(i&1&&(n(0,"tr",32),g(1,xy,2,1,"td",3),n(2,"td")(3,"a",33),p(4),a()(),g(5,hy,2,1,"td",3)(6,Sy,3,4,"td",3)(7,yy,3,3,"td",3)(8,Dy,3,4,"td",3)(9,vy,3,4,"td",3)(10,wy,3,3,"td",34),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",r.column.Category.selected),o(2),m("routerLink",b(10,ly))("queryParams",U(11,py,e.ID)),o(),T(e.Name),o(),m("ngIf",r.column.Code.selected),o(),m("ngIf",r.column.ReleaseDate.selected),o(),m("ngIf",r.column.DaysCount.selected),o(),m("ngIf",r.column.LastSold.selected),o(),m("ngIf",r.column.LastPurchased.selected),o(),m("ngIf",r.column.QTY.selected)}}function Py(i,c){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),g(5,cy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),g(8,dy,2,0,"th",18)(9,uy,2,0,"th",19)(10,_y,2,0,"th",20)(11,gy,2,0,"th",21)(12,fy,2,0,"th",22)(13,Cy,2,0,"th",23),a()(),n(14,"tbody"),g(15,Ty,11,13,"tr",24),a()()()()}if(i&2){let e=s();o(5),m("ngIf",e.column.Category.selected),o(3),m("ngIf",e.column.Code.selected),o(),m("ngIf",e.column.ReleaseDate.selected),o(),m("ngIf",e.column.DaysCount.selected),o(),m("ngIf",e.column.LastSold.selected),o(),m("ngIf",e.column.LastPurchased.selected),o(),m("ngIf",e.column.QTY.selected),o(2),m("ngForOf",e.data)}}var Da=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",f);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=f}roleService=Ge(G);columnService=Ge(vt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc",w=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),w){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),f);case"number":return this.compare(t[e.active],l[e.active],f);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e}openExportModal(){this.matDialog.open(q,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,my,3,0,"a",2),a(),n(3,"filters"),g(4,sy,15,8,"ng-template",null,0,M),a(),g(6,Py,16,8,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,fe,Q,Ye,ie,ee,J],encapsulation:2})};function Iy(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function Fy(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function by(i,c){i&1&&(n(0,"th",22),p(1,"Total Cost"),a())}function Ey(i,c){i&1&&(n(0,"th",22),p(1,"Total profit "),a())}function My(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalCost))}}function Vy(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalProfit))}}function By(i,c){if(i&1&&(n(0,"tr",26)(1,"td",27),p(2),a(),n(3,"td",27),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",28),p(10),d(11,"quantityFraction"),a(),n(12,"td",28),p(13),d(14,"quantityFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),g(18,My,3,3,"td",29)(19,Vy,3,3,"td",30),n(20,"td",28),p(21),d(22,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.PrevRank||"-"),o(2),T(e.Rank),o(2),T(e.Name),o(2),T(e.Code),o(2),T(C(11,10,e.Quantity)),o(3),T(C(14,12,e.OnHand)),o(3),T(C(17,14,e.TotalAmount)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(2),T(C(22,16,e.Margin))}}function Oy(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data,"TotalCost")))}}function Ly(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data,"TotalProfit")))}}function Ry(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",32),F(2,"td",33),n(3,"td",34),p(4,"Total:"),a(),n(5,"td",34),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",34),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",34),p(14),d(15,"sum"),d(16,"amountFraction"),a(),g(17,Oy,4,6,"td",35)(18,Ly,4,6,"td",35),a()()),i&2){let e=s(2);o(6),T(C(8,8,y(7,5,e.data,"Quantity"))),o(4),T(C(12,13,y(11,10,e.data,"OnHand"))),o(4),T(C(16,18,y(15,15,e.data,"TotalAmount"))),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}function ky(i,c){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Prev"),a(),n(8,"th",18),p(9,"Now"),a(),n(10,"th",19),p(11,"Name"),a(),n(12,"th",20),p(13,"Code"),a(),n(14,"th",18),p(15,"Sold"),a(),n(16,"th",21),p(17,"On Hand"),a(),n(18,"th",22),p(19,"Total Amount"),a(),g(20,by,2,0,"th",23)(21,Ey,2,0,"th",23),n(22,"th",24),p(23,"%"),a()()(),n(24,"tbody"),g(25,By,23,18,"tr",25),a(),g(26,Ry,19,20,"tfoot",3),a()()()()}if(i&2){let e=s();o(20),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(4),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.length>0)}}var va=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(q,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["style","width: 200px","class","text-end",4,"ngIf"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Iy,3,0,"a",2),a(),n(3,"filters"),g(4,Fy,18,10,"ng-template",null,0,M),a(),g(6,ky,27,4,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,pe,ae,ge,Qe,Le,fe,Q,oe,X,J],encapsulation:2})};var Wy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ny=i=>({ID:i});function Ay(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function Gy(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Hy(i,c){if(i&1&&(n(0,"tr",16)(1,"td")(2,"a",17),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Wy))("queryParams",U(12,Ny,e.ID)),o(),T(e.InvoiceNumber),o(2),T(e.Name),o(2),T(e.Code),o(2),T(C(10,7,e.Quantity)),o(3),T(C(13,9,e.Price))}}function Qy(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),g(16,Hy,14,14,"tr",15),a()()()()),i&2){let e=s();o(16),m("ngForOf",e.data.Data)}}var wa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}openExportModal(){this.matDialog.open(q,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Ay,3,0,"a",2),a(),n(3,"filters"),g(4,Gy,12,7,"ng-template",null,0,M),a(),g(6,Qy,17,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,fe,Q,X,J],encapsulation:2})};function Yy(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function jy(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",13),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID)}}function qy(i,c){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",14),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID)}}function Uy(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",9)(8,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",11),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),g(12,jy,4,1,"div",3)(13,qy,4,1,"div",3),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.SearchBy),m("options",e.RadioSearchBy),o(),m("ngIf",e.pageData.Filter.SearchBy),o(),m("ngIf",!e.pageData.Filter.SearchBy),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Ky(i,c){if(i&1&&(n(0,"tr",22)(1,"td",23),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",23),p(6),d(7,"quantityFraction"),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;o(2),T(e.Rank),o(2),T(e.Name),o(2),T(C(7,4,e.Quantity)),o(3),T(C(10,6,e.OnHand))}}function zy(i,c){if(i&1&&(n(0,"content")(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Rank"),a(),n(7,"th",19),p(8,"Name"),a(),n(9,"th",20),p(10,"Sold"),a(),n(11,"th",20),p(12,"Inventory"),a()()(),n(13,"tbody"),g(14,Ky,11,8,"tr",21),a()()()()),i&2){let e=s();o(14),m("ngForOf",e.data.Data)}}var Ta=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(q,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yy,3,0,"a",2),a(),n(3,"filters"),g(4,Uy,17,11,"ng-template",null,0,M),a(),g(6,zy,15,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,Qe,De,Le,Q,J],encapsulation:2})};var Xy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Jy=i=>({ID:i});function Zy(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function $y(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function e2(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",22),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",17),p(14),d(15,"quantityFraction"),a(),n(16,"td",17),p(17),d(18,"amountFraction"),a(),n(19,"td",23),p(20),a(),n(21,"td",17),p(22),d(23,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(e.EntityName),o(2),m("routerLink",b(20,Xy))("queryParams",U(21,Jy,e.InvoiceID)),o(),T(e.Number),o(2),T(y(8,11,e.Date,"dd MMM yyyy")),o(3),T(e.Name),o(2),T(e.Code),o(2),v("(",C(15,14,e.Quantity),")"),o(3),T(C(18,16,e.UnitPrice)),o(3),v("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),v("(",C(23,18,e.Total),")")}}function t2(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",16),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",17),p(17,"Quantity"),a(),n(18,"th",17),p(19),a(),n(20,"th",18),p(21,"%"),a(),n(22,"th",17),p(23),a()()(),n(24,"tbody"),g(25,e2,24,23,"tr",19),a(),n(26,"tfoot")(27,"tr",20),F(28,"td",21)(29,"td",21)(30,"td",21)(31,"td",21)(32,"td",21),n(33,"td",17),p(34),d(35,"sum"),d(36,"quantityFraction"),a(),F(37,"td",21)(38,"td",21),n(39,"td",17),p(40),d(41,"sum"),d(42,"amountFraction"),a()()()()()()()),i&2){let e=s();o(19),v("Price (",e.data.CurrencySymbol,")"),o(4),v("Total(",e.data.CurrencySymbol,")"),o(2),m("ngForOf",e.data.Data),o(9),T(C(36,8,y(35,5,e.data.Data,"Quantity"))),o(6),T(C(42,13,y(41,10,e.data.Data,"Total")))}}var Pa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}month;year;openExportModal(){this.matDialog.open(q,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Zy,3,0,"a",2),a(),n(3,"filters"),g(4,$y,12,6,"ng-template",null,0,M),a(),g(6,t2,43,15,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,Le,Q,oe,ee,X,J],encapsulation:2})};var i2=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],n2=i=>({ID:i});function a2(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function o2(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function r2(i,c){i&1&&(n(0,"th",16),p(1,"Unit Cost"),a())}function l2(i,c){if(i&1&&(F(0,"td",43),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.UnitPrice),Pe)}}function p2(i,c){if(i&1&&(n(0,"tr",35)(1,"td",36),F(2,"span",37),a(),F(3,"td",38),n(4,"td",39),p(5),d(6,"quantityFraction"),a(),F(7,"td",40),g(8,l2,2,3,"td",41),n(9,"td",42),p(10),d(11,"amountFraction"),a(),F(12,"td",43),d(13,"amountFraction"),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("innerHtml",e.Name,Pe),o(),m("innerHtml",e.Code,Pe),o(2),v("(",C(6,7,e.Quantity),")"),o(2),m("innerHtml",e.UOMName,Pe),o(),m("ngIf",r.roleService.product.Cost),o(2),v(" ",e.Discount==0?"":"-"+C(11,9,e.Discount)+"%",""),o(2),m("innerHtml",C(13,11,e.Total),Pe)}}function m2(i,c){i&1&&(n(0,"td",31),p(1,"\xA0"),a())}function s2(i,c){if(i&1&&(n(0,"div")(1,"div",21)(2,"a",22),F(3,"span",23),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),F(9,"span",24),n(10,"div",25)(11,"div")(12,"table",26),F(13,"thead"),n(14,"tbody"),g(15,p2,14,13,"tr",27),a()()()(),n(16,"table",28)(17,"thead")(18,"tr",29)(19,"td",30),p(20,"Total"),a(),n(21,"td",31),p(22,"\xA0"),a(),n(23,"td",16),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),F(27,"td",32),g(28,m2,2,0,"td",33),n(29,"td",34),p(30,"\xA0"),a(),n(31,"td",16),p(32),d(33,"sum"),d(34,"amountFraction"),a()()()()()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(28,i2))("queryParams",U(29,n2,e.InvoiceID)),o(),m("innerHtml",e.EntityName+" #"+e.Number+" - "+y(4,9,e.Date,"dd MMM yyyy")+" ("+y(5,12,e.Created,"HH:mm")+")",Pe),o(4),v(" ",y(8,15,e.CustomerNameDisplay," - {0}")," "),o(2),m("innerHtml",e.Note,Pe),o(6),m("ngForOf",e.Item),o(9),v("",C(26,21,y(25,18,e.Item,"Quantity")),"\xA0"),o(4),m("ngIf",r.roleService.product.Cost),o(4),v("",C(34,26,y(33,23,e.Item,"Total")),"\xA0 ")}}function c2(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",15),p(8,"Code"),a(),n(9,"th",16),p(10,"Quantity"),a(),n(11,"th",17),p(12,"UOM"),a(),g(13,r2,2,0,"th",18),n(14,"th",19),p(15,"%"),a(),n(16,"th",16),p(17,"Total(Rp.)"),a()()()(),g(18,s2,35,31,"div",20),a()()),i&2){let e=s();o(13),m("ngIf",e.roleService.product.Cost),o(5),m("ngForOf",e.data.Data)}}var Ia=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],["style","width: 10%","class","text-end",4,"ngIf"],[2,"width","5%"],[4,"ngFor","ngForOf"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],["class","border-top",4,"ngFor","ngForOf"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],["style","width: 10%","class","empty-column",4,"ngIf"],[1,"empty-column",2,"width","5%"],[1,"border-top"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],["class","text-end border-start border-end","style","width: 10%;",3,"innerHtml",4,"ngIf"],[1,"small","text-danger","border-start","border-end",2,"width","5%"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,a2,3,0,"a",2),a(),n(3,"filters"),g(4,o2,12,6,"ng-template",null,0,M),a(),g(6,c2,19,2,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,Le,Q,oe,gn,ee,X,J],encapsulation:2})};var d2=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],u2=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Rr=i=>({ID:i});function _2(i,c){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),F(1,"i",6),p(2," Export"),a()}}function g2(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.RowCount),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("inputTextValue",e.pageData.Filter.ProductName),x("ngModel",e.pageData.Filter.ProductID),o(3),m("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),x("ngModel",e.pageData.Filter.VariantID)}}function f2(i,c){i&1&&(se(0),n(1,"th",34),p(2," Batch Number "),a(),ce())}function C2(i,c){i&1&&(n(0,"th",35),p(1," Cost "),a())}function x2(i,c){if(i&1&&(se(0),n(1,"td"),p(2),a(),ce()),i&2){let e=s().$implicit;o(2),T(e.SerialBatchNumber)}}function h2(i,c){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function S2(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",36),p(8),a()(),g(9,x2,3,1,"ng-container",24),n(10,"td")(11,"div",37)(12,"a",38),p(13),a(),n(14,"small",39),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",40),p(19),d(20,"number"),a(),g(21,h2,3,4,"td",41),n(22,"td",40),p(23),d(24,"number"),a(),n(25,"td",40),p(26),d(27,"number"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Outlet),o(2),T(y(5,16,e.Date,"dd MMM yy")),o(3),m("routerLink",b(27,u2))("queryParams",U(28,Rr,e.InvoiceID)),o(),T(e.Number),o(),m("ngIf",r.showBatchNumber),o(3),m("queryParams",U(30,Rr,e.CustomerID)),o(),T(e.CustomerName),o(),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),T(e.Code),o(2),T(e.SalesPerson),o(2),Xt(" ",C(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),m("ngIf",r.roleService.product.Cost),o(2),v(" ",y(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),v(" ",y(27,24,e.Total,r.pageData.FractionDigit)," ")}}function y2(i,c){i&1&&F(0,"td",45)}function D2(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td",43),p(3," Total: "),a(),n(4,"td",40),p(5),d(6,"sum"),d(7,"number"),a(),g(8,y2,1,0,"td",44),F(9,"td",45),n(10,"td",40),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=s(2);o(2),m("colSpan",e.showBatchNumber?6:5),o(3),T(C(7,7,y(6,4,e.data.Data,"Quantity"))),o(3),m("ngIf",e.roleService.product.Cost),o(3),v(" ",y(13,12,y(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function v2(i,c){if(i&1){let e=I();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5," Outlet "),a(),n(6,"th",22),p(7," Date "),a(),n(8,"th",23),p(9," Invoice # "),a(),g(10,f2,3,0,"ng-container",24),n(11,"th",25),p(12,"Customer"),a(),n(13,"th",26),p(14," SALES PERSON "),a(),n(15,"th",27),p(16," Qty "),a(),g(17,C2,2,0,"th",28),n(18,"th",29),p(19," Price "),a(),n(20,"th",30),p(21," Total "),a()()(),n(22,"tbody"),g(23,S2,28,32,"tr",31),a(),g(24,D2,14,15,"tfoot",24),a(),n(25,"div",32)(26,"POS-complex-pagination",33),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=s();o(10),m("ngIf",e.showBatchNumber),o(7),m("ngIf",e.roleService.product.Cost),o(6),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0),o(2),m("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=f}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,f);case"Date":return this.compare(t.Date,l.Date,f);case"Number":return this.compare(t.Number,l.Number,f);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,f);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,f);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,f);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,f);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Discount":return this.compare(t.Discount,l.Discount,f);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],[4,"ngIf"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],["class","empty-column",4,"ngIf"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_2,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),g(6,g2,28,16,"ng-template",null,0,M),a(),n(8,"content"),g(9,v2,27,6,"div",4),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,d2)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,ke,B,L,pe,ae,ge,Qe,Le,bt,fe,Q,Ye,oe,ie,ee],encapsulation:2})};var w2=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],T2=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],P2=()=>["/menu/Contacts/Contact/Customers/Info"],I2=i=>({ID:i}),kr=(i,c)=>({"text-danger":i,"text-success":c});function F2(i,c){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",11),p(2," Export "),a()}}function b2(i,c){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.ListBrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function E2(i,c){i&1&&(n(0,"th",32),p(1,"Total Cost "),a())}function M2(i,c){i&1&&(n(0,"th",33),p(1,"Profit"),a())}function V2(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalCost?e.TotalCost:0),"")}}function B2(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,kr,e.Profit<0,e.Profit>0)),o(),v(" ",C(2,2,e.Profit),"")}}function O2(i,c){if(i&1&&(n(0,"tr")(1,"td",39),p(2),a(),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",41),p(7),d(8,"amountFraction"),a(),g(9,V2,3,3,"td",42)(10,B2,3,7,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),v("",e.BrandName," "),o(2),v(" ",C(5,5,e.Quantity?e.Quantity:0),""),o(3),v(" ",C(8,7,e.TotalSales?e.TotalSales:0),""),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function L2(i,c){if(i&1&&(n(0,"tr",34)(1,"td")(2,"a",35),p(3),a()(),n(4,"td",22),p(5),a(),n(6,"td",23),p(7),a(),n(8,"td",24),p(9),a(),n(10,"td",36)(11,"table",37),g(12,O2,11,9,"tr",38),a()()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(8,P2))("queryParams",U(9,I2,e.CustomerID)),o(),Xt(" ",e.Name," ",e.Title," "),o(2),T(e.Email),o(2),T(e.Mobile),o(2),T(e.City),o(3),m("ngForOf",e.Detail)}}function R2(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Total.TotalCost)," ")}}function k2(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(4,kr,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),v(" ",C(2,2,e.data.Total.Profit)," ")}}function W2(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",46),F(2,"td",47),n(3,"td",48),p(4),d(5,"quantityFraction"),a(),n(6,"td",48),p(7),d(8,"amountFraction"),a(),g(9,R2,3,3,"td",49)(10,k2,3,7,"td",50),a()()),i&2){let e=s(2);o(4),v(" ",C(5,4,e.data.Total.Quantity)," "),o(3),v(" ",C(8,6,e.data.Total.TotalSales)," "),o(2),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}function N2(i,c){if(i&1){let e=I();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Customer "),a(),n(6,"th",22),p(7,"Email"),a(),n(8,"th",23),p(9,"Mobile"),a(),n(10,"th",24),p(11,"City"),a(),n(12,"th",25),p(13,"Brand"),a(),n(14,"th",26),p(15," Qty "),a(),n(16,"th",27),p(17,"Total Sales "),a(),g(18,E2,2,0,"th",28)(19,M2,2,0,"th",29),a()(),n(20,"tbody"),g(21,L2,13,11,"tr",30),a(),g(22,W2,11,8,"tfoot",31),a()()}if(i&2){let e=s();o(18),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data)}}var ba=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,f);case"Cost":return this.compare(t.TotalCost,l.TotalCost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[R],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before","class","flex-right text-end","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","arrowPosition","before","class","flex-right text-end","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[4,"ngFor","ngForOf"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],["class","border-top-0 text-end text-danger","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-end","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,F2,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),g(14,b2,13,7,"ng-template",null,0,M),a(),n(16,"content")(17,"div",7),g(18,N2,23,4,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,w2)),o(3),m("routerLink",b(11,T2)),o(7),m("ngIf",t.data),o(),m("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,ae,ge,Qe,bt,X,J],encapsulation:2})};var A2=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),G2=()=>["/menu/Reports/Sales_Report/Standard/Detail"],H2=(i,c,e)=>({From:i,To:c,TypeID:e}),Wr=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),Ma=(i,c)=>({"text-danger":i,"text-success":c});function Q2(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export"),a()}}function Y2(i,c){if(i&1){let e=I();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",14)(4,"div",15)(5,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Year=null)}),a()(),n(6,"div",17)(7,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(2);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function j2(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),g(16,Y2,8,4,"ng-container",13),a()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.isCompare),o(),m("ngIf",e.isCompare)}}function q2(i,c){i&1&&(n(0,"th",45),p(1,"Prev"),a())}function U2(i,c){i&1&&(n(0,"th",46),p(1,"Now"),a())}function K2(i,c){i&1&&(n(0,"th",47),p(1," Trans "),a())}function z2(i,c){i&1&&(n(0,"th",48),p(1,"Qty"),a())}function X2(i,c){i&1&&(n(0,"th",49),p(1,"Tax"),a())}function J2(i,c){if(i&1&&(n(0,"th",50),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Z2(i,c){i&1&&(n(0,"th",39),p(1,"\xB1 (%)"),a())}function $2(i,c){i&1&&(n(0,"th",51),p(1,"Cost"),a())}function eD(i,c){if(i&1&&(n(0,"th",50),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function tD(i,c){i&1&&(n(0,"th",52),p(1," Target "),a())}function iD(i,c){i&1&&(n(0,"th",53),p(1," Ach(%) "),a())}function nD(i,c){if(i&1&&(n(0,"td",39),p(1),a()),i&2){let e=s().$implicit;o(),T(e.PrevIndex)}}function aD(i,c){if(i&1&&(n(0,"td",55),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,A2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function oD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Quantity))}}function rD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.Count,".0-0"))}}function lD(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function pD(i,c){if(i&1&&(n(0,"td",39)(1,"a",57),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(11,G2))("queryParams",st(12,H2,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),T(C(6,9,e.SalesWithTax))}}function mD(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Wr,e.IsNegative,e.IsPositive)),o(),v(" ",C(2,2,e.Increase)," ")}}function sD(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function cD(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function dD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesTarget)," ")}}function uD(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,Ma,e.Achievement<0,e.Achievement>0)),o(),v(" ",C(2,2,e.Achievement)," ")}}function _D(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,Ma,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),v(" ",C(2,2,e.AchievementWithTax)," ")}}function gD(i,c){if(i&1&&(n(0,"td",39),g(1,uD,3,7,"span",42)(2,_D,3,7,"span",42),a()),i&2){let e=s(3);o(),m("ngIf",!e.pageData.IgnoreTax),o(),m("ngIf",e.pageData.IgnoreTax)}}function fD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",37),p(4),a(),g(5,nD,2,1,"td",31)(6,aD,2,5,"td",54)(7,oD,3,3,"td",31)(8,rD,3,4,"td",31),n(9,"td",39),p(10),d(11,"amountFraction"),a(),g(12,lD,3,3,"td",40),d(13,"HideSumZero"),g(14,pD,7,16,"td",31)(15,mD,3,7,"td",42)(16,sD,3,3,"td",43)(17,cD,3,3,"td",44)(18,dD,3,3,"td",31),d(19,"HideSumZero"),g(20,gD,3,2,"td",31),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),T(e.Name),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.data.WithCategory),o(),m("ngIf",!t.data.WithCategory),o(2),T(C(11,14,e.SalesNet)),o(2),m("ngIf",!t.data.WithCategory&&y(13,16,t.data.Data,"Tax")),o(2),m("ngIf",!t.data.WithCategory),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",y(19,19,t.data.Data,"SalesTarget")),o(2),m("ngIf",y(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||y(22,25,t.data.Data,"Achievement"))}}function CD(i,c){i&1&&F(0,"td",61)}function xD(i,c){i&1&&F(0,"td",61)}function hD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function SD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function yD(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function DD(i,c){if(i&1&&(n(0,"td",62)(1,"a",63),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function vD(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Wr,e.comparation<0,e.comparation>0)),o(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function wD(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function TD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data.Data,"Profit")))}}function PD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.data.Data,"ProfitWithTax"))," ")}}function ID(i,c){if(i&1&&(n(0,"td",60),g(1,TD,4,6,"span",13)(2,PD,4,6,"span",13),a()),i&2){let e=s(2);o(),m("ngIf",e.pageData.IgnoreTax),o(),m("ngIf",!e.pageData.IgnoreTax)}}function FD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function bD(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,Ma,y(1,2,e.data.Data,"Sales")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"Sales")/y(4,11,e.data.Data,"SalesTarget")>0)),o(5),v(" ",C(8,20,y(6,14,e.data.Data,"Sales")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function ED(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,Ma,y(1,2,e.data.Data,"SalesWithTax")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"SalesWithTax")/y(4,11,e.data.Data,"SalesTarget")>0)),o(5),v(" ",C(8,20,y(6,14,e.data.Data,"SalesWithTax")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function MD(i,c){if(i&1&&(n(0,"td",39),g(1,bD,9,25,"span",42)(2,ED,9,25,"span",42),a()),i&2){let e=s(2);o(),m("ngIf",!e.pageData.IgnoreTax),o(),m("ngIf",e.pageData.IgnoreTax)}}function VD(i,c){if(i&1){let e=I();n(0,"div",19)(1,"div",20)(2,"table",21),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",22)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",23),p(8,"Tag"),a(),g(9,q2,2,0,"th",24)(10,U2,2,0,"th",25)(11,K2,2,0,"th",26)(12,z2,2,0,"th",27),n(13,"th",28),p(14,"Sales"),a(),g(15,X2,2,0,"th",29),d(16,"HideSumZero"),g(17,J2,2,1,"th",30)(18,Z2,2,0,"th",31)(19,$2,2,0,"th",32)(20,eD,2,1,"th",30)(21,tD,2,0,"th",33),d(22,"HideSumZero"),g(23,iD,2,0,"th",34),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),g(27,fD,23,28,"tr",35),a(),n(28,"tfoot")(29,"tr",36),F(30,"td")(31,"td",37),g(32,CD,1,0,"td",38)(33,xD,1,0,"td",38)(34,hD,4,7,"td",31)(35,SD,4,6,"td",31),n(36,"td",39),p(37),d(38,"sum"),d(39,"amountFraction"),a(),g(40,yD,4,6,"td",40),d(41,"HideSumZero"),g(42,DD,5,6,"td",41)(43,vD,3,8,"td",42)(44,wD,4,6,"td",43)(45,ID,3,2,"td",44)(46,FD,4,6,"td",31),d(47,"HideSumZero"),g(48,MD,3,2,"td",31),d(49,"HideSumZero"),d(50,"HideSumZero"),a()()()()()}if(i&2){let e=s();o(9),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.data.WithCategory),o(3),m("ngIf",!e.data.WithCategory&&y(16,24,e.data.Data,"Tax")),o(2),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",y(22,27,e.data.Data,"SalesTarget")),o(2),m("ngIf",y(24,30,e.data.Data,"AchievementWithTax")||y(25,33,e.data.Data,"Achievement")&&e.roleService.report.Profit),o(4),m("ngForOf",e.data.Data),o(5),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.data.WithCategory),o(2),v(" ",C(39,39,y(38,36,e.data.Data,"SalesNet"))," "),o(3),m("ngIf",!e.data.WithCategory&&y(41,41,e.data.Data,"Tax")),o(2),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Expense&&y(47,44,e.data.Data,"Expense")),o(2),m("ngIf",y(49,47,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||y(50,50,e.data.Data,"Achievement"))}}var Ea=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Year=w.getFullYear(),this.Month=w.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,f);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);case"Expense":return this.compare(t.Expense,l.Expense,f);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,f);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,f);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[4,"ngIf"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","class","flex-left","arrowPosition","before",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["arrowPosition","before","class","flex-left",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","flex-left",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","class","align-left","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Q2,3,0,"button",2),a(),n(3,"filters"),g(4,j2,17,10,"ng-template",null,0,M),a(),n(6,"content"),g(7,VD,51,53,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,Q,oe,ti,ie,ee,X,J],encapsulation:2})};var Nr=Qt(mr()),Ar=Qt(no());function BD(i,c){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",6)(7,"div",7)(8,"datepicker",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(9,"div",7)(10,"datepicker",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),x("ngModel",e.pageData.Filter.ListIDs),o(5),x("ngModel",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("ngModel",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),x("ngModel",e.pageData.Filter.PriceRange)}}function OD(i,c){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",12),p(2," Export "),a()}}function LD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",23),p(6),d(7,"quantityFraction"),a(),n(8,"td",23),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;o(2),Xt(" ",C(3,4,e.KeyValue.Key.StartNumber)," - ",C(4,6,e.KeyValue.Key.EndNumber)," "),o(4),v(" ",e.KeyValue.Value!=0?C(7,8,e.KeyValue.Value):"-"," "),o(3),T(C(10,10,e.Sales))}}function RD(i,c){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",6)(3,"div",7)(4,"table",14)(5,"thead",15)(6,"tr",16)(7,"th",17),p(8,"Price"),a(),n(9,"th",18),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),g(14,LD,11,12,"tr",19),a()()(),n(15,"div",7)(16,"div",20)(17,"div",21),F(18,"highcharts-chart",22),a()()()()()()),i&2){let e=s();o(14),m("ngForOf",e.data.Data),o(4),m("Highcharts",e.Highcharts)("options",e.chartOptions())}}(0,Ar.default)(Nr);var Ba=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Highcharts=Nr;chartOptions=mt(null);openExportModal(){this.matDialog.open(q,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[4,"ngFor","ngForOf"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"filters"),g(2,BD,14,11,"ng-template",null,0,M),a(),n(4,"actions"),g(5,OD,3,0,"button",2),a(),g(6,RD,19,3,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(5),m("ngIf",t.roleService.global.Export),o(),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,Qe,Q,ur,ie,J],encapsulation:2})};var kD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Gr=i=>({ID:i});function WD(i,c){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function ND(i,c){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",9)(10,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function AD(i,c){i&1&&(n(0,"th",37),p(1," Purchase "),a())}function GD(i,c){i&1&&(n(0,"th",38),p(1," Tax "),a())}function HD(i,c){if(i&1&&F(0,"th",39),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function QD(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function YD(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function jD(i,c){if(i&1&&(F(0,"td",47),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",C(2,5,_i(1,1,t.data.Compenents,r,e)),Pe)}}function qD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",40),p(5),a()(),n(6,"td")(7,"a",41),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),g(14,QD,3,3,"td",42)(15,YD,3,3,"td",43)(16,jD,3,7,"td",44),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(14,kD))("queryParams",U(15,Gr,e.ID)),o(),T(e.Number),o(2),m("queryParams",U(17,Gr,e.SupplierID)),o(),v(" ",e.Name," "),o(2),T(e.TaxName),o(2),T(y(13,11,e.Date,"dd MMM yyyy")),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngForOf",r.getComponent(r.data))}}function UD(i,c){if(i&1&&(n(0,"td",48)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function KD(i,c){if(i&1&&(n(0,"td",48)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function zD(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e.SumTaxAmount)," ")}}function XD(i,c){if(i&1){let e=I();n(0,"span",50),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",51),p(2,"?"),a()()}}function JD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function ZD(i,c){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(1,"i",53),p(2," Next"),a()}}function $D(i,c){if(i&1){let e=I();n(0,"a",54),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),F(1,"i",55),p(2," Show All"),a()}}function ev(i,c){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Outlet"),a(),n(8,"th",18),p(9,"Number"),a(),n(10,"th",19),p(11,"Supplier"),a(),n(12,"th",20),p(13," Type "),a(),n(14,"th",21),p(15,"Date"),a(),g(16,AD,2,0,"th",22)(17,GD,2,0,"th",23)(18,HD,1,1,"th",24),a()(),n(19,"tbody"),g(20,qD,17,19,"tr",25),a(),n(21,"tfoot")(22,"tr",26),F(23,"td",27),g(24,UD,5,6,"td",28)(25,KD,5,6,"td",28)(26,zD,3,3,"td",29),a()()()(),n(27,"div",30)(28,"div",31)(29,"div",32),p(30),d(31,"number"),g(32,XD,3,0,"span",33)(33,JD,3,3,"span",3),p(34),a()(),n(35,"div",34),g(36,ZD,3,0,"a",35)(37,$D,3,0,"a",36),a()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.infiniteList),o(4),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngForOf",e.data.Compenents),o(4),v(" Showing 1 - ",C(31,13,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var Oa=class i extends dn{constructor(e,r,t,l,f,w){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["style","width: 150px","mat-sort-header","Sales","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 150px","mat-sort-header","Tax","arrowPosition","before","class","flex-right text-end","matTooltip","Tax Amount",4,"ngIf"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,WD,3,0,"button",2),a(),n(3,"filters"),g(4,ND,17,10,"ng-template",null,0,M),a(),g(6,ev,38,15,"content",3),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,oe,xi,ie,ee,X],encapsulation:2})};var tv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],iv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function nv(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function av(i,c){if(i&1&&(n(0,"div",12),F(1,"POS-pie-chart",13),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var La=class i extends he{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[R],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[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"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),g(13,nv,10,6,"ng-template",null,0,M),a(),n(15,"content"),g(16,av,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(7,tv)),o(3),m("routerLink",b(8,iv)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,K,B,L,ni,Q],encapsulation:2})};var ov=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],Ti=i=>[i],Hr=(i,c)=>({"text-danger":i,"text-success":c});function rv(i,c){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function lv(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),m("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),m("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function pv(i,c){if(i&1&&(n(0,"th",29),p(1),a()),i&2){let e=s(2);o(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function mv(i,c){if(i&1&&(n(0,"th",30),p(1),a()),i&2){let e=s(2);o(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function sv(i,c){i&1&&(n(0,"th",31),p(1," Profit "),a())}function cv(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.NetProfit1)," ")}}function dv(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.NetProfit2)," ")}}function uv(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Hr,e.Growth<0,e.Growth>0)),o(),v(" ",C(2,2,e.Growth),"% ")}}function _v(i,c){if(i&1&&(n(0,"tr")(1,"td",32),p(2),a(),n(3,"td",33),p(4),d(5,"amountFraction"),a(),g(6,cv,3,3,"td",34),n(7,"td",33),p(8),d(9,"amountFraction"),a(),g(10,dv,3,3,"td",34),n(11,"td",35),p(12),d(13,"amountFraction"),a(),g(14,uv,3,7,"td",36),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(),m("colSpan",r.roleService.report.Profit?1:2),o(),v(" ",C(5,10,e.SalesNTax1)," "),o(2),m("ngIf",r.roleService.report.Profit),o(),m("colSpan",r.roleService.report.Profit?1:2),o(),v(" ",C(9,12,e.SalesNTax2)," "),o(2),m("ngIf",r.roleService.report.Profit),o(),m("ngClass",de(16,Hr,e.Revenue<0,e.Revenue>0)),o(),v(" ",C(13,14,e.Revenue),"% "),o(2),m("ngIf",r.roleService.report.Profit)}}function gv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.netProfit1Total>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.netProfit1Total)," ")}}function fv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.netProfit2Total>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.netProfit2Total)," ")}}function Cv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.profitPercentage>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.profitPercentage),"% ")}}function xv(i,c){if(i&1){let e=I();n(0,"div",12)(1,"table",13),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5," Outlet "),a(),n(6,"th",16)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",17)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",17),p(23,"YOY Growth"),a()(),n(24,"tr",18)(25,"th",19),p(26),a(),g(27,pv,2,1,"th",20),n(28,"th",21),p(29),a(),g(30,mv,2,1,"th",22),n(31,"th",23),p(32,"Revenue"),a(),g(33,sv,2,0,"th",24),a()(),n(34,"tbody"),g(35,_v,15,19,"tr",25),a(),n(36,"tfoot")(37,"tr"),F(38,"td"),n(39,"td",26),p(40),d(41,"amountFraction"),a(),g(42,gv,3,6,"td",27),n(43,"td",26),p(44),d(45,"amountFraction"),a(),g(46,fv,3,6,"td",27),n(47,"td",28),p(48),d(49,"amountFraction"),a(),g(50,Cv,3,6,"td",27),a()()()()}if(i&2){let e=s();o(8),T(y(9,23,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),T(y(13,26,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),T(y(17,29,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),T(y(21,32,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),m("colSpan",e.roleService.report.Profit?1:2),o(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),m("ngIf",e.roleService.report.Profit),o(),m("colSpan",e.roleService.report.Profit?1:2),o(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),m("ngIf",e.roleService.report.Profit),o(3),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data),o(4),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(41,Ti,e.salesNTax1Total>0?"text-success":"text-danger")),o(),v(" ",C(41,35,e.salesNTax1Total)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(43,Ti,e.salesNTax2Total>0?"text-success":"text-danger")),o(),v(" ",C(45,37,e.salesNTax2Total)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngClass",U(45,Ti,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),v(" ",C(49,39,e.salesNTaxPercentage),"% "),o(2),m("ngIf",e.roleService.report.Profit)}}var Ra=class i extends ne{constructor(e,r,t,l,f,w){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=f;this.matDialog=w}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],f);case"string":return this.compare(t[e.active],l[e.active],f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(H),D(G),D(W),D(O),D(oe),D(j))};static \u0275cmp=E({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit1",4,"ngIf"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit2",4,"ngIf"],["mat-sort-header","Revenue",1,"align-center"],["class","align-center","mat-sort-header","Growth",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end",3,"colSpan","ngClass"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Growth",1,"align-center"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],["class","text-end border-end",4,"ngIf"],[1,"text-end","border-end",3,"ngClass"],["class","text-end border-end",3,"ngClass",4,"ngIf"],[1,"text-end","border-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,rv,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),g(6,lv,16,13,"ng-template",null,0,M),a(),n(8,"content"),g(9,xv,51,47,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,ov)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,ae,ge,Gt,fe,Q,ee,X],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Li=Qt(Oi());var hv={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Pi=class i{yearCtrl=new To(null);year=uo(null);minDate=(0,Li.default)().subtract(100,"years");maxDate=(0,Li.default)();constructor(){So(()=>{this.year()&&this.yearCtrl.setValue((0,Li.default)().year(this.year()).startOf("year"))})}chosenYearHandler(c,e){let r=c.year(),t=(0,Li.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en]},{provide:nn,useValue:hv}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let f=Ze(4);return _(f.open())}),a(),F(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))}),a()()}if(e&2){let t=Ze(4);o(),m("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),m("for",t)}},dependencies:[sn,on,an,fi,cn,gi,rn,ln,pn,At,ke,B,Xi,Io],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
7
- `],encapsulation:2,changeDetection:0})};var yv=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function Dv(i,c){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),S("yearChange",function(t){u(e);let l=s();return h(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),S("yearChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options.Currencies),o(4),x("year",e.pageData.Filter.FromYear),o(2),x("year",e.pageData.Filter.ToYear)}}function vv(i,c){if(i&1&&(n(0,"div",11),F(1,"POS-line-chart",12),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var ka=class i extends ne{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,f="",w=Math.abs(t[this.x]?t[this.x]:0);return w>999&&w<1e10?(f="K",l=(w/1e3).toFixed(0)):w>=1e10?(f="M",l=(w/1e6).toFixed(0)):w<999&&(l=w.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+f}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(w=>this.series?.name?.includes("Cost")?w?.name?.includes("Cost"):w?.name?.includes("Cost")==!1);let t=[],l="",f=this.point.index;return r.forEach(w=>{w.options.stack===this.point.series.options.stack&&(t=w.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
8
- ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(w.points[f]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(f=>f.Name=="Sales").map(f=>f.Amount),t=this.data.Series.filter(f=>f.Name=="Profit").map(f=>f.Amount),l=this.data.Series.filter(f=>f.Name=="Cost").map(f=>f.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G))};static \u0275cmp=E({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[R],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),F(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),g(6,Dv,16,10,"ng-template",null,0,M),a(),n(8,"content"),g(9,vv,2,2,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,yv)),o(7),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,pe,Et,fe,Q,Pi],encapsulation:2})};var wv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Tv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Pv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Iv=i=>({id:i}),Fv=i=>[i],Qr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],bv=(i,c,e)=>({CategoryID:i,From:c,To:e}),Yr=i=>({CategoryID:i}),Ev=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function Mv(i,c){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",10),p(2," Export "),a()}}function Vv(i,c){if(i&1&&(n(0,"span",24),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function Bv(i,c){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,Vv,2,2,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Exclude Zero"),a(),n(31,"radio-options",23),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",U(21,Fv,U(19,Iv,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.TagID),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function Ov(i,c){i&1&&(n(0,"th",47),p(1," DISCOUNT "),a())}function Lv(i,c){i&1&&(n(0,"th",48),p(1," DISCOUNT (%) "),a(),n(2,"th",49),p(3," DISCOUNT (AMOUNT) "),a())}function Rv(i,c){i&1&&(n(0,"th",50),p(1," COST "),a())}function kv(i,c){i&1&&(n(0,"th",51),p(1," PROFIT "),a())}function Wv(i,c){i&1&&(n(0,"th",52),p(1," % "),a())}function Nv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function Av(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function Gv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Percentage),"% ")}}function Hv(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",53),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),n(9,"td",41)(10,"a",53),p(11),d(12,"amountFraction"),a()(),n(13,"td",41)(14,"a",53),p(15),d(16,"amountFraction"),a()(),n(17,"td",41),p(18),d(19,"amountFraction"),a(),n(20,"td",43),p(21),d(22,"amountFraction"),a(),n(23,"td",41),p(24),d(25,"amountFraction"),a(),g(26,Nv,3,3,"td",44)(27,Av,3,4,"td",45)(28,Gv,3,4,"td",45),a()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(34,Qr))("queryParams",st(35,bv,e.ID,y(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),y(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(e.Name),o(2),T(C(8,22,e.Quantity)),o(3),m("routerLink",b(39,Qr))("queryParams",U(40,Yr,e.ID)),o(),v(" ",C(12,24,e.GrossSales)," "),o(3),m("routerLink",b(42,Ev))("queryParams",U(43,Yr,e.ID)),o(),T(C(16,26,e.Discount)),o(3),T(C(19,28,e.Sales)),o(3),v(" ",C(22,30,e.Tax)," "),o(3),T(C(25,32,e.SalesNTax)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit)}}function Qv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function Yv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.data.Aggregate.TotalProfit)," ")}}function jv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function qv(i,c){if(i&1){let e=I();n(0,"content")(1,"div",25)(2,"div",26)(3,"table",27),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",28)(5,"tr")(6,"th",29),p(7,"CATEGORY"),a(),n(8,"th",30),p(9," QUANTITY "),a(),n(10,"th",31),p(11," GROSS SALES "),a(),g(12,Ov,2,0,"th",32)(13,Lv,4,0,"ng-template",null,1,M),n(15,"th",33),p(16," NET SALES "),a(),n(17,"th",34),p(18," Tax "),a(),n(19,"th",35),p(20," Sales + Tax "),a(),g(21,Rv,2,0,"th",36)(22,kv,2,0,"th",37)(23,Wv,2,0,"th",38),a()(),n(24,"tbody"),g(25,Hv,29,45,"tr",39),a(),n(26,"tfoot")(27,"tr",40)(28,"td",41),p(29,"Total :"),a(),n(30,"td",41),p(31),d(32,"quantityFraction"),a(),n(33,"td",42)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",41),p(38),d(39,"amountFraction"),a(),n(40,"td",41),p(41),d(42,"amountFraction"),a(),n(43,"td",43),p(44),d(45,"amountFraction"),a(),n(46,"td",41),p(47),d(48,"amountFraction"),a(),g(49,Qv,3,3,"td",44)(50,Yv,3,4,"td",45)(51,jv,3,4,"td",45),a()()()(),n(52,"POS-complex-pagination",46),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=Ze(14),r=s();o(12),m("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit),o(2),m("ngForOf",r.data.Data),o(6),v(" ",C(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),T(C(36,19,r.data.Aggregate.TotalGross)),o(3),v(" ",C(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),v(" ",C(45,25,r.data.Aggregate.TotalTax)," "),o(3),v(" ",C(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit),o(),m("total",r.data.Count)("pageData",r.pageData)}}var Wa=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Total":return this.compare(t.Total,l.Total,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Discount":return this.compare(t.Discount,l.Discount,f);case"NetSales":return this.compare(t.NetSales,l.NetSales,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"Percentage":return this.compare(t.Percentage,l.Percentage,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,f);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Mv,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),g(17,Bv,32,23,"ng-template",null,0,M),a(),g(19,qv,53,29,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,wv)),o(3),m("routerLink",b(11,Tv)),o(3),m("routerLink",b(12,Pv)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,Le,bt,fe,Q,Ye,un,ie,ee,X,J],encapsulation:2})};var qr=(i,c)=>({"text-danger":i,"text-success":c}),Uv=()=>["/menu/Products/Catalog/Variants/Info"],jr=i=>({ID:i}),Kv=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function zv(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function Xv(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(17,"div",12)(18,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",15)(25,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CompareDifference),m("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),x("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.Note),o(4),x("ngModel",e.pageData.Filter.DiscountFrom),o(),x("ngModel",e.pageData.Filter.DiscountTo)}}function Jv(i,c){i&1&&(se(0),n(1,"th",38),p(2,"Cost"),a(),ce())}function Zv(i,c){if(i&1&&(se(0),n(1,"td",36),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.UnitCost))}}function $v(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",39),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",39),p(10),a(),F(11,"span",40),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",34),p(16),d(17,"quantityFraction"),a(),g(18,Zv,4,3,"ng-container",3),n(19,"td",34),p(20),d(21,"amountFraction"),a(),n(22,"td",34),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",36),p(29),d(30,"amountFraction"),a(),n(31,"td",37),p(32),d(33,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(33,Uv))("queryParams",U(34,jr,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(2),m("routerLink",b(36,Kv))("queryParams",U(37,jr,e.InvoiceID)),o(),T(e.Number),o(),m("innerHTML",e.Note,Pe),o(2),T(y(14,18,e.Date,"dd MMM yyyy")),o(3),T(C(17,21,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost),o(2),T(C(21,23,e.UnitPriceOriginal)),o(3),T(C(24,25,e.UnitPrice)),o(2),m("ngClass",de(39,qr,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),v(" ",C(27,27,e.Discount),""),o(3),v(" ",C(30,29,e.DiscountPercentage),"% "),o(3),T(C(33,31,e.Sales))}}function ew(i,c){if(i&1&&(se(0),n(1,"td",36),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2);o(2),T(C(3,1,e.data.Aggregate.TotalUnitCost))}}function tw(i,c){if(i&1){let e=I();se(0),n(1,"POS-complex-pagination",41),P("jumpToPage",function(){u(e);let t=s(2);return _(t.getListData())})("previousPage",function(){u(e);let t=s(2);return _(t.getListData())})("nextPage",function(){u(e);let t=s(2);return _(t.getListData())}),a(),ce()}if(i&2){let e=s(2);o(),m("total",e.data.Data.length)("pageData",e.pageData)}}function iw(i,c){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Variant"),a(),n(10,"th",23),p(11,"Code"),a(),n(12,"th",24),p(13,"Number / Note"),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17,"Quantity"),a(),g(18,Jv,3,0,"ng-container",3),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),g(30,$v,34,42,"tr",32),a(),n(31,"tfoot")(32,"tr"),F(33,"td",33),n(34,"td",34),p(35,"Total :"),a(),n(36,"td",34),p(37),d(38,"quantityFraction"),a(),g(39,ew,4,3,"ng-container",3),n(40,"td",34),p(41),d(42,"amountFraction"),a(),n(43,"td",34),p(44),d(45,"amountFraction"),a(),n(46,"td",35),p(47),d(48,"amountFraction"),a(),n(49,"td",36),p(50),d(51,"amountFraction"),a(),n(52,"td",37),p(53),d(54,"amountFraction"),a()()()()(),g(55,tw,2,2,"ng-container",3),a()()}if(i&2){let e=s();o(18),m("ngIf",e.roleService.product.Cost),o(12),m("ngForOf",e.data.Data),o(7),T(C(38,11,e.data.Aggregate.TotalQuantity)),o(2),m("ngIf",e.roleService.product.Cost),o(2),T(C(42,13,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),T(C(45,15,e.data.Aggregate.TotalUnitPrice)),o(2),m("ngClass",de(23,qr,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),v(" ",C(48,17,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount),""),o(3),v(" ",C(51,19,e.data.Aggregate.DiscountPercentage),"% "),o(3),T(C(54,21,e.data.Aggregate.TotalNetSales)),o(2),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.length)>0)}}var Na=class i extends he{constructor(e,r,t,l,f){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=f}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Number":return V.compare(t.Number,l.Number,f);case"Date":return V.compare(t.Date,l.Date,f);case"Quantity":return V.compare(t.Quantity,l.Quantity,f);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,f);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,f);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,f);case"Discount":return V.compare(t.Discount,l.Discount,f);case"Sales":return V.compare(t.Sales,l.Sales,f);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,f);case"Note":return V.compare(t.Note,l.Note,f);default:return 0}})}openExportModal(){this.dialog.open(q,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"text-end"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,zv,3,0,"a",2),a(),n(3,"filters"),g(4,Xv,27,16,"ng-template",null,0,M),a(),g(6,iw,56,26,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Le,bt,fe,Q,ee,X,J],encapsulation:2})};var nw=()=>["/menu/Reports/Sales_Report/Standard/Person"],aw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],ow=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],rw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],lw=(i,c)=>({From:i,To:c}),Kr=i=>({ID:i}),Ur=i=>[i],pw=(i,c)=>({SalesPersonID:i,ListIDs:c}),mw=(i,c,e,r)=>({SalesPersonID:i,ListIDs:c,From:e,To:r});function sw(i,c){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",16),p(2," Export "),a()}}function cw(i,c){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s(2);o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),m("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function dw(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38)(7,"a",40),p(8),d(9,"number"),a()(),n(10,"td",38),p(11),d(12,"quantityFraction"),a(),n(13,"td",38),p(14),d(15,"quantityFraction"),a(),n(16,"td",38),p(17),d(18,"quantityFraction"),a(),n(19,"td",38),p(20),d(21,"amountFraction"),a(),n(22,"td",38),p(23),d(24,"amountFraction"),a(),n(25,"td",38)(26,"a",40),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",38),p(32),d(33,"quantityFraction"),a(),n(34,"td",38),p(35),d(36,"quantityFraction"),a(),n(37,"td",38),p(38),d(39,"quantityFraction"),a(),n(40,"td",38),p(41),d(42,"amountFraction"),a(),n(43,"td",38),p(44),d(45,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s().$implicit,t=s(2);o(2),m("queryParams",U(47,Kr,e.PersonID)),o(),T(e.PersonName),o(2),T(e.PersonCode),o(2),m("queryParams",de(51,pw,e.PersonID,U(49,Ur,r.EntityID))),o(),T(C(9,17,e.CountOrder)),o(3),T(C(12,19,e.Quantity)),o(3),T(C(15,21,e.BasketSize)),o(3),T(C(18,23,e.BasketValue)),o(3),T(C(21,25,e.Sales)),o(3),T(C(24,27,e.AverageDailySales)),o(3),m("queryParams",qt(56,mw,e.PersonID,U(54,Ur,r.EntityID),y(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),y(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),v(" ",C(30,35,e.CountOrder1),""),o(3),T(C(33,37,e.Quantity1)),o(3),T(C(36,39,e.BasketSize1)),o(3),T(C(39,41,e.BasketValue1)),o(3),T(C(42,43,e.Sales1)),o(3),T(C(45,45,e.AverageDailySales1))}}function uw(i,c){if(i&1&&(n(0,"table",22)(1,"thead",23)(2,"tr",24)(3,"th",25)(4,"h2")(5,"a",26),p(6),a()()()(),n(7,"tr")(8,"th",27),p(9," Sales Person"),a(),n(10,"th",28)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",29)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",30)(27,"th",31),p(28," Ordr"),a(),n(29,"th",32),p(30,"Qty"),a(),n(31,"th",32),F(32,"i",33),a(),n(33,"th",34),p(34,"Basket Value"),a(),n(35,"th",34),p(36,"Sales"),a(),n(37,"th",34),p(38,"Avg Daily"),a(),n(39,"th",35),p(40,"Ordr"),a(),n(41,"th",32),p(42,"Qty"),a(),n(43,"th",32),F(44,"i",33),a(),n(45,"th",34),p(46,"Basket Value"),a(),n(47,"th",34),p(48,"Sales"),a(),n(49,"th",34),p(50,"Avg Daily"),a()()(),n(51,"tbody"),g(52,dw,46,61,"tr",36),a(),n(53,"tfoot")(54,"tr",37)(55,"td"),p(56,"Total"),a(),n(57,"td",38),p(58),d(59,"sum"),d(60,"number"),a(),n(61,"td",38),p(62),d(63,"sum"),d(64,"quantityFraction"),a(),n(65,"td",38),p(66),d(67,"sum"),d(68,"quantityFraction"),a(),n(69,"td",38),p(70),d(71,"sum"),d(72,"quantityFraction"),a(),n(73,"td",38),p(74),d(75,"sum"),d(76,"amountFraction"),a(),n(77,"td",38),p(78),d(79,"sum"),d(80,"amountFraction"),a(),n(81,"td",38),p(82),d(83,"sum"),d(84,"number"),a(),n(85,"td",38),p(86),d(87,"sum"),d(88,"quantityFraction"),a(),n(89,"td",38),p(90),d(91,"sum"),d(92,"quantityFraction"),a(),n(93,"td",38),p(94),d(95,"sum"),d(96,"quantityFraction"),a(),n(97,"td",38),p(98),d(99,"sum"),d(100,"amountFraction"),a(),n(101,"td",38),p(102),d(103,"sum"),d(104,"amountFraction"),a()()()()),i&2){let e=c.$implicit,r=s(2);o(5),m("queryParams",U(91,Kr,e.EntityID)),o(),T(e.EntityName),o(6),T(y(13,19,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),T(y(17,22,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),T(y(21,25,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),T(y(25,28,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),m("ngForOf",e.SalesCommison),o(6),T(C(60,34,y(59,31,e.SalesCommison,"CountOrder"))),o(4),T(C(64,39,y(63,36,e.SalesCommison,"Quantity"))),o(4),T(C(68,44,y(67,41,e.SalesCommison,"BasketSize"))),o(4),T(C(72,49,y(71,46,e.SalesCommison,"BasketValue"))),o(4),T(C(76,54,y(75,51,e.SalesCommison,"Sales"))),o(4),T(C(80,59,y(79,56,e.SalesCommison,"AverageDailySales"))),o(4),T(C(84,64,y(83,61,e.SalesCommison,"CountOrder1"))),o(4),T(C(88,69,y(87,66,e.SalesCommison,"Quantity1"))),o(4),T(C(92,74,y(91,71,e.SalesCommison,"BasketSize1"))),o(4),T(C(96,79,y(95,76,e.SalesCommison,"BasketValue1"))),o(4),T(C(100,84,y(99,81,e.SalesCommison,"Sales1"))),o(4),T(C(104,89,y(103,86,e.SalesCommison,"AverageDailySales1")))}}function _w(i,c){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=s();return _(t.print())}),F(4,"i",5),p(5," Print"),a(),g(6,sw,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,cw,13,9,"ng-template",null,0,M),a(),n(28,"content")(29,"div",12)(30,"div",13),g(31,uw,105,93,"table",14),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),o(6),m("routerLink",b(17,nw)),o(3),m("routerLink",b(18,aw)),o(3),m("routerLink",b(19,ow)),o(3),m("routerLink",b(20,rw))("queryParams",de(21,lw,y(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),m("ngForOf",e.data==null?null:e.data.Data)}}var Aa=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[4,"ngFor","ngForOf"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&g(0,_w,32,24,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,B,L,pe,Gt,Q,Ye,oe,ie,ee,X,J],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var gw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],fw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Cw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],xw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],hw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Sw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],zr=i=>({ID:i});function yw(i,c){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",38),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=s(2);o(2),x("model",e.pageData.Filter.ReleasedType),m("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function Dw(i,c){if(i&1){let e=I();n(0,"div",21)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",23),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),g(10,yw,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",25)(14,"datepicker",26),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",27),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",28)(17,"div",29),p(18,"Number Of Interval"),a(),n(19,"div",29),p(20,"Interval Of"),a()(),n(21,"div",30)(22,"input",31),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",32)(24,"input",33),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",34),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",35),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",36),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",36),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",37),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("ngModel",e.pageData.Filter.ListTagID),m("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),Nt((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),x("date",e.pageData.Filter.ReleasedFrom),o(),x("date",e.pageData.Filter.ReleasedTo),o(7),x("ngModel",e.pageData.Filter.IntervalCount),o(2),x("ngModel",e.pageData.Filter.IntervalDays),o(5),m("max",1e3),x("ngModel",e.pageData.Filter.RowCount),o(3),x("model",e.pageData.Filter.PurchaseType),m("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),x("model",e.pageData.Filter.GroupByProduct),m("options",e.scopeFilter),o(3),x("model",e.pageData.Filter.HideZero),m("options",e.hideZeroOptions)}}function vw(i,c){if(i&1){let e=I();n(0,"button",39),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",40),p(2," Export "),a()}}function ww(i,c){if(i&1&&(n(0,"th",41),p(1),a(),n(2,"th",42),p(3," % "),a()),i&2){let e=c.$index,r=s();m("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),v(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),m("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function Tw(i,c){if(i&1&&(se(0),n(1,"th",43),d(2,"date"),d(3,"date"),p(4," TOT "),a(),n(5,"th",44),d(6,"date"),d(7,"date"),p(8," % "),a(),ce()),i&2){let e=s();o(),m("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
6
+ `)}),f}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[R],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"a",3),I(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),g(7,ad,22,13,"ng-template",null,0,V),a(),n(9,"content"),g(10,od,2,2,"div",5),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(3),m("routerLink",b(6,nd)),o(7),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,pe,De,Et,li,fe,Q],encapsulation:2})};var rd=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ld=(i,c)=>({"text-success":i,"text-danger":c}),Tr=(i,c)=>({"text-success fw-bold":i,"text-danger fw-bold":c});function pd(i,c){if(i&1){let e=F();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function md(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(5),x("ngModel",e.pageData.Filter.FromYear),m("items",e.Years),o(2),x("ngModel",e.pageData.Filter.ToYear),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Option.Currencies)}}function sd(i,c){if(i&1&&(n(0,"th",29),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=c.$implicit,r=s(2);m("colSpan",y(2,5,r.filterSales(y(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),v(" ",e,"")}}function cd(i,c){i&1&&(n(0,"th",33),p(1," Sales"),a())}function dd(i,c){i&1&&(n(0,"th",32),p(1," Tax"),a())}function ud(i,c){if(i&1&&(se(0),g(1,cd,2,0,"th",30),d(2,"GetChildrenArray"),d(3,"sum"),g(4,dd,2,0,"th",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"th",32),p(8," Sales + Tax"),a(),ce()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",y(3,5,r.filterSales(y(2,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,11,r.filterSales(y(5,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0)}}function _d(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit,t=s(2);o(),v(" ",C(3,4,y(2,1,t.filterSales(r.Sales,"Year",e),"Sales")),"")}}function gd(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit,t=s(2);o(),v(" ",C(3,4,y(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function fd(i,c){if(i&1&&(se(0),g(1,_d,4,6,"td",31),d(2,"GetChildrenArray"),d(3,"sum"),g(4,gd,4,6,"td",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",32),p(8),d(9,"sum"),d(10,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,r=s().$implicit,t=s(2);o(),m("ngIf",y(3,6,t.filterSales(y(2,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,12,t.filterSales(y(5,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0),o(4),v(" ",C(10,18,y(9,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")),"")}}function Cd(i,c){if(i&1&&(n(0,"tr",34)(1,"td"),p(2),d(3,"Month"),a(),g(4,fd,11,20,"ng-container",24),n(5,"td",28),d(6,"sum"),d(7,"sum"),p(8),d(9,"sum"),d(10,"number"),a(),n(11,"td",28),d(12,"sum"),d(13,"sum"),p(14),d(15,"sum"),d(16,"number"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(C(3,6,e.Month)),o(2),m("ngForOf",r.data.HeaderList),o(),m("ngClass",de(30,Tr,y(6,8,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,y(7,11,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),v(" ",C(10,17,y(9,14,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),m("ngClass",de(33,Tr,y(12,19,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,y(13,22,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),v(" ",C(16,28,y(15,25,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function xd(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(4,7,y(3,4,r.filterSales(y(2,1,r.data.Data,"Sales"),"Year",e),"Sales")),"")}}function hd(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(4,7,y(3,4,r.filterSales(y(2,1,r.data.Data,"Sales"),"Year",e),"Tax")),"")}}function Sd(i,c){if(i&1&&(se(0),g(1,xd,5,9,"td",35),d(2,"GetChildrenArray"),d(3,"sum"),g(4,hd,5,9,"td",36),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",37),p(8),d(9,"GetChildrenArray"),d(10,"sum"),d(11,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",y(3,6,r.filterSales(y(2,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(3),m("ngIf",y(6,12,r.filterSales(y(5,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0),o(4),v(" ",C(11,21,y(10,18,r.filterSales(y(9,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")),"")}}function yd(i,c){if(i&1&&(n(0,"div",18)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Month"),a(),g(6,sd,4,8,"th",22),n(7,"th",23),p(8,"Diff"),a(),n(9,"th",23),p(10,"%"),a()(),n(11,"tr"),g(12,ud,9,14,"ng-container",24),a()(),n(13,"tbody"),g(14,Cd,17,36,"tr",25),a(),n(15,"tfoot",26)(16,"tr")(17,"td",27),p(18,"Total :"),a(),g(19,Sd,12,23,"ng-container",24),n(20,"td",28),p(21),d(22,"number"),a()()()()()),i&2){let e=s();o(6),m("ngForOf",e.data.HeaderList),o(6),m("ngForOf",e.data.HeaderList),o(2),m("ngForOf",e.data.Data),o(5),m("ngForOf",e.data.HeaderList),o(),m("ngClass",de(8,ld,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),v(" ",C(22,6,e.data.TotalDiff),"")}}var qn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=M.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(q,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],["class"," text-center border-start border-end",3,"colSpan",4,"ngFor","ngForOf"],["rowspan","2",1,"text-end"],[4,"ngFor","ngForOf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-center","border-start","border-end",3,"colSpan"],["class","text-end border-start",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],[1,"text-end","border-start"],[1,"border-bottom"],["class","text-end text-success",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,pd,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,md,23,15,"ng-template",null,0,V),a(),n(9,"content"),g(10,yd,23,11,"div",5),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,rd)),o(7),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,fe,Q,Ye,oe,fn,Yo,ie,X],encapsulation:2})};var Dd=()=>["/menu/Reports/Sales_Report/Standard/Daily"],eo=(i,c)=>({From:i,To:c}),vd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],wd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],Pr=i=>({"is-weekend":i});function Td(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Pd(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),x("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Fd(i,c){i&1&&(n(0,"th",39),p(1," Tax "),a())}function Id(i,c){i&1&&(n(0,"th",40),p(1,"Net Sales + Tax"),a())}function bd(i,c){i&1&&(n(0,"th",41),p(1,"Cost"),a())}function Ed(i,c){i&1&&(n(0,"th",42),p(1," Profit "),a())}function Md(i,c){i&1&&(n(0,"th",43),p(1," Profit + Tax Include "),a())}function Vd(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Tax))}}function Bd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v("",C(2,1,e.SalesNetWithTax)," ")}}function Od(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost),"")}}function Ld(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit),"")}}function Rd(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.ProfitWithTax),"")}}function kd(i,c){if(i&1&&(n(0,"tr",44)(1,"td",44),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",34),p(8),d(9,"number"),a(),n(10,"td",34),p(11),d(12,"quantityFraction"),a(),n(13,"td",34),p(14),d(15,"amountFraction"),a(),n(16,"td",34),p(17),d(18,"amountFraction"),a(),g(19,Vd,3,3,"td",45)(20,Bd,3,3,"td",35)(21,Od,3,3,"td",36)(22,Ld,3,4,"td",38)(23,Rd,3,4,"td",38),a()),i&2){let e=c.$implicit,r=s(2);m("ngClass",U(27,Pr,r.data.DayOfWeekend)),o(),m("ngClass",U(29,Pr,e.DayOfWeekend)),o(),v(" ",y(3,13,e.Day,"EEEE")," "),o(3),T(y(6,16,e.Day,"dd")),o(3),T(C(9,19,e.Count)),o(3),T(C(12,21,e.Quantity)),o(3),T(C(15,23,e.Gross)),o(3),T(C(18,25,e.SalesNet)),o(2),m("ngIf",r.data.ShowTax),o(),m("ngIf",r.data.ShowTax),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost),o(),m("ngIf",!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost)}}function Wd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax")),"")}}function Nd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"SalesNetWithTax")),"")}}function Ad(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost")),"")}}function Gd(i,c){if(i&1&&(n(0,"td",49),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.data.Data,"Profit")),"")}}function Hd(i,c){if(i&1&&(n(0,"td",48),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.data.Data,"ProfitWithTax")),"")}}function Qd(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Day"),a(),n(6,"th",22),p(7,"Dt."),a(),n(8,"th",23),p(9,"Orders "),a(),n(10,"th",24),p(11," Quantity"),a(),n(12,"th",25),p(13," Gross"),a(),n(14,"th",26),p(15," Net Sales"),a(),g(16,Fd,2,0,"th",27)(17,Id,2,0,"th",28)(18,bd,2,0,"th",29)(19,Ed,2,0,"th",30)(20,Md,2,0,"th",31),a()(),n(21,"tbody"),g(22,kd,24,31,"tr",32),a(),n(23,"tfoot")(24,"tr"),I(25,"td",33)(26,"td",33),n(27,"td",34),p(28),d(29,"sum"),d(30,"number"),a(),n(31,"td",34),p(32),d(33,"sum"),d(34,"quantityFraction"),a(),n(35,"td",34),p(36),d(37,"sum"),d(38,"amountFraction"),a(),n(39,"td",34),p(40),d(41,"sum"),d(42,"amountFraction"),a(),g(43,Wd,4,6,"td",35)(44,Nd,4,6,"td",35)(45,Ad,4,6,"td",36)(46,Gd,5,10,"td",37)(47,Hd,5,10,"td",38),a()()()()}if(i&2){let e=s();o(16),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(6),T(C(30,18,y(29,15,e.data.Data,"Count"))),o(4),T(C(34,23,y(33,20,e.data.Data,"Quantity"))),o(4),T(C(38,28,y(37,25,e.data.Data,"Gross"))),o(4),T(C(42,33,y(41,30,e.data.Data,"SalesNet"))),o(3),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.data.ShowTax),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),o(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost)}}var Un=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.activatedRoute=w}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(q,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[R],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["style","width: 120px","class"," flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","SalesNetWithTax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["style","width: 160px","class"," flex-right","mat-sort-header","ProfitWithTax","arrowPosition","before",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-danger",3,"ngClass",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger",3,"ngClass"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Td,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),g(17,Pd,22,16,"ng-template",null,0,V),a(),n(19,"content"),g(20,Qd,48,35,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Dd))("queryParams",de(13,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(16,vd))("queryParams",de(17,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(20,wd))("queryParams",de(21,eo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,ae,ge,Gt,fe,Q,Ye,oe,ie,ee,X,J],encapsulation:2})};var Yd=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function jd(i,c){if(i&1){let e=F();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function qd(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Currency"),a(),n(15,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",15),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Ud(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function Kd(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function zd(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function Xd(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Profit)," ")}}function Jd(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",25),p(5),d(6,"number"),a(),n(7,"td",25),p(8),d(9,"quantityFraction"),a(),g(10,zd,3,3,"td",26),n(11,"td",25),p(12),d(13,"amountFraction"),a(),n(14,"td",25),p(15),d(16,"amountFraction"),a(),n(17,"td",27),p(18),d(19,"amountFraction"),a(),n(20,"td",28),p(21),d(22,"amountFraction"),a(),g(23,Xd,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(C(3,9,e.Month)),o(3),T(C(6,11,e.Count)),o(3),T(C(9,13,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),T(C(13,15,e.Gross)),o(3),T(C(16,17,e.Sales)),o(3),T(C(19,19,e.Tax)),o(3),T(C(22,21,e.SalesNetWithTax)),o(2),m("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Zd(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost")),"")}}function $d(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Profit")),"")}}function eu(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Month"),a(),n(6,"th",20),p(7,"Orders"),a(),n(8,"th",21),p(9,"Quantity"),a(),g(10,Ud,2,0,"th",22),n(11,"th",21),p(12,"Gross"),a(),n(13,"th",21),p(14,"Sales"),a(),n(15,"th",21),p(16,"Tax"),a(),n(17,"th",21),p(18,"Sales + Tax"),a(),g(19,Kd,2,0,"th",22),a()(),n(20,"tbody"),g(21,Jd,24,23,"tr",23),a(),n(22,"tfoot")(23,"tr",24),I(24,"td"),n(25,"td",25),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",25),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),g(33,Zd,4,6,"td",26),n(34,"td",25),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",25),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",27),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",28),p(47),d(48,"sum"),d(49,"amountFraction"),a(),g(50,$d,4,6,"td",29),a()()()()),i&2){let e=s();o(10),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(5),v("",C(28,14,y(27,11,e.data.Data,"Count"))," "),o(4),T(C(32,19,y(31,16,e.data.Data,"Quantity"))),o(3),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),v("",C(37,24,y(36,21,e.data.Data,"Gross"))," "),o(4),v("",C(41,29,y(40,26,e.data.Data,"Sales"))," "),o(4),v(" ",C(45,34,y(44,31,e.data.Data,"Tax")),""),o(4),v(" ",C(49,39,y(48,36,e.data.Data,"SalesNetWithTax")),""),o(3),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var Kn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Years=M.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,jd,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,qd,22,14,"ng-template",null,0,V),a(),n(9,"content"),g(10,eu,51,41,"div",5),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,Yd)),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,B,L,pe,De,fe,Q,Ye,oe,fn,ie,X,J],encapsulation:2})};var tu=()=>["/menu/Reports/Sales_Report/Standard/Daily"],Fr=(i,c)=>({From:i,To:c}),iu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],nu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function au(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",12),P("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function ou(i,c){if(i&1&&(n(0,"content")(1,"div",13),I(2,"POS-line-chart",14),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var zn=class i extends ne{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=M.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=M.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return M.getDatesInRange(e,r).map(f=>`${f.getDate()} ${M.Months[f.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[R],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,au,13,12,"ng-template",null,0,V),a(),g(18,ou,3,2,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(10,tu))("queryParams",de(11,Fr,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(14,iu))("queryParams",de(15,Fr,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),m("routerLink",b(18,nu)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var ru=()=>["/menu/Reports/Sales_Report/Standard/Daily"],lu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],pu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function mu(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function su(i,c){if(i&1&&(n(0,"div",12),I(1,"POS-line-chart",13),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.ChartData)}}var Xn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=M.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(f=>parseInt(f)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),g(16,mu,13,9,"ng-template",null,0,V),a(),n(18,"content"),g(19,su,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,ru)),o(3),m("routerLink",b(9,lu)),o(3),m("routerLink",b(10,pu)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,Et,fe,Q],encapsulation:2})};var cu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],du=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],uu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function _u(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function gu(i,c){if(i&1&&(n(0,"div",13),I(1,"POS-pie-chart",14),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Jn=class i extends ne{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),g(16,_u,13,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,gu,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,cu)),o(3),m("routerLink",b(9,du)),o(3),m("routerLink",b(10,uu)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,fe],encapsulation:2})};var to=Qt(Oi());var fu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],Cu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],xu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],hu=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),Su=(i,c,e)=>({EntityIDs:i,From:c,To:e}),vi=(i,c)=>({"text-danger":i,"text-success":c}),yu=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Du=(i,c,e)=>({EntityID:i,From:c,To:e}),Ir=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),br=(i,c)=>({"text-success":i,"text-danger":c});function vu(i,c){if(i&1){let e=F();n(0,"a",12),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",13),p(2," Export "),a()}}function wu(i,c){if(i&1){let e=F();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),S("selectedOutletGroupIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),I(24,"i",23),a(),n(25,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),x("ngModel",e.pageData.Filter.TagIDs),o(3),m("showClear",!0),x("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption)}}function Tu(i,c){i&1&&(n(0,"th",55),p(1," Prev "),a())}function Pu(i,c){i&1&&(n(0,"th",56),p(1," Now "),a())}function Fu(i,c){i&1&&(n(0,"th",57),p(1," Orders "),a())}function Iu(i,c){i&1&&(n(0,"th",58),p(1," Qty "),a())}function bu(i,c){i&1&&(n(0,"th",59),p(1," Gross "),a())}function Eu(i,c){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function Mu(i,c){i&1&&(n(0,"th",61),p(1," Sales "),a())}function Vu(i,c){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function Bu(i,c){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function Ou(i,c){i&1&&(se(0),n(1,"th",64),p(2," Target "),a(),ce())}function Lu(i,c){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function Ru(i,c){if(i&1&&(se(0),g(1,Lu,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),ce()),i&2){let e=s(2);o(),m("ngIf",y(2,1,e.data.Data,"AchievementWithTax")||y(3,4,e.data.Data,"Achievement"))}}function ku(i,c){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function Wu(i,c){i&1&&(n(0,"th",68),p(1," Tax "),a())}function Nu(i,c){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Au(i,c){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function Gu(i,c){i&1&&(n(0,"th",71),p(1," Cost "),a())}function Hu(i,c){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Qu(i,c){i&1&&(n(0,"th",72),p(1," Expense "),a())}function Yu(i,c){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function ju(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,hu,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function qu(i,c){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(5,Su,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),T(y(3,2,e.Count,"1.0-0"))}}function Uu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function Ku(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function zu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function Xu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function Ju(i,c){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.AverageDailySales))}}function Zu(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.InventoryValue))}}function $u(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.RangeSalesTarget)," ")}}function e_(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;o(),m("ngClass",de(4,vi,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),v(" ",C(3,2,e.AchievementWithTax)," ")}}function t_(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,vi,e.Achievement<100,e.Achievement>100)),o(),v(" ",C(2,2,e.Achievement)," ")}}function i_(i,c){if(i&1&&(n(0,"td",70),g(1,e_,4,7,"ng-container",78)(2,t_,3,7,"ng-template",null,1,V),a()),i&2){let e=Ze(3),r=s(3);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function n_(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.SalesTarget))}}function a_(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function o_(i,c){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(11,yu))("queryParams",st(12,Du,e.EntityID,y(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),T(C(6,9,e.SalesWithTax))}}function r_(i,c){if(i&1&&(se(0),p(1),d(2,"number"),ce()),i&2){let e=s(2).$implicit;o(),v(" ",y(2,1,e.Increase,"1.0-0")," ")}}function l_(i,c){if(i&1&&p(0),i&2){let e=s(2).$implicit;v(" ",e.Increase," ")}}function p_(i,c){if(i&1&&(n(0,"td",79),g(1,r_,3,4,"ng-container",78)(2,l_,1,1,"ng-template",null,2,V),a()),i&2){let e=Ze(3),r=s().$implicit;m("ngClass",de(3,Ir,r.IsNegative,r.IsPositive)),o(),m("ngIf",r.Increase!=="-")("ngIfElse",e)}}function m_(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function s_(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;o(),m("ngClass",de(4,vi,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),v(" ",C(3,2,e.ProfitWithTax),"")}}function c_(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,vi,e.Profit<0,e.Profit>0)),o(),v(" ",C(2,2,e.Profit),"")}}function d_(i,c){if(i&1&&(n(0,"td",70),g(1,s_,4,7,"ng-container",78)(2,c_,3,7,"ng-template",null,3,V),a()),i&2){let e=Ze(3),r=s(3);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function u_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Expense)," ")}}function __(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),g(5,Yu,2,1,"td",73)(6,ju,2,5,"td",74)(7,qu,4,9,"td",43)(8,Uu,3,3,"td",43)(9,Ku,3,3,"td",43)(10,zu,3,4,"td",43)(11,Xu,3,3,"td",43)(12,Ju,4,3,"td",43)(13,Zu,4,3,"td",43)(14,$u,3,3,"td",43),se(15),g(16,i_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),ce(),g(19,n_,4,3,"td",43)(20,a_,3,3,"td",51)(21,o_,7,16,"td",43)(22,p_,4,6,"td",53)(23,m_,3,3,"td",54)(24,d_,4,2,"td",43)(25,u_,3,3,"td",43),d(26,"sum"),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),T(e.Name),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.column.Orders.selected),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.Gross.selected),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.Sales.selected),o(),m("ngIf",t.column.AvgDaily.selected),o(),m("ngIf",t.column.Inventory.selected),o(),m("ngIf",t.column.TargetDaily.selected),o(2),m("ngIf",y(17,20,t.data.Data,"AchievementWithTax")||y(18,23,t.data.Data,"Achievement")),o(3),m("ngIf",t.column.DailyTarget.selected),o(),m("ngIf",t.column.Tax.selected),o(),m("ngIf",t.column.SalesNTax.selected),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&y(26,26,t.data.Data,"Expense")!=0)}}function g_(i,c){i&1&&I(0,"td",50)}function f_(i,c){i&1&&I(0,"td",50)}function C_(i,c){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=s(2);o(2),v(" ",y(4,4,y(3,1,e.data.Data,"Count"),"1.0-0"),"")}}function x_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function h_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Gross"))," ")}}function S_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function y_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function D_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"AverageDailySales"))," ")}}function v_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"InventoryValue"))," ")}}function w_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function T_(i,c){if(i&1&&(se(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),ce()),i&2){let e=s(3);o(),m("ngClass",de(13,vi,y(2,2,e.data.Data,"AchievementWithTax")<100,y(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),v(" ",C(6,11,y(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function P_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,vi,y(1,2,e.data.Data,"Achievement")<100,y(2,5,e.data.Data,"Achievement")>100)),o(3),v(" ",C(5,11,y(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)),"")}}function F_(i,c){if(i&1&&(n(0,"td",70),g(1,T_,7,16,"ng-container",78)(2,P_,6,16,"ng-template",null,4,V),a()),i&2){let e=Ze(3),r=s(2);o(),m("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function I_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"SalesTarget"))," ")}}function b_(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function E_(i,c){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function M_(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Ir,e.comparation<0,e.comparation>0)),o(),v(" ",y(2,2,e.comparation,"1.0-0")," ")}}function V_(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function B_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,br,y(1,2,e.data.Data,"Profit")>0,y(2,5,e.data.Data,"Profit")<0)),o(3),T(C(5,11,y(4,8,e.data.Data,"Profit")))}}function O_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,br,y(1,2,e.data.Data,"ProfitWithTax")>0,y(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),v("",C(5,11,y(4,8,e.data.Data,"ProfitWithTax"))," ")}}function L_(i,c){if(i&1&&(n(0,"td",70),g(1,B_,6,16,"span",53)(2,O_,6,16,"span",53),a()),i&2){let e=s(2);o(),m("ngIf",e.pageData.IgnoreTax),o(),m("ngIf",!e.pageData.IgnoreTax)}}function R_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function k_(i,c){if(i&1){let e=F();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),g(8,Tu,2,0,"th",30)(9,Pu,2,0,"th",31)(10,Fu,2,0,"th",32)(11,Iu,2,0,"th",33)(12,bu,2,0,"th",34)(13,Eu,2,0,"th",35)(14,Mu,2,0,"th",36)(15,Vu,2,0,"th",37)(16,Bu,2,0,"th",38)(17,Ou,3,0,"ng-container",39)(18,Ru,4,7,"ng-container",39)(19,ku,2,0,"th",40)(20,Wu,2,0,"th",41)(21,Nu,2,1,"th",42)(22,Au,2,0,"th",43)(23,Gu,2,0,"th",44)(24,Hu,2,1,"th",42)(25,Qu,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),g(28,__,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),I(31,"td",48),g(32,g_,1,0,"td",49)(33,f_,1,0,"td",49),I(34,"td",50),g(35,C_,5,7,"td",43)(36,x_,4,6,"td",43)(37,h_,4,6,"td",43)(38,S_,4,7,"td",43)(39,y_,4,6,"td",43)(40,D_,4,6,"td",43)(41,v_,4,6,"td",43)(42,w_,4,6,"td",43),se(43),g(44,F_,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),ce(),g(47,I_,4,6,"td",43)(48,b_,4,6,"td",51)(49,E_,5,6,"td",52)(50,M_,3,8,"td",53)(51,V_,4,6,"td",54)(52,L_,3,2,"td",43)(53,R_,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=s();o(8),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.AvgDaily.selected),o(),m("ngIf",e.column.Inventory.selected),o(),m("ngIf",e.column.TargetDaily.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.DailyTarget.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(26,37,e.data.Data,"Expense")!=0),o(3),m("ngForOf",e.data.Data),o(4),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(2),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.AvgDaily.selected),o(),m("ngIf",e.column.Inventory.selected),o(),m("ngIf",e.column.TargetDaily.selected),o(2),m("ngIf",y(45,40,e.data.Data,"AchievementWithTax")||y(46,43,e.data.Data,"Achievement")),o(3),m("ngIf",e.column.DailyTarget.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(54,46,e.data.Data,"Expense")!=0)}}var Zn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=M.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);case"Expense":return this.compare(t.Expense,l.Expense,f);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,f);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,f);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,f);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,to.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,to.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(ee))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,vu,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,wu,26,16,"ng-template",null,0,V),a(),n(19,"content"),g(20,k_,55,49,"div",11),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,fu)),o(3),m("routerLink",b(11,Cu)),o(3),m("routerLink",b(12,xu)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,fe,yn,oe,ti,ie,ee,X,J],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var W_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],N_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],A_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],G_=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),Er=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function H_(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Q_(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),S("modelChange",function(t){u(e);let l=s();return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s();o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.isCompare)}}function Y_(i,c){i&1&&(n(0,"th",41),p(1," Prev "),a())}function j_(i,c){i&1&&(n(0,"th",42),p(1," Now "),a())}function q_(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function U_(i,c){i&1&&(n(0,"th",44),p(1," Cost "),a())}function K_(i,c){if(i&1&&(n(0,"th",26),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function z_(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function X_(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,G_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function J_(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Er,e.IsNegative,e.IsPositive)),o(),v(" ",C(2,2,e.Increase)," ")}}function Z_(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function $_(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function eg(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,z_,2,1,"td",45)(4,X_,2,5,"td",46),n(5,"td",35),p(6),d(7,"number"),a(),n(8,"td",35),p(9),d(10,"quantityFraction"),a(),n(11,"td",35),p(12),d(13,"amountFraction"),a(),n(14,"td",35),p(15),d(16,"amountFraction"),a(),n(17,"td",36),p(18),d(19,"amountFraction"),a(),n(20,"td",37),p(21),d(22,"amountFraction"),a(),g(23,J_,3,7,"td",38)(24,Z_,3,3,"td",39)(25,$_,3,3,"td",40),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(2),T(y(7,12,e.Count,".0-0")),o(3),T(C(10,15,e.Quantity)),o(3),T(C(13,17,e.Gross)),o(3),T(C(16,19,e.SalesNet)),o(3),v(" ",C(19,21,e.Tax)," "),o(3),v(" ",C(22,23,e.SalesWithTax)," "),o(2),m("ngIf",r.showCompareColumn&&r.roleService.report.Profit),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function tg(i,c){i&1&&I(0,"td",34)}function ig(i,c){i&1&&I(0,"td",34)}function ng(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Er,e.comparation,e.comparation)),o(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function ag(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function og(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",e.pageData.IgnoreTax?C(3,4,y(2,1,e.data==null?null:e.data.Data,"Profit")):C(5,9,y(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function rg(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Outlet"),a(),g(6,Y_,2,0,"th",20)(7,j_,2,0,"th",21),n(8,"th",22),p(9," Orders "),a(),n(10,"th",23),p(11," Quantity "),a(),n(12,"th",24),p(13," Gross "),a(),n(14,"th",25),p(15," Sales "),a(),n(16,"th",26),p(17," Tax "),a(),n(18,"th",27),p(19," Sales + Tax "),a(),g(20,q_,2,0,"th",28)(21,U_,2,0,"th",29)(22,K_,2,1,"th",30),a()(),n(23,"tbody"),g(24,eg,26,25,"tr",31),a(),n(25,"tfoot")(26,"tr",32),g(27,tg,1,0,"td",33)(28,ig,1,0,"td",33),I(29,"td",34),n(30,"td",35),p(31),d(32,"sum"),d(33,"number"),a(),n(34,"td",35),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),n(38,"td",35),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",35),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",36),p(47),d(48,"sum"),d(49,"amountFraction"),a(),n(50,"td",37)(51,"a"),p(52),d(53,"sum"),d(54,"amountFraction"),a()(),g(55,ng,3,8,"td",38)(56,ag,4,6,"td",39)(57,og,6,11,"td",40),a()()()()}if(i&2){let e=s();o(6),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(9),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),dt("altpropcond",e.pageData.IgnoreTax),o(2),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data==null?null:e.data.Data),o(3),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(3),v(" ",y(33,22,y(32,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),v(" ",C(37,28,y(36,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),v(" ",C(41,33,y(40,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),v(" ",C(45,38,y(44,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),v(" ",C(49,43,y(48,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),T(C(54,48,y(53,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}var $n=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[R],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],["style","width: 60px","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["style","width: 120px","arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,H_,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,Q_,13,5,"ng-template",null,0,V),a(),n(19,"content"),g(20,rg,58,50,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(9,W_)),o(3),m("routerLink",b(10,N_)),o(3),m("routerLink",b(11,A_)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,oe,ie,X,J],encapsulation:2})};var lg=()=>["/menu/Reports/Sales_Report/Standard/Compare"],pg=i=>({"flex-right":i});function mg(i,c){if(i&1){let e=F();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function sg(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function cg(i,c){if(i&1&&(n(0,"th",17),p(1),a()),i&2){let e=c.$implicit,r=c.index;dt("arrowPosition",r?"before":"after"),m("mat-sort-header",e)("ngClass",U(4,pg,e!="Outlet")),o(),v(" ",e,"")}}function dg(i,c){if(i&1&&(n(0,"div",20),p(1),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(r[e])}}function ug(i,c){if(i&1&&(n(0,"div",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),v("",C(2,1,r[e])," ")}}function _g(i,c){if(i&1&&(n(0,"td"),g(1,dg,2,1,"div",18)(2,ug,3,3,"div",19),a()),i&2){let e=c.$implicit;o(),m("ngIf",e=="Outlet"),o(),m("ngIf",e!="Outlet")}}function gg(i,c){if(i&1&&(n(0,"tr"),g(1,_g,3,2,"td",15),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngForOf",r.getKeys(e))}}function fg(i,c){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),T(C(2,1,e))}}function Cg(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,fg,3,3,"td",23),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.DataFooter)}}function xg(i,c){if(i&1){let e=F();n(0,"div",11)(1,"table",12),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr"),g(4,cg,2,6,"th",14),a()(),n(5,"tbody"),g(6,gg,2,1,"tr",15),a(),g(7,Cg,5,1,"tfoot",16),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var ea=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Years=M.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w])return this.compare(t[this.data.Dataheader[w]],l[this.data.Dataheader[w]],f)})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","arrowPosition","ngClass"],["style","color: black",4,"ngIf"],["style","color: black;text-align:right",4,"ngIf"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,mg,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),g(6,sg,10,5,"ng-template",null,0,V),a(),n(8,"content"),g(9,xg,8,3,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(7,lg)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,ae,ge,Ye,X],encapsulation:2})};var hg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Sg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],yg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Dg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],vg=(i,c)=>({From:i,To:c}),wg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],Tg=i=>({ID:i}),Pg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Fg=(i,c,e,r,t)=>({SalesPersonID:i,From:c,To:e,ListIDs:r,IncludeComplementary:t}),Ig=(i,c,e,r)=>({ID:i,from:c,to:e,IncludeComplementary:r}),bg=i=>({SalesID:i});function Eg(i,c){if(i&1){let e=F();n(0,"button",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export"),a()}}function Mg(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),x("ngModel",e.pageData.Filter.SalesGroupID),m("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),x("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Vg(i,c){i&1&&(n(0,"th",45),p(1," Sales Group"),a())}function Bg(i,c){i&1&&(n(0,"th",46),p(1," Orders"),a())}function Og(i,c){i&1&&(n(0,"th",47),p(1," Sales"),a())}function Lg(i,c){i&1&&(se(0),n(1,"th",48),p(2,"Avg. Daily"),a(),ce())}function Rg(i,c){i&1&&(n(0,"th",49),p(1,"Tax "),a())}function kg(i,c){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Wg(i,c){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Ng(i,c){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Ag(i,c){i&1&&(n(0,"th",55),p(1,"Target "),a())}function Gg(i,c){i&1&&(n(0,"th",56),p(1,"Ach(%) "),a())}function Hg(i,c){if(i&1&&(se(0),g(1,Ag,2,0,"th",53)(2,Gg,2,0,"th",54),ce()),i&2){let e=s(2);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function Qg(i,c){i&1&&(n(0,"th",57),p(1,"Quantity"),a())}function Yg(i,c){i&1&&(n(0,"th",58),p(1,"Basket Size"),a())}function jg(i,c){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function qg(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Group)}}function Ug(i,c){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(12,Pg))("queryParams",qi(13,Fg,e.ID,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),T(y(5,9,e.Orders,".0-0"))}}function Kg(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Sales))}}function zg(i,c){if(i&1&&(se(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.AvgDailySales))}}function Xg(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax),"")}}function Jg(i,c){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",qt(10,Ig,e.ID,y(2,2,r.pageData.Filter.From,"ddMMyyyy"),y(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),v(" ",C(5,8,e.SalesNTax)," ")}}function Zg(i,c){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Cost))}}function $g(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v("",C(2,1,e.Profit)," ")}}function e1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e.Target)," ")}}function t1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e.Achievement),"")}}function i1(i,c){if(i&1&&(se(0),g(1,e1,3,3,"td",44)(2,t1,3,3,"td",44),ce()),i&2){let e=s(3);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function n1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Quantity,"1.0-2")," ")}}function a1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function o1(i,c){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=s().$implicit;o(2),m("queryParams",U(4,bg,e.ID)),o(),T(C(4,2,e.Commission))}}function r1(i,c){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),g(4,qg,2,1,"td",9)(5,Ug,6,19,"td",40)(6,Kg,3,3,"td",41),d(7,"HideSumZero"),g(8,zg,4,3,"ng-container",9)(9,Xg,3,3,"td",42),d(10,"HideSumZero"),g(11,Jg,6,15,"td",40)(12,Zg,3,3,"td",43)(13,$g,3,3,"td",44)(14,i1,3,2,"ng-container",9)(15,n1,3,4,"td",41)(16,a1,3,4,"td",41)(17,o1,5,6,"td",41),a()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(21,wg))("queryParams",U(22,Tg,e.ID)),o(),T(e.Name),o(),m("ngIf",r.data.Show),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",y(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),m("ngIf",r.isShowOutletTarget),o(),m("ngIf",y(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),m("ngIf",r.column.SalesNTax.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),m("ngIf",r.isShowOutletTarget),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Commission.selected)}}function l1(i,c){i&1&&I(0,"td")}function p1(i,c){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),T(y(3,4,y(2,1,e.data.List,"Orders"),".0-0"))}}function m1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.List,"Sales")))}}function s1(i,c){if(i&1&&(se(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),ce()),i&2){let e=s(2);o(2),v(" ",C(4,4,y(3,1,e.data.List,"AvgDailySales"))," ")}}function c1(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"Tax"),e.pageData.FractionDigit),"")}}function d1(i,c){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v("",C(3,4,y(2,1,e.data.List,"SalesNTax"))," ")}}function u1(i,c){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Cost")),"")}}function _1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Profit")),"")}}function g1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.data.List,"Target")),"")}}function f1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(4,7,y(2,1,e.data.List,"Sales")/y(3,4,e.data.List,"Target")*100)," ")}}function C1(i,c){if(i&1&&(se(0),g(1,g1,4,6,"td",44)(2,f1,5,9,"td",44),ce()),i&2){let e=s(2);o(),m("ngIf",e.data.ShowSalesTarget),o(),m("ngIf",e.data.ShowSalesTarget)}}function x1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"Quantity"),"1.0-2"),"")}}function h1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.List,"BasketSize"),"1.0-2"),"")}}function S1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.List,"Commission")),"")}}function y1(i,c){if(i&1){let e=F();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),g(8,Vg,2,0,"th",27)(9,Bg,2,0,"th",28)(10,Og,2,0,"th",29),d(11,"HideSumZero"),g(12,Lg,3,0,"ng-container",9)(13,Rg,2,0,"th",30),d(14,"HideSumZero"),g(15,kg,2,0,"th",31)(16,Wg,2,0,"th",32)(17,Ng,2,0,"th",33)(18,Hg,3,2,"ng-container",9)(19,Qg,2,0,"th",34)(20,Yg,2,0,"th",35)(21,jg,2,0,"th",36),a()(),n(22,"tbody"),g(23,r1,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),g(26,l1,1,0,"td",9),n(27,"td",39),p(28,"Total:"),a(),g(29,p1,4,7,"td",40)(30,m1,4,6,"td",41),d(31,"HideSumZero"),g(32,s1,5,6,"ng-container",9)(33,c1,4,7,"td",42),d(34,"HideSumZero"),g(35,d1,4,6,"td",40)(36,u1,4,6,"td",43)(37,_1,4,6,"td",44)(38,C1,3,2,"ng-container",9)(39,x1,4,7,"td",41)(40,h1,4,7,"td",41)(41,S1,4,6,"td",41),a()()()()()()}if(i&2){let e=s();o(8),m("ngIf",e.data.Show),o(),m("ngIf",e.column.Orders.selected),o(),m("ngIf",y(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",y(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Commission.selected),o(2),m("ngForOf",e.data.List),o(3),m("ngIf",e.data.Show),o(3),m("ngIf",e.column.Orders.selected),o(),m("ngIf",y(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",y(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.isShowOutletTarget),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Commission.selected)}}var ta=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=f}isShowCommission=!1;roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission"},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return M.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,f);case"Target":return this.compare(t.Target,l.Target,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,f);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,f);case"Commission":return this.compare(t.Commission,l.Commission,f);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(Yt(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>et(Je({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Bo),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[R],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px;","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px;","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),g(3,Eg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,Mg,22,13,"ng-template",null,0,V),a(),g(25,y1,42,37,"content",9),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(3),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(18,hg)),o(3),m("routerLink",b(19,Sg)),o(3),m("routerLink",b(20,yg)),o(3),m("routerLink",b(21,Dg))("queryParams",de(22,vg,y(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,ae,ge,De,Q,oe,ti,ie,ee,X],encapsulation:2})};var D1=()=>["/menu/Reports/Sales_Report/Standard/Person"],v1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],w1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],T1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],P1=(i,c)=>({From:i,To:c}),Mr=i=>({ID:i}),Vr=(i,c,e,r)=>({SalesID:i,From:c,To:e,VariantName:r});function F1(i,c){if(i&1){let e=F();n(0,"a",17),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",18),p(2," Export "),a()}}function I1(i,c){if(i&1){let e=F();se(0),n(1,"div",24)(2,"div",25)(3,"datepicker",26),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",27)(5,"app-timepicker",28),S("timeChange",function(t){u(e);let l=s(3);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=s(3);return _(l.timeFromChange(t))}),a()()(),n(6,"div",29)(7,"div",25)(8,"datepicker",30),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"div",27)(10,"app-timepicker",28),S("timeChange",function(t){u(e);let l=s(3);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=s(3);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(3);o(3),m("width",100),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),m("width",100),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function b1(i,c){if(i&1){let e=F();n(0,"div")(1,"datepicker",31),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",32)(3,"datepicker",33),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(3);o(),x("date",e.pageData.Filter.From),m("width",100),o(2),x("date",e.pageData.Filter.To),m("width",100)}}function E1(i,c){if(i&1){let e=F();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),g(9,I1,11,6,"ng-container",22)(10,b1,4,4,"ng-template",null,1,V),n(12,"h6"),p(13,"Filter Invoice By"),a(),n(14,"radio-options",23),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=Ze(11),r=s(2);o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.ID),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),m("options",r.filterInvoiceBy),x("model",r.pageData.Filter.isCreated)}}function M1(i,c){i&1&&I(0,"app-empty-state")}function V1(i,c){i&1&&(n(0,"th",41),p(1," Commission "),a())}function B1(i,c){i&1&&(n(0,"th",41),p(1," Total Commission "),a())}function O1(i,c){if(i&1&&(n(0,"thead",36)(1,"tr",37)(2,"th",38)(3,"h2")(4,"a",39),p(5),a()()()(),n(6,"tr")(7,"th",40),p(8,"Product"),a(),n(9,"th",41),p(10,"Qty"),a(),n(11,"th",41),p(12,"Sales"),a(),g(13,V1,2,0,"th",42)(14,B1,2,0,"th",42),a()()),i&2){let e=s().$implicit,r=s(2);o(4),m("queryParams",U(5,Mr,e.ID)),o(),Xt("",e.Name," - ",e.Code,""),o(8),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function L1(i,c){if(i&1&&(n(0,"div")(1,"a",48),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,r=s(4);bi("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),m("queryParams",qt(14,Vr,e.SalesID,y(2,6,r.pageData.Filter.From,"ddMMyyyy"),y(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),T(C(5,12,e.VariantCommission))}}function R1(i,c){if(i&1&&(n(0,"div")(1,"a",49),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,r=s(4);o(),m("queryParams",qt(10,Vr,e.SalesID,y(2,2,r.pageData.Filter.From,"ddMMyyyy"),y(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),T(C(5,8,e.GroupCommission))}}function k1(i,c){if(i&1&&(n(0,"td",45),g(1,L1,6,19,"div",47)(2,R1,6,15,"div",14),a()),i&2){let e=s().$implicit;o(),m("ngIf",e.VariantCommission||!e.GroupCommission),o(),m("ngIf",e.GroupCommission)}}function W1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalCommission)," ")}}function N1(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",44),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",45),p(7),d(8,"quantityFraction"),a(),n(9,"td",45),p(10),d(11,"amountFraction"),a(),g(12,k1,3,2,"td",46)(13,W1,3,3,"td",46),a()),i&2){let e=c.$implicit,r=s(4);o(2),m("queryParams",U(11,Mr,e.VariantID)),o(),T(e.Name),o(2),T(e.Code),o(2),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.NettSales)),o(2),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function A1(i,c){if(i&1&&(n(0,"tbody"),g(1,N1,14,13,"tr",43),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Item)}}function G1(i,c){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",51),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=s(3).$implicit;bi("text-decoration-line-through",y(1,5,e.Item,"VariantCommission")&&y(2,8,e.Item,"GroupCommission"))("text-danger",y(3,11,e.Item,"VariantCommission")&&y(4,14,e.Item,"GroupCommission")),o(6),T(C(8,20,y(7,17,e.Item,"VariantCommission")))}}function H1(i,c){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3).$implicit;o(),v(" ",C(3,4,y(2,1,e.Item,"GroupCommission"))," ")}}function Q1(i,c){if(i&1&&(n(0,"td",45),g(1,G1,9,22,"div",47),d(2,"sum"),d(3,"sum"),g(4,H1,4,6,"div",14),d(5,"sum"),a()),i&2){let e=s(2).$implicit;o(),m("ngIf",y(2,2,e.Item,"VariantCommission")||!y(3,5,e.Item,"GroupCommission")),o(3),m("ngIf",y(5,8,e.Item,"GroupCommission"))}}function Y1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(3,4,y(2,1,e.Item,"TotalCommission"))," ")}}function j1(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",50)(2,"td"),p(3,"Total"),a(),n(4,"td",45),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",45),p(9),d(10,"sum"),d(11,"amountFraction"),a(),g(12,Q1,6,11,"td",46)(13,Y1,4,6,"td",46),a()()),i&2){let e=s().$implicit,r=s(2);o(5),v(" ",C(7,7,y(6,4,e.Item,"Quantity"))," "),o(4),v(" ",C(11,12,y(10,9,e.Item,"NettSales"))," "),o(3),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function q1(i,c){if(i&1&&(n(0,"table",34),g(1,O1,15,7,"thead",35)(2,A1,2,1,"tbody",14)(3,j1,14,14,"tfoot",14),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Name),o(),m("ngIf",e.Name),o(),m("ngIf",e.Name)}}function U1(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",3),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",4)(3,"a",5),P("click",function(){u(e);let t=s();return _(t.print())}),I(4,"i",6),p(5," Print"),a(),g(6,F1,3,0,"a",7),n(7,"div",8)(8,"button",9),p(9," More "),a(),n(10,"ul",10)(11,"li")(12,"a",11),p(13,"Summary"),a()(),n(14,"li")(15,"a",11),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",11),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",12),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,E1,15,9,"ng-template",null,0,V),a(),n(28,"content")(29,"div",13),g(30,M1,1,0,"app-empty-state",14),n(31,"div",15),g(32,q1,4,3,"table",16),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),o(6),m("routerLink",b(18,D1)),o(3),m("routerLink",b(19,v1)),o(3),m("routerLink",b(20,w1)),o(3),m("routerLink",b(21,T1))("queryParams",de(22,P1,y(22,12,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,15,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.length)==0),o(2),m("ngForOf",e.data.Data)}}var ia=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.activatedRoute=w}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[4,"ngIf"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[4,"ngIf","ngIfElse"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],["id","tableGrid",1,"table","border-bottom","mb-10"],["class","thead-light",4,"ngIf"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["style","width: 100px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"text-decoration-line-through","text-danger",4,"ngIf"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&g(0,U1,33,25,"mainpanel-cmp",2),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,K,B,L,pe,De,yi,Q,Ye,pr,oe,ee,X,J],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var K1=()=>["/menu/Reports/Sales_Report/Standard/Person"],z1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],X1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],J1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Z1=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],$1=i=>({ID:i});function ef(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function tf(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),x("ngModel",e.pageData.Filter.SalesID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function nf(i,c){i&1&&(n(0,"th",21),p(1," Commission "),a())}function af(i,c){i&1&&(n(0,"th",21),p(1," Total Commission "),a())}function of(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function rf(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.Total,r.pageData.FractionDigit)," ")}}function lf(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"date"),a(),n(4,"td"),p(5),a(),n(6,"td")(7,"a",35),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",26),p(14),d(15,"number"),a(),g(16,of,3,4,"td",36)(17,rf,3,4,"td",36),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(y(3,10,e.Date,"dd MMM yyyy")),o(3),T(e.EntityName),o(2),m("routerLink",b(15,Z1))("queryParams",U(16,$1,e.ID)),o(),T(e.Number),o(2),T(e.VariantName),o(2),T(e.SalesName),o(2),T(C(15,13,e.Quantity)),o(2),m("ngIf",r.roleService.product.CommissionView),o(),m("ngIf",r.roleService.product.CommissionView)}}function pf(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function mf(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function sf(i,c){if(i&1){let e=F();n(0,"span",39),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",40),p(2,"?"),a()()}}function cf(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function df(i,c){if(i&1){let e=F();n(0,"div",41)(1,"a",42),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(2,"i",43),p(3," Next"),a(),n(4,"a",44),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),I(5,"i",45),p(6," Show All"),a()()}}function uf(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),p(5,"Date"),a(),n(6,"th",20),p(7,"Outlet"),a(),n(8,"th",20),p(9,"Number"),a(),n(10,"th"),p(11,"Name"),a(),n(12,"th"),p(13,"Sales Person"),a(),n(14,"th",21),p(15,"Quantity"),a(),g(16,nf,2,0,"th",22)(17,af,2,0,"th",22),a()(),n(18,"tbody"),g(19,lf,18,18,"tr",23),a(),n(20,"tfoot")(21,"tr",24)(22,"td",25),p(23,"Total:"),a(),n(24,"td",26),p(25),d(26,"sum"),d(27,"number"),a(),g(28,pf,4,7,"td",27)(29,mf,4,7,"td",28),a()()(),n(30,"div",29)(31,"div",30)(32,"div",31),p(33),d(34,"number"),g(35,sf,3,0,"span",32)(36,cf,3,3,"span",33),p(37),a()(),g(38,df,7,0,"div",34),a()()),i&2){let e=s();o(16),m("ngIf",e.roleService.product.CommissionView),o(),m("ngIf",e.roleService.product.CommissionView),o(2),m("ngForOf",e.infiniteList),o(6),v(" ",C(27,14,y(26,11,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.CommissionView),o(),m("ngIf",e.roleService.product.CommissionView),o(4),v(" Showing 1 - ",C(34,16,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var na=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,f);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.roleService=w;this.matDialog=Ee}datasource=[];transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(q,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[R],decls:24,vars:14,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","120px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success","colspan","1",4,"ngIf"],["class","text-end text-success","colspan","2",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["class","btn-group",4,"ngIf"],["h","",3,"routerLink","queryParams"],["class","text-end text-success",4,"ngIf"],["colspan","1",1,"text-end","text-success"],["colspan","2",1,"text-end","text-success"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.VariantName,w)||(t.pageData.Filter.VariantName=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(w){return u(l),_(t.getFilterData(w))}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,ef,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),g(20,tf,13,7,"ng-template",null,0,V),a(),n(22,"content"),g(23,uf,39,18,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.VariantName),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,K1)),o(3),m("routerLink",b(11,z1)),o(3),m("routerLink",b(12,X1)),o(3),m("routerLink",b(13,J1)),o(6),m("ngIf",t.infiniteList))},dependencies:[N,Y,k,A,K,B,L,pe,Q,Ye,oe,ie,ee,J],encapsulation:2})};var Br=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Or=i=>({ID:i});function _f(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function gf(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",11)(16,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",14),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",17),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),o(2),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.IsDesc),m("options",e.AscDscRadio),o(3),m("items",e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("model",e.pageData.Filter.NoteVisible),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ff(i,c){if(i&1&&(n(0,"th",33),p(1),a()),i&2){let e=s(2);o(),v(" Cost(",e.data.Symbol,") ")}}function Cf(i,c){i&1&&(n(0,"th",34),p(1," Disc "),a())}function xf(i,c){if(i&1&&(n(0,"th",35),p(1),a()),i&2){let e=s(2);o(),v(" Total(",e.data.Symbol,") ")}}function hf(i,c){i&1&&(n(0,"span"),p(1," /"),a())}function Sf(i,c){if(i&1&&(n(0,"a",38)(1,"span",48),p(2),a()()),i&2){let e=s().$implicit;m("routerLink",b(3,Br))("queryParams",U(4,Or,e.Data.ID)),o(2),T("#"+e.PONumber)}}function yf(i,c){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitPrice)," ")}}function Df(i,c){if(i&1&&(n(0,"div",62),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;o(),v(" ",C(2,1,e==null?null:e.DiscountAmount)," ")}}function vf(i,c){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),g(3,Df,3,3,"div",61),a()),i&2){let e=s().$implicit;o(),v(" ",(e==null?null:e.Discount)==0?"":C(2,2,e==null?null:e.Discount)+"%"," "),o(2),m("ngIf",(e==null?null:e.DiscountAmount)>0)}}function wf(i,c){if(i&1&&(n(0,"th",63),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.Total)," ")}}function Tf(i,c){if(i&1&&(n(0,"tr")(1,"th",49)(2,"div",50)(3,"span"),p(4),a(),I(5,"small",51),a()(),n(6,"th",52),p(7),a(),n(8,"th",53),p(9),d(10,"quantityFraction"),a(),n(11,"th",54),p(12),d(13,"quantityFraction"),a(),n(14,"th",55),p(15),a(),g(16,yf,3,3,"th",56)(17,vf,4,4,"th",57)(18,wf,3,3,"th",58),a()),i&2){let e=c.$implicit,r=s(3);o(4),T(e==null?null:e.Name),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(10,9,e==null?null:e.QtyRequested)," "),o(3),v(" ",C(13,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost)}}function Pf(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",70),p(3),a(),n(4,"th",71),p(5),a(),n(6,"th",72),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e==null?null:e.CurrencySymbol," "),o(2),v(" ",C(8,3,e==null?null:e.Amount)," ")}}function Ff(i,c){if(i&1&&(n(0,"table",64),g(1,Pf,9,5,"ng-container",31),a()),i&2){let e=s(2).$implicit;o(),m("ngForOf",e==null?null:e.Aggregate)}}function If(i,c){if(i&1&&(n(0,"tfoot",64)(1,"tr",65)(2,"td",66),p(3,"Total"),a(),n(4,"td",67)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),I(9,"td",68),n(10,"td",69),g(11,Ff,2,1,"table",47),a()()()),i&2){let e=s().$implicit,r=s(2);o(6),T(C(8,5,y(7,2,e.Items,"Quantity"))),o(5),m("ngIf",r.roleService.product.Cost)}}function bf(i,c){if(i&1&&(n(0,"div")(1,"div",36)(2,"div",37)(3,"a",38)(4,"span",39),p(5),a()(),g(6,hf,2,0,"span",3)(7,Sf,3,6,"a",40),n(8,"span"),p(9),d(10,"date"),a(),I(11,"span",24),n(12,"strong",41),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),I(17,"small",42),a(),n(18,"div",43)(19,"label",44),p(20),a()()(),n(21,"table",45),I(22,"thead"),n(23,"tbody",46),g(24,Tf,19,13,"tr",31),a(),g(25,If,12,7,"tfoot",47),a()()),i&2){let e=c.$implicit,r=s(2);o(3),m("routerLink",b(22,Br))("queryParams",U(23,Or,e.Data.ID)),o(2),T(e.Data.EntityName+" #"+e.Data.Number),o(),m("ngIf",r.pageData.DualReceiptNumber),o(),m("ngIf",r.pageData.DualReceiptNumber),o(2),T(" - "+y(10,11,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),v(" ","[Q: "+y(14,14,e.Items,"Quantity")+", T: "+C(16,20,y(15,17,e.Items,"Total"))+"]"," "),o(4),m("innerHtml",e==null||e.Data==null?null:e.Data.Note,Pe),o(3),T(e.Data==null?null:e.Data.PaymentStateLabel),o(4),m("ngForOf",e.Items),o(),m("ngIf",r.roleService.product.Cost)}}function Ef(i,c){if(i&1&&(n(0,"div",75)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",70),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",70),p(11),d(12,"amountFraction"),a()()()),i&2){let e=s(3);o(5),T(C(6,2,e.data.Aggregate.TaxAdd)),o(6),T(C(12,4,e.data.Aggregate.PurchaseWithTax))}}function Mf(i,c){if(i&1&&(n(0,"div",75)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",70),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",70),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",70),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",70),p(23),d(24,"amountFraction"),a()()()),i&2){let e=s(3);o(5),T(C(6,4,e.data.Aggregate.Gross)),o(6),T(C(12,6,e.data.Aggregate.Discount)),o(6),T(C(18,8,e.data.Aggregate.TaxInclude)),o(6),T(C(24,10,e.data.Aggregate.NetPurchase))}}function Vf(i,c){if(i&1&&(n(0,"div",73),g(1,Ef,13,6,"div",74),n(2,"div",75)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",70),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",70),p(13),d(14,"quantityFraction"),a()()(),g(15,Mf,25,12,"div",74),a()),i&2){let e=s(2);o(),m("ngIf",e.roleService.product.Cost),o(6),T(C(8,4,e.data.Aggregate.TotalTransaction)),o(6),T(C(14,6,e.data.Aggregate.UnitQuantity)),o(2),m("ngIf",e.roleService.product.Cost)}}function Bf(i,c){if(i&1&&(n(0,"content")(1,"div",18)(2,"table",19)(3,"thead",20)(4,"tr")(5,"th",21),p(6,"Name"),a(),n(7,"th",22),p(8,"Code"),a(),n(9,"th",23)(10,"span",24),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",25),p(14,"Qty"),a(),n(15,"th",26),p(16,"UOM"),a(),g(17,ff,2,1,"th",27)(18,Cf,2,0,"th",28)(19,xf,2,1,"th",29),a()(),n(20,"tbody")(21,"tr")(22,"td",30),g(23,bf,26,25,"div",31),a()()()(),g(24,Vf,16,8,"div",32),a()()),i&2){let e=s();o(17),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(3),jt("colspan",e.roleService.product.Cost?8:6),o(),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var aa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=f;this.matDialog=w}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=M.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(ee),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],["class","red","style","width: 30px",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngIf"],[1,"px-0","border-bottom-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],["class","h5 text-primary fw-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","table table-sm table-borderless",4,"ngIf"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],["class","fw-normal border-start border-end text-end","style","width: 80px",4,"ngIf"],["class","fw-normal border-start border-end text-end text-danger","style","width: 30px",4,"ngIf"],["class","fw-normal border-start border-end text-end","style","width: 140px",4,"ngIf"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"row","justify-content-end"],["class","zebra col-auto",4,"ngIf"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_f,3,0,"button",2),a(),n(3,"filters"),g(4,gf,32,20,"ng-template",null,0,V),a(),g(6,Bf,25,6,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,De,Le,fe,Q,oe,ee,X,J],encapsulation:2})};var Lr=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],io=i=>({ID:i}),Of=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Lf(i,c){if(i&1){let e=F();n(0,"button",26),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",27),p(2," Export "),a()}}function Rf(i,c){if(i&1){let e=F();n(0,"div")(1,"div",28)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",29),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",30),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",31)(10,"datepicker",32),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",33),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",34),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",35),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",36),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s(2);o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.StateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.contactDisplay),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function kf(i,c){i&1&&(n(0,"th",37),p(1," Purchase "),a())}function Wf(i,c){i&1&&(n(0,"th",38),p(1," Tax "),a())}function Nf(i,c){i&1&&(n(0,"th",39),p(1," Total Amount "),a())}function Af(i,c){i&1&&(n(0,"th",40),p(1," Payment "),a())}function Gf(i,c){i&1&&I(0,"br")}function Hf(i,c){if(i&1&&(n(0,"a",41),p(1),a()),i&2){let e=s().$implicit;m("routerLink",b(3,Lr))("queryParams",U(4,io,e.PurchaseOrderID)),o(),T(e.PONumber)}}function Qf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function Yf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function jf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalAmount)," ")}}function qf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.PaymentAmount)," ")}}function Uf(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",41),p(5),a(),g(6,Gf,1,0,"br",42)(7,Hf,2,6,"a",43),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",41),p(13),a()(),n(14,"td",22),p(15),d(16,"quantityFraction"),a(),g(17,Qf,3,3,"td",23)(18,Yf,3,3,"td",24)(19,jf,3,3,"td",23)(20,qf,3,3,"td",23),n(21,"td"),p(22),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(25,Lr))("queryParams",U(26,io,e.ID)),o(),T(e.Number),o(),m("ngIf",r.pageData.DualNumber),o(),m("ngIf",r.pageData.DualNumber),o(2),T(y(10,20,e.Date,"dd MMM yyyy")),o(3),m("routerLink",b(28,Of))("queryParams",U(29,io,e.SupplierID)),o(),v(" ",e.SupplierNameDisplay," "),o(2),v(" ",C(16,23,e.TotalItemQuantity)," "),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),bi("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),v(" ",e.PaymentStateLabel," ")}}function Kf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function zf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function Xf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"TotalAmount"))," ")}}function Jf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"PaymentAmount"))," ")}}function Zf(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),S("textChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Lf,3,0,"button",3),a(),n(3,"filters"),g(4,Rf,23,14,"ng-template",null,0,V),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),g(22,kf,2,0,"th",13)(23,Wf,2,0,"th",14)(24,Nf,2,0,"th",15)(25,Af,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),g(29,Uf,23,31,"tr",18),a(),n(30,"tfoot")(31,"tr",19),I(32,"td",20),n(33,"td",21),p(34,"Total:"),a(),n(35,"td",22),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),g(39,Kf,4,6,"td",23)(40,zf,4,6,"td",24)(41,Xf,4,6,"td",23)(42,Jf,4,6,"td",23),I(43,"td",25),a()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(20),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(4),m("ngForOf",e.data.Data),o(7),v(" ",C(38,18,y(37,15,e.data.Data,"TotalItemQuantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost)}}var oa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=f;this.matDialog=w}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&M.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}preInitList(){M.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),M.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=M.MinDate),M.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}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 f=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"SupplierNameDisplay":return this.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),f);case"TotalItemQuantity":return this.compare(t.TotalItemQuantity,l.TotalItemQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"PaymentAmount":return this.compare(t.PaymentAmount,l.PaymentAmount,f);case"PaymentState":return this.compare(t.PaymentStateLabel,l.PaymentStateLabel,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Total","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentAmount","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"empty-column"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){r&1&&g(0,Zf,44,20,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,De,Le,Q,oe,ee,X,J],encapsulation:2})};var $f=()=>["/menu/Contacts/Contact/Suppliers/Info"],eC=i=>({ID:i}),tC=(i,c,e)=>({SupplierID:i,From:c,To:e}),iC=()=>["/menu/Reports/Purchases_Report/Summary"];function nC(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function aC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",10)(13,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function oC(i,c){i&1&&(n(0,"th",29),p(1," Purchase "),a())}function rC(i,c){if(i&1&&(n(0,"td",25)(1,"a",34),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(11,tC,e.SupplierID,y(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",b(15,iC)),o(3),T(C(5,9,e.Total))}}function lC(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),a(),n(3,"td",31)(4,"a",32),p(5),a()(),n(6,"td",25),p(7),a(),n(8,"td",33),p(9),d(10,"quantityFraction"),a(),g(11,rC,6,16,"td",26),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(9,$f))("queryParams",U(10,eC,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,7,e.Quantity)," "),o(2),m("ngIf",r.roleService.product.Cost)}}function pC(i,c){i&1&&(n(0,"th",25),p(1," Total Purchase "),a())}function mC(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(2,1,e.data.TotalSales)," ")}}function sC(i,c){if(i&1){let e=F();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Rank"),a(),n(8,"th",18),p(9,"Supplier"),a(),n(10,"th",19),p(11," Code "),a(),n(12,"th",20),p(13," Quantity "),a(),g(14,oC,2,0,"th",21),a()(),n(15,"tbody"),g(16,lC,12,12,"tr",22),a(),n(17,"tfoot")(18,"tr",23),I(19,"th",24),n(20,"th",25),p(21,"Total Quantity"),a(),g(22,pC,2,0,"th",26),a(),n(23,"tr"),I(24,"td",27),n(25,"td",25),p(26),d(27,"quantityFraction"),a(),g(28,mC,3,3,"td",26),a()()(),n(29,"POS-complex-pagination",28),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(6),m("ngIf",e.roleService.product.Cost),o(4),T(C(27,7,e.data.TotalQty)),o(2),m("ngIf",e.roleService.product.Cost),o(),m("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var ra=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["class","text-end",4,"ngIf"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,nC,3,0,"button",2),a(),n(3,"filters"),g(4,aC,17,11,"ng-template",null,0,V),a(),g(6,sC,30,9,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,bt,Q,ee,X,J],encapsulation:2})};var cC=i=>[i],dC=i=>({ID:i}),uC=(i,c,e,r)=>({VariantID:i,ProductID:c,From:e,To:r});function _C(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function gC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",11)(16,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.GroupByProduct),m("options",e.GroupByRadio),o(3),m("multiple",!1),x("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function fC(i,c){i&1&&(n(0,"th",31),p(1," Amount "),a())}function CC(i,c){i&1&&(n(0,"th",32),p(1," Avg Cost "),a())}function xC(i,c){if(i&1&&(n(0,"td",28)(1,"a",34),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",qt(4,uC,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),T(C(3,2,e.Total))}}function hC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.AvgPrice)," ")}}function SC(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",33),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",28),p(9),d(10,"number"),a(),n(11,"td",28),p(12),d(13,"quantityFraction"),a(),g(14,xC,4,9,"td",29)(15,hC,3,3,"td",29),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),m("routerLink",U(13,cC,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(15,dC,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(2),T(C(10,9,e.Order)),o(3),T(C(13,11,e.Quantity)),o(2),m("ngIf",t.roleService.product.Cost),o(),m("ngIf",t.roleService.product.Cost)}}function yC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Total"))," ")}}function DC(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"AvgPrice"))," ")}}function vC(i,c){if(i&1){let e=F();n(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18),P("matSortChange",function(t){u(e);let l=s();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",19),p(7,"No"),a(),n(8,"th"),p(9,"Name"),a(),n(10,"th",20),p(11,"Code"),a(),n(12,"th",21),p(13," Orders "),a(),n(14,"th",22),p(15," Quantity "),a(),g(16,fC,2,0,"th",23)(17,CC,2,0,"th",24),a()(),n(18,"tbody"),g(19,SC,16,17,"tr",25),a(),n(20,"tfoot")(21,"tr",26),I(22,"td")(23,"td",27),n(24,"td"),p(25,"Total :"),a(),n(26,"td",28),p(27),d(28,"sum"),d(29,"number"),a(),n(30,"td",28),p(31),d(32,"sum"),d(33,"quantityFraction"),a(),g(34,yC,4,6,"td",29)(35,DC,4,6,"td",29),a()()()(),n(36,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.infiniteList),o(8),v(" ",C(29,16,y(28,13,e.infiniteList,"Order"))," "),o(4),v(" ",C(33,21,y(32,18,e.infiniteList,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("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 la=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=Xa(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=Xa(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(q,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 140px","class","text-end","mat-sort-header","Total","arrowPosition","before",4,"ngIf"],["style","width: 120px","class","text-end","mat-sort-header","AvgPrice","arrowPosition","before",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Total","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","AvgPrice","arrowPosition","before",1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_C,3,0,"button",2),a(),n(3,"filters"),g(4,gC,23,15,"ng-template",null,0,V),a(),g(6,vC,37,23,"content",3),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,De,fe,Q,ii,oe,ie,X,J],encapsulation:2})};var wC=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],pa=i=>({ID:i}),TC=()=>["/menu/Products/Catalog/Variants/Info"],PC=()=>["/menu/Contacts/Contact/Suppliers/Info"],FC=()=>["/menu/Products/Catalog/Products/Info"];function IC(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function bC(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID),m("inputTextValue",e.pageData.ProductName)}}function EC(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function MC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()(),g(11,bC,4,2,"div",3)(12,EC,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),x("model",e.pageData.Filter.ByProduct),m("options",e.ScopeRadio),o(),m("ngIf",e.pageData.Filter.ByProduct),o(),m("ngIf",!e.pageData.Filter.ByProduct),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.OrderByNumber),m("options",e.OrderByRadio),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("multiple",!1),x("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function VC(i,c){i&1&&(n(0,"th",38),p(1,"Date"),a())}function BC(i,c){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function OC(i,c){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function LC(i,c){i&1&&(n(0,"th"),p(1," Supplier "),a())}function RC(i,c){i&1&&(n(0,"th"),p(1,"Product"),a())}function kC(i,c){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function WC(i,c){i&1&&(n(0,"th",40),p(1," Qty "),a())}function NC(i,c){i&1&&(n(0,"th",41),p(1," Measurement "),a())}function AC(i,c){i&1&&(n(0,"th",42),p(1," Cost "),a())}function GC(i,c){i&1&&(n(0,"th",43),p(1," Total Cost "),a())}function HC(i,c){i&1&&(n(0,"th",40),p(1," Item(%) "),a())}function QC(i,c){i&1&&(n(0,"th",44),p(1," Item Disc "),a())}function YC(i,c){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function jC(i,c){i&1&&(n(0,"th",44),p(1," Bill Disc "),a())}function qC(i,c){if(i&1&&(n(0,"th",45),p(1),a()),i&2){let e=s(2);o(),v(" Total(",e.data.CurrencySymbol,") ")}}function UC(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Date,"dd MMM yyyy")," ")}}function KC(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.EntityName)}}function zC(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryStatus," ")}}function XC(i,c){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,PC))("queryParams",U(4,pa,e.SupplierID)),o(),T(e.SupplierName)}}function JC(i,c){if(i&1&&(n(0,"td")(1,"a",47),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,FC))("queryParams",U(4,pa,e.ProductID)),o(),T(e.Name)}}function ZC(i,c){if(i&1&&I(0,"td",50),i&2){let e=s().$implicit;m("innerHTML",e.Note,Pe)}}function $C(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function ex(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.VariantUnitQuantity)," ")}}function tx(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitPrice)," ")}}function ix(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SumUnitPrice)," ")}}function nx(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Discount>0?e.Discount:""," ")}}function ax(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",e.ItemDiscountAmount>0?C(2,1,e.ItemDiscountAmount):""," ")}}function ox(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DiscountInvoice>0?e.DiscountInvoice:""," ")}}function rx(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.OrderDiscountAmount>0?e.OrderDiscountAmount:""," ")}}function lx(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Total)," ")}}function px(i,c){if(i&1&&(n(0,"tr",46),g(1,UC,3,4,"td",3)(2,KC,2,1,"td",3),n(3,"td")(4,"a",47),p(5),a()(),g(6,zC,2,1,"td",3)(7,XC,3,6,"td",3)(8,JC,3,6,"td",3),n(9,"td")(10,"a",47),p(11),a()(),g(12,ZC,1,1,"td",48)(13,$C,3,3,"td",35)(14,ex,3,3,"td",35)(15,tx,3,3,"td",49)(16,ix,3,3,"td",49)(17,nx,2,1,"td",35)(18,ax,3,3,"td",35)(19,ox,2,1,"td",35)(20,rx,2,1,"td",35)(21,lx,3,3,"td",35),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Outlet.selected),o(2),m("routerLink",b(21,wC))("queryParams",U(22,pa,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",r.column.Fulfillment.selected),o(),m("ngIf",r.column.Supplier.selected),o(),m("ngIf",r.pageData.Filter.ByProduct),o(2),m("routerLink",b(24,TC))("queryParams",U(25,pa,e.VariantID)),o(),T(e.Model),o(),m("ngIf",r.column.ItemNote.selected),o(),m("ngIf",r.column.Qty.selected),o(),m("ngIf",(e==null||e.Data==null?null:e.Data.VariantQuantity)>1),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.TotalCost.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Total.selected)}}function mx(i,c){i&1&&I(0,"td",34)}function sx(i,c){i&1&&I(0,"td",34)}function cx(i,c){i&1&&I(0,"td",34)}function dx(i,c){i&1&&I(0,"td",34)}function ux(i,c){i&1&&(n(0,"td",51),p(1," Total : "),a())}function _x(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function gx(i,c){i&1&&I(0,"td",34)}function fx(i,c){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Total"))," ")}}function Cx(i,c){if(i&1){let e=F();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),g(6,VC,2,0,"th",22)(7,BC,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),g(10,OC,2,0,"th",24)(11,LC,2,0,"th",3)(12,RC,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),g(15,kC,2,0,"th",3)(16,WC,2,0,"th",25)(17,NC,2,0,"th",26)(18,AC,2,0,"th",27)(19,GC,2,0,"th",28)(20,HC,2,0,"th",25)(21,QC,2,0,"th",29)(22,YC,2,0,"th",25)(23,jC,2,0,"th",29)(24,qC,2,1,"th",30),a()(),n(25,"tbody"),g(26,px,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),g(29,mx,1,0,"td",33)(30,sx,1,0,"td",33)(31,cx,1,0,"td",33)(32,dx,1,0,"td",33),I(33,"td",34),g(34,ux,2,0,"td",35)(35,_x,4,6,"td",35)(36,gx,1,0,"td",33)(37,fx,4,6,"td",36),a()()()(),n(38,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Outlet.selected),o(3),m("ngIf",e.column.Fulfillment.selected),o(),m("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),m("ngIf",e.pageData.Filter.ByProduct),o(3),m("ngIf",e.column.ItemNote.selected),o(),m("ngIf",e.column.Qty.selected),o(),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.TotalCost.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(2),m("ngForOf",e.data.Data),o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Outlet.selected),o(),m("ngIf",e.column.Fulfillment.selected),o(),m("ngIf",e.column.Supplier.selected),o(2),m("ngIf",e.column.Qty.selected||e.column.Total.selected),o(),m("ngIf",e.column.Qty.selected),o(),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),o(),m("ngIf",e.roleService.product.Cost&&e.column.Total.selected),o(),m("total",e.data.Data.length)("pageData",e.pageData)}}var ma=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=f;this.matDialog=w}columnService=Ge(vt);column={Date:{selected:!0},Outlet:{selected:!0},Fulfillment:{selected:!1},Supplier:{selected:!0},ItemNote:{selected:!1,name:"Item Note"},Qty:{selected:!0,name:"Qty"},Cost:{selected:!0,name:"Cost"},TotalCost:{selected:!1,name:"Total Cost"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},Total:{selected:!0,name:"Total (RP)"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=e.From??this.pageData.Filter.From,this.pageData.Filter.To=e.To??this.pageData.Filter.To,this.pageData.Filter.VariantID=M.IsNotEmpty(e.VariantID)?e.VariantID:M.GuidEmpty,this.pageData.Filter.ProductID=M.IsNotEmpty(e.ProductID)?e.ProductID:M.GuidEmpty,this.pageData.Filter.ByProduct=M.IsNotEmpty(e.ProductID),M.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Cost for one quantity before discount",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end","title","Cost multiplied by quantity after discount",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],["title","Cost for one quantity before discount",1,"text-end",2,"width","75px"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],[1,"text-end",2,"width","70px"],["title","Cost multiplied by quantity after discount",1,"text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,IC,3,0,"button",2),a(),n(3,"filters"),g(4,MC,28,18,"ng-template",null,0,V),a(),g(6,Cx,39,26,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,De,Le,bt,Q,oe,ee,X,J],encapsulation:2})};var xx=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function hx(i,c){if(i&1){let e=F();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Sx(i,c){if(i&1){let e=F();n(0,"div")(1,"div",7)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio)}}function yx(i,c){i&1&&(n(0,"th",18),p(1," Purchases "),a())}function Dx(i,c){if(i&1&&(n(0,"td",18),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.PurchaseTotal)," ")}}function vx(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",18),p(5),d(6,"number"),a(),n(7,"td",18),p(8),d(9,"quantityFraction"),a(),g(10,Dx,3,3,"td",19),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(y(3,4,e.Date,"EEEE")),o(3),T(C(6,7,e.Day)),o(3),T(C(9,9,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost)}}function wx(i,c){if(i&1&&(n(0,"td",18),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"PurchaseTotal"))," ")}}function Tx(i,c){if(i&1&&(n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",18),p(9,"Date (Day)"),a(),n(10,"th",18),p(11,"Quantity"),a(),g(12,yx,2,0,"th",19),a()(),n(13,"tbody"),g(14,vx,11,11,"tr",20),a(),n(15,"tr")(16,"td",21),p(17,"Total"),a(),n(18,"td",18),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),g(22,wx,4,6,"td",19),a()()()()()),i&2){let e=s();o(12),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(5),v(" ",C(21,7,y(20,4,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost)}}var sa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=M.GenerateYears(w.getFullYear(),11,!0),this.Months=M.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[R],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-end"],[1,"border-bottom"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,hx,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),g(6,Sx,20,14,"ng-template",null,0,V),a(),g(8,Tx,23,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,xx)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,B,L,pe,De,fe,Q,oe,ie,ee,X,J],encapsulation:2})};var Px=()=>["/menu/Reports/Purchases_Report/Daily"];function Fx(i,c){if(i&1){let e=F();n(0,"button",13),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",14),p(2," Export "),a()}}function Ix(i,c){if(i&1){let e=F();n(0,"div")(1,"div",15)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",17),S("selectedCategoryIDChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",20),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio),o(3),x("ngModel",e.pageData.Filter.SupplierID)}}function bx(i,c){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function Ex(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Income)," ")}}function Mx(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),g(6,Ex,3,3,"td",9),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.MonthLabel),o(2),T(C(5,3,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost)}}function Vx(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Income"))," ")}}function Bx(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Fx,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),g(6,Ix,20,13,"ng-template",null,0,V),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),g(17,bx,2,0,"th",9),a()(),n(18,"tbody"),g(19,Mx,7,5,"tr",10),a(),n(20,"tr",11)(21,"td",12),p(22,"Total"),a(),n(23,"td",8),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),g(27,Vx,4,6,"td",9),a()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(),m("routerLink",b(15,Px)),o(14),m("ngIf",e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(5),v(" ",C(26,13,y(25,10,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost)}}var ca=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=M.GenerateYears(w.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=M.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"border-bottom"]],template:function(r,t){r&1&&g(0,Bx,28,16,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,B,L,pe,De,Le,fe,Q,oe,X,J],encapsulation:2})};function Ox(i,c){if(i&1){let e=F();n(0,"div")(1,"div",3)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",4),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",5),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years)}}function Lx(i,c){if(i&1&&(n(0,"content")(1,"div",7),I(2,"POS-line-chart",8),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var da=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=M.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=M.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[R],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),I(1,"actions"),n(2,"filters"),g(3,Ox,11,8,"ng-template",null,0,V),a(),g(5,Lx,3,2,"content",2),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(5),m("ngIf",t.data))},dependencies:[N,k,z,B,L,Et,fe,Q],encapsulation:2})};var Rx=()=>["/menu/Products/Catalog/Products/Info"],kx=i=>({ID:i});function Wx(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export"),a()}}function Nx(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",10)(13,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2),x("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Ax(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td")(4,"a",23),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"quantityFraction"),a(),n(14,"td",25),p(15),d(16,"number"),a()()),i&2){let e=c.$implicit,r=c.index;o(2),T(r+1),o(2),m("routerLink",b(14,Rx))("queryParams",U(15,kx,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(2),T(C(10,8,e.PurchaseQuantity)),o(3),T(C(13,10,e.SellQuantity)),o(3),T(C(16,12,e.Ratio))}}function Gx(i,c){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th",17),p(7," Now "),a(),n(8,"th",18),p(9,"Name"),a(),n(10,"th",19),p(11,"Code"),a(),n(12,"th",20),p(13,"Purchase"),a(),n(14,"th",20),p(15,"Sold"),a(),n(16,"th",20),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),g(19,Ax,17,17,"tr",21),a()()()()()),i&2){let e=s();o(19),m("ngForOf",e.data.Data)}}var ua=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wx,3,0,"button",2),a(),n(3,"filters"),g(4,Nx,17,10,"ng-template",null,0,V),a(),g(6,Gx,20,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,ke,B,L,Qe,fe,Q,ie,J],encapsulation:2})};var Hx=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],Qx=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Yx=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),jx=(i,c,e)=>({EntityID:i,From:c,To:e}),qx=()=>["/menu/Reports/Purchases_Report/Summary"];function Ux(i,c){if(i&1){let e=F();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Kx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",15),S("modelChange",function(t){u(e);let l=s(2);return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("model",e.isCompare)}}function zx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",16),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",17)(6,"datepicker",18),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Xx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",19)(4,"div",20)(5,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Year=null)}),a()(),n(6,"div",22)(7,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=s(2);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function Jx(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.YearMonthToDateRange())}),a(),g(10,Kx,4,1,"div",7)(11,zx,7,2,"div",7)(12,Xx,8,4,"div",7),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",14),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),x("model",e.IsPredefined),m("options",e.RadioDateFilterType),o(),m("ngIf",e.IsPredefined),o(),m("ngIf",!e.IsPredefined),o(),m("ngIf",e.IsPredefined),o(3),x("model",e.pageData.Filter.ExcludeComplementary)}}function Zx(i,c){i&1&&(n(0,"th",43),p(1," Prev "),a())}function $x(i,c){i&1&&(n(0,"th",44),p(1," Now "),a())}function eh(i,c){i&1&&(n(0,"th",45),p(1," Orders "),a())}function th(i,c){i&1&&(n(0,"th",46),p(1," Purchase "),a())}function ih(i,c){if(i&1&&(n(0,"th",47),p(1," Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function nh(i,c){if(i&1&&(n(0,"th",48),p(1," Purchase + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function ah(i,c){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function oh(i,c){if(i&1&&(n(0,"td",50),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,Yx,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function rh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",y(2,1,e.Count,".0-0")," ")}}function lh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function ph(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function mh(i,c){if(i&1&&(n(0,"td",41)(1,"a",52),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("queryParams",st(11,jx,e.EntityID,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",b(15,qx)),o(4),T(C(6,9,e.SalesWithTax))}}function sh(i,c){if(i&1&&(n(0,"tr")(1,"td",38),p(2),a(),g(3,ah,2,1,"td",40)(4,oh,2,5,"td",49)(5,rh,3,4,"td",40),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),g(9,lh,3,3,"td",40)(10,ph,3,3,"td",42),d(11,"HideSumZero"),g(12,mh,7,16,"td",40),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",!r.data.WithCategory),o(2),T(C(8,8,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",!r.data.WithCategory&&y(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost),o(2),m("ngIf",!r.data.WithCategory&&r.roleService.product.Cost)}}function ch(i,c){i&1&&I(0,"td",53)}function dh(i,c){i&1&&I(0,"td",53)}function uh(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function _h(i,c){if(i&1&&(n(0,"td",41),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function gh(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function fh(i,c){if(i&1&&(n(0,"td",41)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function Ch(i,c){if(i&1){let e=F();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Outlet"),a(),g(8,Zx,2,0,"th",29)(9,$x,2,0,"th",30)(10,eh,2,0,"th",31),n(11,"th",32),p(12," Qty "),a(),g(13,th,2,0,"th",33)(14,ih,2,1,"th",34),d(15,"HideSumZero"),g(16,nh,2,1,"th",35),a()(),n(17,"tbody"),g(18,sh,13,13,"tr",36),a(),n(19,"tfoot")(20,"tr",37),I(21,"td",38),g(22,ch,1,0,"td",39)(23,dh,1,0,"td",39)(24,uh,4,7,"td",40),n(25,"td",41),p(26),d(27,"sum"),d(28,"quantityFraction"),a(),g(29,_h,4,6,"td",40)(30,gh,4,6,"td",42),d(31,"HideSumZero"),g(32,fh,5,6,"td",40),a()()()()()()}if(i&2){let e=s();o(8),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",!e.data.WithCategory&&y(15,14,e.data.Data,"Tax")&&e.roleService.product.Cost),o(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost),o(2),m("ngForOf",e.data.Data),o(4),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(2),v(" ",C(28,20,y(27,17,e.data.Data,"Quantity"))," "),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",!e.data.WithCategory&&y(31,22,e.data.Data,"Tax")&&e.roleService.product.Cost),o(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost)}}var _a=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=M.GenerateYears(w.getFullYear(),11,!0),this.Year=w.getFullYear(),this.Month=w.getMonth()+1,this.Months=M.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Count":return M.compare(t.Count,l.Count,f);case"SalesWithTax":return M.compare(t.SalesWithTax,l.SalesWithTax,f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"SalesNet":return M.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return M.compare(t.Sales,l.Sales,f);case"Tax":return M.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[R],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above","style","width: 100px","class","text-end",4,"ngIf"],["style","width: 100px","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","flex-right","style","width: 100px",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before","style","width: 100px","class","flex-right",4,"ngIf"],["style","width: 100px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],["style","width: 150px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"queryParams","routerLink"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Ux,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Jx,16,10,"ng-template",null,0,V),a(),g(16,Ch,33,25,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Hx)),o(3),m("routerLink",b(9,Qx)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,fe,oe,ti,ie,ee,X,J],encapsulation:2})};var xh=()=>["/menu/Reports/Purchases_Report/Outlet"],hh=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Sh=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),yh=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function Dh(i,c){if(i&1){let e=F();n(0,"button",27),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",28),p(2," Export"),a()}}function vh(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",32),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",33)(6,"datepicker",34),S("dateChange",function(t){u(e);let l=s(3);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),ce()}if(i&2){let e=s(3);o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function wh(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",35)(4,"div",36)(5,"ng-select",37),S("ngModelChange",function(t){u(e);let l=s(3);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Year=null)}),a()(),n(6,"div",38)(7,"ng-select",39),S("ngModelChange",function(t){u(e);let l=s(3);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(3);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function Th(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",40),S("modelChange",function(t){u(e);let l=s(3);return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),ce()}if(i&2){let e=s(3);o(3),x("model",e.isCompare)}}function Ph(i,c){if(i&1){let e=F();n(0,"div")(1,"div",29)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",30),S("modelChange",function(t){u(e);let l=s(2);return h(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),g(5,vh,7,2,"ng-container",25)(6,wh,8,4,"ng-container",25),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",31),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),g(10,Th,4,1,"ng-container",25),a()()}if(i&2){let e=s(2);o(4),x("model",e.IsPredefined),m("options",e.RadioDateFilterType),o(),m("ngIf",!e.IsPredefined),o(),m("ngIf",e.IsPredefined),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),m("ngIf",e.IsPredefined)}}function Fh(i,c){i&1&&(n(0,"th",41),p(1,"Prev"),a())}function Ih(i,c){i&1&&(n(0,"th",42),p(1,"Now"),a())}function bh(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function Eh(i,c){if(i&1&&(n(0,"td",24),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PrevIndex," ")}}function Mh(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,Sh,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function Vh(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",de(5,yh,e.IsNegative,e.IsPositive)),o(),v(" ",y(2,2,e.Increase,".0-0")," ")}}function Bh(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Eh,2,1,"td",44)(4,Mh,2,5,"td",45),n(5,"td",24),p(6),d(7,"number"),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"amountFraction"),a(),g(14,Vh,3,8,"td",46),n(15,"td",26),p(16),d(17,"amountFraction"),a(),n(18,"td",24),p(19),d(20,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Name),o(),m("ngIf",r.showCompareColumn),o(),m("ngIf",r.showCompareColumn),o(2),T(y(7,9,e.Count,".0-0")),o(3),T(C(10,12,e.Quantity)),o(3),T(C(13,14,e.Sales)),o(2),m("ngIf",r.showCompareColumn),o(2),T(C(17,16,e.Tax)),o(3),v(" ",C(20,18,e.SalesWithTax)," ")}}function Oh(i,c){i&1&&I(0,"td",23)}function Lh(i,c){i&1&&I(0,"td",23)}function Rh(i,c){i&1&&I(0,"td")}function kh(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Dh,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Ph,11,7,"ng-template",null,0,V),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),g(23,Fh,2,0,"th",12)(24,Ih,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),g(31,bh,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),g(37,Bh,21,20,"tr",20),a(),n(38,"tfoot")(39,"tr",21),g(40,Oh,1,0,"td",22)(41,Lh,1,0,"td",22),I(42,"td",23),n(43,"td",24),p(44),d(45,"sum"),d(46,"number"),a(),n(47,"td",24),p(48),d(49,"sum"),d(50,"quantityFraction"),a(),n(51,"td",24),p(52),d(53,"sum"),d(54,"amountFraction"),a(),g(55,Rh,1,0,"td",25),n(56,"td",26),p(57),d(58,"sum"),d(59,"amountFraction"),a(),n(60,"td",24)(61,"a"),p(62),d(63,"sum"),d(64,"amountFraction"),a()()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(6),m("routerLink",b(47,xh)),o(3),m("routerLink",b(48,hh)),o(12),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(7),m("ngIf",e.showCompareColumn),o(),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),m("ngForOf",e.data==null?null:e.data.Data),o(3),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(3),T(y(46,24,y(45,21,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),T(C(50,30,y(49,27,e.data==null?null:e.data.Data,"Quantity"))),o(4),v(" ",C(54,35,y(53,32,e.data==null?null:e.data.Data,"Sales"))," "),o(3),m("ngIf",e.showCompareColumn),o(2),v(" ",C(59,40,y(58,37,e.data==null?null:e.data.Data,"Tax"))," "),o(5),T(C(64,45,y(63,42,e.data==null?null:e.data.Data,"SalesWithTax")))}}var ga=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=M.GenerateYears(w.getFullYear(),11,!0),this.Year=w.getFullYear(),this.Month=w.getMonth(),this.Months=M.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"SalesNet":return this.compare(t.Sales,l.Sales,f);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["style","width: 100px;","class","text-end",4,"ngIf"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&g(0,kh,65,49,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,oe,ie,X,J],encapsulation:2})};var Wh=()=>["/menu/Reports/Purchases_Report/Outlet"],Nh=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function Ah(i,c){if(i&1){let e=F();n(0,"button",14),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",15),p(2," Export"),a()}}function Gh(i,c){if(i&1){let e=F();n(0,"div")(1,"div",16)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=s(2);o(4),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Hh(i,c){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function Qh(i,c){if(i&1&&(n(0,"p",21),p(1),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(r[e])}}function Yh(i,c){if(i&1&&(n(0,"p",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s().$implicit;o(),T(C(2,1,r[e]))}}function jh(i,c){if(i&1&&(n(0,"td"),g(1,Qh,2,1,"p",20)(2,Yh,3,3,"p",20),a()),i&2){let e=c.$implicit;o(),m("ngIf",e=="Outlet"),o(),m("ngIf",e!="Outlet")}}function qh(i,c){if(i&1&&(n(0,"tr"),g(1,jh,3,2,"td",12),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngForOf",r.getKey(e))}}function Uh(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),T(C(2,1,e))}}function Kh(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,Uh,3,3,"td",12),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.DataFooter)}}function zh(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Ah,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),g(14,Gh,8,4,"ng-template",null,0,V),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),g(21,Hh,2,2,"th",11),a()(),n(22,"tbody"),g(23,qh,2,1,"tr",12),a(),g(24,Kh,5,1,"tfoot",13),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(2),m("ngIf",e.roleService.global.Export),o(6),m("routerLink",b(10,Wh)),o(3),m("routerLink",b(11,Nh)),o(10),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var fa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Years=M.GenerateYears(w.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,f)=>{let w=e.direction==="asc";for(let Ee=0;Ee<this.data.Dataheader.length;Ee++)if(e.active==this.data.Dataheader[Ee])return typeof l[this.data.Dataheader[Ee]]=="string"?t(l[this.data.Dataheader[Ee]].toLocaleLowerCase(),f[this.data.Dataheader[Ee]].toLocaleLowerCase(),w):t(l[this.data.Dataheader[Ee]],f[this.data.Dataheader[Ee]],w)});function t(l,f,w){return(l<f?-1:1)*(w?1:-1)}}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[3,"mat-sort-header"],["style","color: black;",4,"ngIf"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&g(0,zh,25,12,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,z,B,L,ae,ge,X],encapsulation:2})};var Xh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Jh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Zh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],$h=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],eS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],tS=i=>({ID:i});function iS(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function nS(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=s();o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(4),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function aS(i,c){if(i&1&&(n(0,"a",30),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,tS,e.CityID)),o(),T(e.CityName)}}function oS(i,c){if(i&1&&(se(0),p(1),ce()),i&2){let e=s().$implicit;o(),v(" ",e.CityName," ")}}function rS(i,c){if(i&1&&(n(0,"tr"),I(1,"td",27),n(2,"td"),g(3,aS,2,4,"a",28)(4,oS,2,1,"ng-container",7),a(),I(5,"td",29),d(6,"number"),I(7,"td",29),d(8,"number"),I(9,"td",29),d(10,"number"),a()),i&2){let e=c.$implicit;o(),m("innerHtml",e.CityCode,Pe),o(2),m("ngIf",e.CityID),o(),m("ngIf",!e.CityID),o(),m("innerHtml",C(6,6,e.Quantity),Pe),o(2),m("innerHtml",C(8,8,e.Total),Pe),o(2),m("innerHtml",C(10,10,e.Average),Pe)}}function lS(i,c){if(i&1){let e=F();n(0,"content")(1,"div",16)(2,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",18)(4,"tr")(5,"th",19),p(6,"Code"),a(),n(7,"th",20),p(8," Regional Name "),a(),n(9,"th",21),p(10," Quantity "),a(),n(11,"th",22),p(12," Total "),a(),n(13,"th",23),p(14," Avg. Price "),a()()(),n(15,"tbody"),g(16,rS,11,12,"tr",24),a(),n(17,"tfoot")(18,"tr",25),I(19,"td",26),n(20,"td",26),p(21,"Total :"),a(),n(22,"td",26),p(23),d(24,"sum"),d(25,"quantityFraction"),a(),n(26,"td",26),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",26),p(31),d(32,"sum"),d(33,"sum"),d(34,"amountFraction"),a()()()()()()}if(i&2){let e=s();o(16),m("ngForOf",e.data.List),o(7),v(" ",C(25,7,y(24,4,e.data.List,"Quantity"))," "),o(4),v(" ",C(29,12,y(28,9,e.data.List,"Total"))," "),o(4),v(" ",C(34,20,y(32,14,e.data.List,"Total")/y(33,17,e.data.List,"Quantity"))," ")}}var Ca=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,f);case"CityName":return this.compare(t.CityName,l.CityName,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Average":return this.compare(t.Average,l.Average,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[R],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams",4,"ngIf"],[1,"text-end",3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,iS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,nS,13,6,"ng-template",null,0,V),a(),g(25,lS,35,22,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Xh)),o(3),m("routerLink",b(12,Jh)),o(3),m("routerLink",b(13,Zh)),o(3),m("routerLink",b(14,$h)),o(3),m("routerLink",b(15,eS)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,fe,oe,ie,X,J],encapsulation:2})};var pS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],mS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],sS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],cS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],dS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function uS(i,c){if(i&1){let e=F();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function _S(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function gS(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function fS(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function CS(i,c){if(i&1&&(I(0,"td",34),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.Cost),Pe)}}function xS(i,c){if(i&1&&(I(0,"td",31),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.Profit),Pe)}}function hS(i,c){if(i&1&&(n(0,"tr"),I(1,"td",29)(2,"td",30),d(3,"number"),I(4,"td",30),d(5,"quantityFraction"),I(6,"td",30),d(7,"amountFraction"),I(8,"td",31),d(9,"amountFraction"),g(10,CS,2,3,"td",32)(11,xS,2,3,"td",33),a()),i&2){let e=c.$implicit,r=s(2);o(),m("innerHtml",e.GroupName,Pe),o(),m("innerHtml",C(3,7,e.Count),Pe),o(2),m("innerHtml",C(5,9,e.Quantity),Pe),o(2),m("innerHtml",C(7,11,e.Gross),Pe),o(2),m("innerHtml",C(9,13,e.Sales),Pe),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function SS(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.Data,"Cost")))}}function yS(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),T(C(3,4,y(2,1,e.data.Data,"Profit")))}}function DS(i,c){if(i&1){let e=F();n(0,"content")(1,"div",15)(2,"div",16)(3,"table",17),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",18)(5,"tr")(6,"th",19),p(7,"Group Name"),a(),n(8,"th",20),p(9,"Orders"),a(),n(10,"th",21),p(11,"Quantity"),a(),n(12,"th",21),p(13,"Gross"),a(),n(14,"th",21),p(15,"Sales"),a(),g(16,gS,2,0,"th",22)(17,fS,2,0,"th",22),a()(),n(18,"tbody"),g(19,hS,12,15,"tr",23),a(),n(20,"tfoot")(21,"tr",24),I(22,"td",25),n(23,"td",25),p(24),d(25,"sum"),d(26,"number"),a(),n(27,"td",25),p(28),d(29,"sum"),d(30,"quantityFraction"),a(),n(31,"td",25),p(32),d(33,"sum"),d(34,"amountFraction"),a(),n(35,"td",26),p(36),d(37,"sum"),d(38,"amountFraction"),a(),g(39,SS,4,6,"td",27)(40,yS,4,6,"td",28),a()()()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(5),T(C(26,12,y(25,9,e.data.Data,"Count"))),o(4),T(C(30,17,y(29,14,e.data.Data,"Quantity"))),o(4),T(C(34,22,y(33,19,e.data.Data,"Gross"))),o(4),T(C(38,27,y(37,24,e.data.Data,"Sales"))),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}var xa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,f);case"Trans":return this.compare(t.Trans,l.Trans,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[R],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],["class","text-end text-danger",3,"innerHtml",4,"ngIf"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-danger",3,"innerHtml"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,uS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,_S,9,5,"ng-template",null,0,V),a(),g(25,DS,41,29,"content",7),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,pS)),o(3),m("routerLink",b(12,mS)),o(3),m("routerLink",b(13,sS)),o(3),m("routerLink",b(14,cS)),o(3),m("routerLink",b(15,dS)),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,Q,oe,ie,X,J],encapsulation:2})};var vS=()=>["/menu/Reports/Sales_Report/Standard/Person"],wS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],TS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],PS=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],FS=(i,c)=>({From:i,To:c});function IS(i,c){if(i&1){let e=F();n(0,"a",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export "),a()}}function bS(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ES(i,c){i&1&&(n(0,"th",22),p(1,"Profit"),a())}function MS(i,c){if(i&1&&(I(0,"td",32),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.ActualProfit),Pe)}}function VS(i,c){if(i&1&&(n(0,"tr"),I(1,"td",29)(2,"td",30),d(3,"number"),I(4,"td",30),d(5,"amountFraction"),I(6,"td",30),d(7,"amountFraction"),I(8,"td",30),g(9,MS,2,3,"td",31),a()),i&2){let e=c.$implicit,r=s(2);o(),m("innerHtml",e.Name,Pe),o(),m("innerHtml",C(3,6,e.InvoiceCount),Pe),o(2),m("innerHtml",C(5,8,e.NetRevenue),Pe),o(2),m("innerHtml",C(7,10,e.SalesTarget),Pe),o(2),m("innerHtml",e.Percentage+"%",Pe),o(),m("ngIf",r.roleService.report.Profit)}}function BS(i,c){if(i&1&&(n(0,"td",27),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"ActualProfit")),"")}}function OS(i,c){if(i&1){let e=F();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22),p(15,"Percentage"),a(),g(16,ES,2,0,"th",23),a()(),n(17,"tbody"),g(18,VS,10,12,"tr",24),a(),n(19,"tfoot")(20,"tr",25),I(21,"td",26)(22,"td",26),n(23,"td",27),p(24),d(25,"sum"),d(26,"amountFraction"),a(),I(27,"td",26)(28,"td",26),g(29,BS,4,6,"td",28),a()()()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(6),T(C(26,7,y(25,4,e.data.Data,"GrossRevenue"))),o(5),m("ngIf",e.roleService.report.Profit)}}var ha=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[R],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end ",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2),g(3,IS,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,bS,9,5,"ng-template",null,0,V),a(),g(25,OS,30,9,"content",9),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(3),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(17,vS)),o(3),m("routerLink",b(18,wS)),o(3),m("routerLink",b(19,TS)),o(3),m("routerLink",b(20,PS))("queryParams",de(21,FS,y(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,Q,oe,ie,ee,X],encapsulation:2})};var LS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],RS=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],kS=i=>({ID:i});function WS(i,c){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&m("routerLink",b(1,LS))}function NS(i,c){if(i&1){let e=F();n(0,"a",6),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function AS(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),x("date",e.pageData.Filter.From),o(3),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function GS(i,c){if(i&1&&I(0,"th",41),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function HS(i,c){if(i&1&&(I(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",C(2,5,_i(1,1,t.data.Compenents,r,e)),Pe)}}function QS(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),g(19,HS,3,7,"td",45),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(17,RS))("queryParams",U(18,kS,e.ID)),o(),T(e.Number),o(2),T(e.Name),o(2),T(e.TaxName),o(2),T(y(12,10,e.Date,"dd MMM yyyy")),o(3),T(C(15,13,e.Sales)),o(3),v(" ",C(18,15,e.Tax)," "),o(2),m("ngForOf",r.getComponent(r.data))}}function YS(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e.SumTaxAmount)," ")}}function jS(i,c){if(i&1){let e=F();n(0,"span",48),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function qS(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function US(i,c){if(i&1){let e=F();n(0,"a",50),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",51),p(2," Next"),a()}}function KS(i,c){if(i&1){let e=F();n(0,"a",52),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),I(1,"i",53),p(2," Show All"),a()}}function zS(i,c){if(i&1){let e=F();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),g(20,GS,1,1,"th",28),a()(),n(21,"tbody"),g(22,QS,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),I(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),g(34,YS,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),g(40,jS,3,0,"span",37)(41,qS,3,3,"span",4),p(42),a()(),n(43,"div",38),g(44,US,3,0,"a",39)(45,KS,3,0,"a",40),a()()()()}if(i&2){let e=s();o(20),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.infiniteList),o(5),v(" ",C(29,14,y(28,11,e.infiniteList,"Sales"))," "),o(4),v(" ",C(33,19,y(32,16,e.infiniteList,"Tax"))," "),o(3),m("ngForOf",e.data.Compenents),o(4),v(" Showing 1 - ",C(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Sa=class i extends dn{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}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)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[R],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,WS,2,2,"a",2)(3,NS,3,0,"a",3),a(),n(4,"filters"),g(5,AS,18,10,"ng-template",null,0,V),a(),g(7,zS,46,23,"content",4),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,oe,xi,ie,ee,X],encapsulation:2})};var XS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function JS(i,c){if(i&1){let e=F();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function ZS(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function $S(i,c){i&1&&(n(0,"th",26),p(1,"Total Tax"),a())}function ey(i,c){if(i&1&&I(0,"th",27),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function ty(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),T(y(2,1,e.Tax,r.pageData.FractionDigit))}}function iy(i,c){if(i&1&&(I(0,"td",27),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",y(2,5,_i(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Pe)}}function ny(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",28),p(4),d(5,"number"),a(),g(6,ty,3,4,"td",29)(7,iy,3,8,"td",30),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),T(y(5,4,e.Sales,r.pageData.FractionDigit)),o(2),m("ngIf",r.data.Compenents.length==0),o(),m("ngForOf",r.getComponent(e))}}function ay(i,c){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit),"")}}function oy(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function ry(i,c){if(i&1){let e=F();n(0,"div",13)(1,"table",14),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",15)(3,"tr")(4,"th",16),p(5,"Outlet"),a(),n(6,"th",17),p(7,"Sales"),a(),g(8,$S,2,0,"th",18)(9,ey,1,1,"th",19),a()(),n(10,"tbody"),g(11,ny,8,7,"tr",20),a(),n(12,"tfoot")(13,"tr",21),I(14,"td",22),n(15,"td",23),p(16),d(17,"sum"),d(18,"number"),a(),g(19,ay,4,7,"td",24)(20,oy,3,4,"td",25),a()()()()}if(i&2){let e=s();o(8),m("ngIf",e.data.Compenents.length==0),o(),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.data.Data),o(5),T(y(18,9,y(17,6,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),m("ngIf",e.data.Compenents.length==0),o(),m("ngForOf",e.data.Compenents)}}var ya=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[R],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["style","width: 150px","class","text-end flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 150px","class","text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),g(4,JS,3,0,"a",3),a(),n(5,"filters"),g(6,ZS,12,8,"ng-template",null,0,V),a(),n(8,"content"),g(9,ry,21,12,"div",4),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(8,XS)),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,ae,ge,Q,oe,xi,ie],encapsulation:2})};var ly=()=>["/menu/Products/Catalog/Variants/Info"],py=i=>({ID:i});function my(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function sy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID)}}function cy(i,c){i&1&&(n(0,"th",25),p(1," Category "),a())}function dy(i,c){i&1&&(n(0,"th",26),p(1,"Code"),a())}function uy(i,c){i&1&&(n(0,"th",27),p(1," Release Date "),a())}function _y(i,c){i&1&&(n(0,"th",28),p(1," Days Count "),a())}function gy(i,c){i&1&&(n(0,"th",29),p(1," Last Sold "),a())}function fy(i,c){i&1&&(n(0,"th",30),p(1," Last Purchased "),a())}function Cy(i,c){i&1&&(n(0,"th",31),p(1," Qty "),a())}function xy(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Category)}}function hy(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Sy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.Released?y(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function yy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",e.DaysCount!=null?C(2,1,e.DaysCount):"-"," ")}}function Dy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.LastSold?y(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function vy(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.LastPurchased?y(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function wy(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function Ty(i,c){if(i&1&&(n(0,"tr",32),g(1,xy,2,1,"td",3),n(2,"td")(3,"a",33),p(4),a()(),g(5,hy,2,1,"td",3)(6,Sy,3,4,"td",3)(7,yy,3,3,"td",3)(8,Dy,3,4,"td",3)(9,vy,3,4,"td",3)(10,wy,3,3,"td",34),a()),i&2){let e=c.$implicit,r=s(2);o(),m("ngIf",r.column.Category.selected),o(2),m("routerLink",b(10,ly))("queryParams",U(11,py,e.ID)),o(),T(e.Name),o(),m("ngIf",r.column.Code.selected),o(),m("ngIf",r.column.ReleaseDate.selected),o(),m("ngIf",r.column.DaysCount.selected),o(),m("ngIf",r.column.LastSold.selected),o(),m("ngIf",r.column.LastPurchased.selected),o(),m("ngIf",r.column.QTY.selected)}}function Py(i,c){if(i&1){let e=F();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),g(5,cy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),g(8,dy,2,0,"th",18)(9,uy,2,0,"th",19)(10,_y,2,0,"th",20)(11,gy,2,0,"th",21)(12,fy,2,0,"th",22)(13,Cy,2,0,"th",23),a()(),n(14,"tbody"),g(15,Ty,11,13,"tr",24),a()()()()}if(i&2){let e=s();o(5),m("ngIf",e.column.Category.selected),o(3),m("ngIf",e.column.Code.selected),o(),m("ngIf",e.column.ReleaseDate.selected),o(),m("ngIf",e.column.DaysCount.selected),o(),m("ngIf",e.column.LastSold.selected),o(),m("ngIf",e.column.LastPurchased.selected),o(),m("ngIf",e.column.QTY.selected),o(2),m("ngForOf",e.data)}}var Da=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",f);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=f}roleService=Ge(G);columnService=Ge(vt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc",w=typeof t[e.active];switch(M.IsEmpty(t.Code)&&(t.Code=""),M.IsEmpty(l.Code)&&(l.Code=""),M.IsEmpty(t.Released)&&(t.Release=""),M.IsEmpty(l.Released)&&(l.Release=""),M.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),M.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),M.IsEmpty(t.LastSold)&&(t.LastSold=""),M.IsEmpty(l.LastSold)&&(l.LastSold=""),w){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),f);case"number":return this.compare(t[e.active],l[e.active],f);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e}openExportModal(){this.matDialog.open(q,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,my,3,0,"a",2),a(),n(3,"filters"),g(4,sy,15,8,"ng-template",null,0,V),a(),g(6,Py,16,8,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,fe,Q,Ye,ie,ee,J],encapsulation:2})};function Fy(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function Iy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function by(i,c){i&1&&(n(0,"th",22),p(1,"Total Cost"),a())}function Ey(i,c){i&1&&(n(0,"th",22),p(1,"Total profit "),a())}function My(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalCost))}}function Vy(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalProfit))}}function By(i,c){if(i&1&&(n(0,"tr",26)(1,"td",27),p(2),a(),n(3,"td",27),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",28),p(10),d(11,"quantityFraction"),a(),n(12,"td",28),p(13),d(14,"quantityFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),g(18,My,3,3,"td",29)(19,Vy,3,3,"td",30),n(20,"td",28),p(21),d(22,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.PrevRank||"-"),o(2),T(e.Rank),o(2),T(e.Name),o(2),T(e.Code),o(2),T(C(11,10,e.Quantity)),o(3),T(C(14,12,e.OnHand)),o(3),T(C(17,14,e.TotalAmount)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(2),T(C(22,16,e.Margin))}}function Oy(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data,"TotalCost")))}}function Ly(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data,"TotalProfit")))}}function Ry(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",32),I(2,"td",33),n(3,"td",34),p(4,"Total:"),a(),n(5,"td",34),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",34),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",34),p(14),d(15,"sum"),d(16,"amountFraction"),a(),g(17,Oy,4,6,"td",35)(18,Ly,4,6,"td",35),a()()),i&2){let e=s(2);o(6),T(C(8,8,y(7,5,e.data,"Quantity"))),o(4),T(C(12,13,y(11,10,e.data,"OnHand"))),o(4),T(C(16,18,y(15,15,e.data,"TotalAmount"))),o(3),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}function ky(i,c){if(i&1){let e=F();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Prev"),a(),n(8,"th",18),p(9,"Now"),a(),n(10,"th",19),p(11,"Name"),a(),n(12,"th",20),p(13,"Code"),a(),n(14,"th",18),p(15,"Sold"),a(),n(16,"th",21),p(17,"On Hand"),a(),n(18,"th",22),p(19,"Total Amount"),a(),g(20,by,2,0,"th",23)(21,Ey,2,0,"th",23),n(22,"th",24),p(23,"%"),a()()(),n(24,"tbody"),g(25,By,23,18,"tr",25),a(),g(26,Ry,19,20,"tfoot",3),a()()()()}if(i&2){let e=s();o(20),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(4),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.length>0)}}var va=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(q,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["style","width: 200px","class","text-end",4,"ngIf"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Fy,3,0,"a",2),a(),n(3,"filters"),g(4,Iy,18,10,"ng-template",null,0,V),a(),g(6,ky,27,4,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,pe,ae,ge,Qe,Le,fe,Q,oe,X,J],encapsulation:2})};var Wy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ny=i=>({ID:i});function Ay(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function Gy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Hy(i,c){if(i&1&&(n(0,"tr",16)(1,"td")(2,"a",17),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Wy))("queryParams",U(12,Ny,e.ID)),o(),T(e.InvoiceNumber),o(2),T(e.Name),o(2),T(e.Code),o(2),T(C(10,7,e.Quantity)),o(3),T(C(13,9,e.Price))}}function Qy(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),g(16,Hy,14,14,"tr",15),a()()()()),i&2){let e=s();o(16),m("ngForOf",e.data.Data)}}var wa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}openExportModal(){this.matDialog.open(q,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Ay,3,0,"a",2),a(),n(3,"filters"),g(4,Gy,12,7,"ng-template",null,0,V),a(),g(6,Qy,17,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,fe,Q,X,J],encapsulation:2})};function Yy(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function jy(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",13),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID)}}function qy(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",14),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);o(3),x("ngModel",e.pageData.Filter.ProductID)}}function Uy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",9)(8,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",11),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),g(12,jy,4,1,"div",3)(13,qy,4,1,"div",3),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.SearchBy),m("options",e.RadioSearchBy),o(),m("ngIf",e.pageData.Filter.SearchBy),o(),m("ngIf",!e.pageData.Filter.SearchBy),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Ky(i,c){if(i&1&&(n(0,"tr",22)(1,"td",23),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",23),p(6),d(7,"quantityFraction"),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;o(2),T(e.Rank),o(2),T(e.Name),o(2),T(C(7,4,e.Quantity)),o(3),T(C(10,6,e.OnHand))}}function zy(i,c){if(i&1&&(n(0,"content")(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Rank"),a(),n(7,"th",19),p(8,"Name"),a(),n(9,"th",20),p(10,"Sold"),a(),n(11,"th",20),p(12,"Inventory"),a()()(),n(13,"tbody"),g(14,Ky,11,8,"tr",21),a()()()()),i&2){let e=s();o(14),m("ngForOf",e.data.Data)}}var Ta=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.toastrService=w}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(q,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yy,3,0,"a",2),a(),n(3,"filters"),g(4,Uy,17,11,"ng-template",null,0,V),a(),g(6,zy,15,1,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,Qe,De,Le,Q,J],encapsulation:2})};var Xy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Jy=i=>({ID:i});function Zy(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function $y(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function e2(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",22),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",17),p(14),d(15,"quantityFraction"),a(),n(16,"td",17),p(17),d(18,"amountFraction"),a(),n(19,"td",23),p(20),a(),n(21,"td",17),p(22),d(23,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(e.EntityName),o(2),m("routerLink",b(20,Xy))("queryParams",U(21,Jy,e.InvoiceID)),o(),T(e.Number),o(2),T(y(8,11,e.Date,"dd MMM yyyy")),o(3),T(e.Name),o(2),T(e.Code),o(2),v("(",C(15,14,e.Quantity),")"),o(3),T(C(18,16,e.UnitPrice)),o(3),v("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),v("(",C(23,18,e.Total),")")}}function t2(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",16),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",17),p(17,"Quantity"),a(),n(18,"th",17),p(19),a(),n(20,"th",18),p(21,"%"),a(),n(22,"th",17),p(23),a()()(),n(24,"tbody"),g(25,e2,24,23,"tr",19),a(),n(26,"tfoot")(27,"tr",20),I(28,"td",21)(29,"td",21)(30,"td",21)(31,"td",21)(32,"td",21),n(33,"td",17),p(34),d(35,"sum"),d(36,"quantityFraction"),a(),I(37,"td",21)(38,"td",21),n(39,"td",17),p(40),d(41,"sum"),d(42,"amountFraction"),a()()()()()()()),i&2){let e=s();o(19),v("Price (",e.data.CurrencySymbol,")"),o(4),v("Total(",e.data.CurrencySymbol,")"),o(2),m("ngForOf",e.data.Data),o(9),T(C(36,8,y(35,5,e.data.Data,"Quantity"))),o(6),T(C(42,13,y(41,10,e.data.Data,"Total")))}}var Pa=class i extends ne{constructor(e,r,t,l,f,w){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}month;year;openExportModal(){this.matDialog.open(q,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Zy,3,0,"a",2),a(),n(3,"filters"),g(4,$y,12,6,"ng-template",null,0,V),a(),g(6,t2,43,15,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,Le,Q,oe,ee,X,J],encapsulation:2})};var i2=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],n2=i=>({ID:i});function a2(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function o2(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function r2(i,c){i&1&&(n(0,"th",16),p(1,"Unit Cost"),a())}function l2(i,c){if(i&1&&(I(0,"td",43),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",C(1,1,e.UnitPrice),Pe)}}function p2(i,c){if(i&1&&(n(0,"tr",35)(1,"td",36),I(2,"span",37),a(),I(3,"td",38),n(4,"td",39),p(5),d(6,"quantityFraction"),a(),I(7,"td",40),g(8,l2,2,3,"td",41),n(9,"td",42),p(10),d(11,"amountFraction"),a(),I(12,"td",43),d(13,"amountFraction"),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("innerHtml",e.Name,Pe),o(),m("innerHtml",e.Code,Pe),o(2),v("(",C(6,7,e.Quantity),")"),o(2),m("innerHtml",e.UOMName,Pe),o(),m("ngIf",r.roleService.product.Cost),o(2),v(" ",e.Discount==0?"":"-"+C(11,9,e.Discount)+"%",""),o(2),m("innerHtml",C(13,11,e.Total),Pe)}}function m2(i,c){i&1&&(n(0,"td",31),p(1,"\xA0"),a())}function s2(i,c){if(i&1&&(n(0,"div")(1,"div",21)(2,"a",22),I(3,"span",23),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),I(9,"span",24),n(10,"div",25)(11,"div")(12,"table",26),I(13,"thead"),n(14,"tbody"),g(15,p2,14,13,"tr",27),a()()()(),n(16,"table",28)(17,"thead")(18,"tr",29)(19,"td",30),p(20,"Total"),a(),n(21,"td",31),p(22,"\xA0"),a(),n(23,"td",16),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),I(27,"td",32),g(28,m2,2,0,"td",33),n(29,"td",34),p(30,"\xA0"),a(),n(31,"td",16),p(32),d(33,"sum"),d(34,"amountFraction"),a()()()()()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(28,i2))("queryParams",U(29,n2,e.InvoiceID)),o(),m("innerHtml",e.EntityName+" #"+e.Number+" - "+y(4,9,e.Date,"dd MMM yyyy")+" ("+y(5,12,e.Created,"HH:mm")+")",Pe),o(4),v(" ",y(8,15,e.CustomerNameDisplay," - {0}")," "),o(2),m("innerHtml",e.Note,Pe),o(6),m("ngForOf",e.Item),o(9),v("",C(26,21,y(25,18,e.Item,"Quantity")),"\xA0"),o(4),m("ngIf",r.roleService.product.Cost),o(4),v("",C(34,26,y(33,23,e.Item,"Total")),"\xA0 ")}}function c2(i,c){if(i&1&&(n(0,"content")(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",15),p(8,"Code"),a(),n(9,"th",16),p(10,"Quantity"),a(),n(11,"th",17),p(12,"UOM"),a(),g(13,r2,2,0,"th",18),n(14,"th",19),p(15,"%"),a(),n(16,"th",16),p(17,"Total(Rp.)"),a()()()(),g(18,s2,35,31,"div",20),a()()),i&2){let e=s();o(13),m("ngIf",e.roleService.product.Cost),o(5),m("ngForOf",e.data.Data)}}var Fa=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=M.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],["style","width: 10%","class","text-end",4,"ngIf"],[2,"width","5%"],[4,"ngFor","ngForOf"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],["class","border-top",4,"ngFor","ngForOf"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],["style","width: 10%","class","empty-column",4,"ngIf"],[1,"empty-column",2,"width","5%"],[1,"border-top"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],["class","text-end border-start border-end","style","width: 10%;",3,"innerHtml",4,"ngIf"],[1,"small","text-danger","border-start","border-end",2,"width","5%"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,a2,3,0,"a",2),a(),n(3,"filters"),g(4,o2,12,6,"ng-template",null,0,V),a(),g(6,c2,19,2,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,Le,Q,oe,gn,ee,X,J],encapsulation:2})};var d2=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],u2=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Rr=i=>({ID:i});function _2(i,c){if(i&1){let e=F();n(0,"a",5),P("click",function(){u(e);let t=s();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),I(1,"i",6),p(2," Export"),a()}}function g2(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.RowCount),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("inputTextValue",e.pageData.Filter.ProductName),x("ngModel",e.pageData.Filter.ProductID),o(3),m("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),x("ngModel",e.pageData.Filter.VariantID)}}function f2(i,c){i&1&&(se(0),n(1,"th",34),p(2," Batch Number "),a(),ce())}function C2(i,c){i&1&&(n(0,"th",35),p(1," Cost "),a())}function x2(i,c){if(i&1&&(se(0),n(1,"td"),p(2),a(),ce()),i&2){let e=s().$implicit;o(2),T(e.SerialBatchNumber)}}function h2(i,c){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",y(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function S2(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",36),p(8),a()(),g(9,x2,3,1,"ng-container",24),n(10,"td")(11,"div",37)(12,"a",38),p(13),a(),n(14,"small",39),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",40),p(19),d(20,"number"),a(),g(21,h2,3,4,"td",41),n(22,"td",40),p(23),d(24,"number"),a(),n(25,"td",40),p(26),d(27,"number"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.Outlet),o(2),T(y(5,16,e.Date,"dd MMM yy")),o(3),m("routerLink",b(27,u2))("queryParams",U(28,Rr,e.InvoiceID)),o(),T(e.Number),o(),m("ngIf",r.showBatchNumber),o(3),m("queryParams",U(30,Rr,e.CustomerID)),o(),T(e.CustomerName),o(),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),T(e.Code),o(2),T(e.SalesPerson),o(2),Xt(" ",C(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),m("ngIf",r.roleService.product.Cost),o(2),v(" ",y(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),v(" ",y(27,24,e.Total,r.pageData.FractionDigit)," ")}}function y2(i,c){i&1&&I(0,"td",45)}function D2(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td",43),p(3," Total: "),a(),n(4,"td",40),p(5),d(6,"sum"),d(7,"number"),a(),g(8,y2,1,0,"td",44),I(9,"td",45),n(10,"td",40),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=s(2);o(2),m("colSpan",e.showBatchNumber?6:5),o(3),T(C(7,7,y(6,4,e.data.Data,"Quantity"))),o(3),m("ngIf",e.roleService.product.Cost),o(3),v(" ",y(13,12,y(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function v2(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5," Outlet "),a(),n(6,"th",22),p(7," Date "),a(),n(8,"th",23),p(9," Invoice # "),a(),g(10,f2,3,0,"ng-container",24),n(11,"th",25),p(12,"Customer"),a(),n(13,"th",26),p(14," SALES PERSON "),a(),n(15,"th",27),p(16," Qty "),a(),g(17,C2,2,0,"th",28),n(18,"th",29),p(19," Price "),a(),n(20,"th",30),p(21," Total "),a()()(),n(22,"tbody"),g(23,S2,28,32,"tr",31),a(),g(24,D2,14,15,"tfoot",24),a(),n(25,"div",32)(26,"POS-complex-pagination",33),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=s();o(10),m("ngIf",e.showBatchNumber),o(7),m("ngIf",e.roleService.product.Cost),o(6),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0),o(2),m("total",e.data.Data.length)("pageData",e.pageData)}}var Ia=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=f}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=M.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,f);case"Date":return this.compare(t.Date,l.Date,f);case"Number":return this.compare(t.Number,l.Number,f);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,f);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,f);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,f);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,f);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Discount":return this.compare(t.Discount,l.Discount,f);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Oe),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],[4,"ngIf"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],["class","empty-column",4,"ngIf"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_2,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),g(6,g2,28,16,"ng-template",null,0,V),a(),n(8,"content"),g(9,v2,27,6,"div",4),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,d2)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,ke,B,L,pe,ae,ge,Qe,Le,bt,fe,Q,Ye,oe,ie,ee],encapsulation:2})};var w2=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],T2=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],P2=()=>["/menu/Contacts/Contact/Customers/Info"],F2=i=>({ID:i}),kr=(i,c)=>({"text-danger":i,"text-success":c});function I2(i,c){if(i&1){let e=F();n(0,"a",10),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export "),a()}}function b2(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.ListBrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function E2(i,c){i&1&&(n(0,"th",32),p(1,"Total Cost "),a())}function M2(i,c){i&1&&(n(0,"th",33),p(1,"Profit"),a())}function V2(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalCost?e.TotalCost:0),"")}}function B2(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,kr,e.Profit<0,e.Profit>0)),o(),v(" ",C(2,2,e.Profit),"")}}function O2(i,c){if(i&1&&(n(0,"tr")(1,"td",39),p(2),a(),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",41),p(7),d(8,"amountFraction"),a(),g(9,V2,3,3,"td",42)(10,B2,3,7,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),v("",e.BrandName," "),o(2),v(" ",C(5,5,e.Quantity?e.Quantity:0),""),o(3),v(" ",C(8,7,e.TotalSales?e.TotalSales:0),""),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit)}}function L2(i,c){if(i&1&&(n(0,"tr",34)(1,"td")(2,"a",35),p(3),a()(),n(4,"td",22),p(5),a(),n(6,"td",23),p(7),a(),n(8,"td",24),p(9),a(),n(10,"td",36)(11,"table",37),g(12,O2,11,9,"tr",38),a()()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(8,P2))("queryParams",U(9,F2,e.CustomerID)),o(),Xt(" ",e.Name," ",e.Title," "),o(2),T(e.Email),o(2),T(e.Mobile),o(2),T(e.City),o(3),m("ngForOf",e.Detail)}}function R2(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Total.TotalCost)," ")}}function k2(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(4,kr,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),v(" ",C(2,2,e.data.Total.Profit)," ")}}function W2(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",46),I(2,"td",47),n(3,"td",48),p(4),d(5,"quantityFraction"),a(),n(6,"td",48),p(7),d(8,"amountFraction"),a(),g(9,R2,3,3,"td",49)(10,k2,3,7,"td",50),a()()),i&2){let e=s(2);o(4),v(" ",C(5,4,e.data.Total.Quantity)," "),o(3),v(" ",C(8,6,e.data.Total.TotalSales)," "),o(2),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit)}}function N2(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Customer "),a(),n(6,"th",22),p(7,"Email"),a(),n(8,"th",23),p(9,"Mobile"),a(),n(10,"th",24),p(11,"City"),a(),n(12,"th",25),p(13,"Brand"),a(),n(14,"th",26),p(15," Qty "),a(),n(16,"th",27),p(17,"Total Sales "),a(),g(18,E2,2,0,"th",28)(19,M2,2,0,"th",29),a()(),n(20,"tbody"),g(21,L2,13,11,"tr",30),a(),g(22,W2,11,8,"tfoot",31),a()()}if(i&2){let e=s();o(18),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data)}}var ba=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,f);case"Cost":return this.compare(t.TotalCost,l.TotalCost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[R],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before","class","flex-right text-end","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","arrowPosition","before","class","flex-right text-end","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[4,"ngFor","ngForOf"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],["class","border-top-0 text-end text-danger","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-end","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,I2,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),g(14,b2,13,7,"ng-template",null,0,V),a(),n(16,"content")(17,"div",7),g(18,N2,23,4,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,w2)),o(3),m("routerLink",b(11,T2)),o(7),m("ngIf",t.data),o(),m("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,ae,ge,Qe,bt,X,J],encapsulation:2})};var A2=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),G2=()=>["/menu/Reports/Sales_Report/Standard/Detail"],H2=(i,c,e)=>({From:i,To:c,TypeID:e}),Wr=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),Ma=(i,c)=>({"text-danger":i,"text-success":c});function Q2(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export"),a()}}function Y2(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",14)(4,"div",15)(5,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Year=null)}),a()(),n(6,"div",17)(7,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(2);o(5),x("ngModel",e.Year),m("items",e.Years),o(2),x("ngModel",e.Month),m("items",e.Months)}}function j2(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),g(16,Y2,8,4,"ng-container",13),a()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.isCompare),o(),m("ngIf",e.isCompare)}}function q2(i,c){i&1&&(n(0,"th",45),p(1,"Prev"),a())}function U2(i,c){i&1&&(n(0,"th",46),p(1,"Now"),a())}function K2(i,c){i&1&&(n(0,"th",47),p(1," Trans "),a())}function z2(i,c){i&1&&(n(0,"th",48),p(1,"Qty"),a())}function X2(i,c){i&1&&(n(0,"th",49),p(1,"Tax"),a())}function J2(i,c){if(i&1&&(n(0,"th",50),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Z2(i,c){i&1&&(n(0,"th",39),p(1,"\xB1 (%)"),a())}function $2(i,c){i&1&&(n(0,"th",51),p(1,"Cost"),a())}function eD(i,c){if(i&1&&(n(0,"th",50),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function tD(i,c){i&1&&(n(0,"th",52),p(1," Target "),a())}function iD(i,c){i&1&&(n(0,"th",53),p(1," Ach(%) "),a())}function nD(i,c){if(i&1&&(n(0,"td",39),p(1),a()),i&2){let e=s().$implicit;o(),T(e.PrevIndex)}}function aD(i,c){if(i&1&&(n(0,"td",55),p(1),a()),i&2){let e=s(),r=e.$implicit,t=e.index;m("ngClass",de(2,A2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),v(" ",r.CurrentIndex," ")}}function oD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Quantity))}}function rD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.Count,".0-0"))}}function lD(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function pD(i,c){if(i&1&&(n(0,"td",39)(1,"a",57),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,r=s(2);o(),m("routerLink",b(11,G2))("queryParams",st(12,H2,y(2,3,r.pageData.Filter.From,"ddMMyyyy"),y(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),T(C(6,9,e.SalesWithTax))}}function mD(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Wr,e.IsNegative,e.IsPositive)),o(),v(" ",C(2,2,e.Increase)," ")}}function sD(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function cD(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,r=s(2);o(),v(" ",C(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function dD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesTarget)," ")}}function uD(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,Ma,e.Achievement<0,e.Achievement>0)),o(),v(" ",C(2,2,e.Achievement)," ")}}function _D(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,Ma,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),v(" ",C(2,2,e.AchievementWithTax)," ")}}function gD(i,c){if(i&1&&(n(0,"td",39),g(1,uD,3,7,"span",42)(2,_D,3,7,"span",42),a()),i&2){let e=s(3);o(),m("ngIf",!e.pageData.IgnoreTax),o(),m("ngIf",e.pageData.IgnoreTax)}}function fD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",37),p(4),a(),g(5,nD,2,1,"td",31)(6,aD,2,5,"td",54)(7,oD,3,3,"td",31)(8,rD,3,4,"td",31),n(9,"td",39),p(10),d(11,"amountFraction"),a(),g(12,lD,3,3,"td",40),d(13,"HideSumZero"),g(14,pD,7,16,"td",31)(15,mD,3,7,"td",42)(16,sD,3,3,"td",43)(17,cD,3,3,"td",44)(18,dD,3,3,"td",31),d(19,"HideSumZero"),g(20,gD,3,2,"td",31),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(2),T(r+1),o(2),T(e.Name),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.data.WithCategory),o(),m("ngIf",!t.data.WithCategory),o(2),T(C(11,14,e.SalesNet)),o(2),m("ngIf",!t.data.WithCategory&&y(13,16,t.data.Data,"Tax")),o(2),m("ngIf",!t.data.WithCategory),o(),m("ngIf",t.showCompareColumn),o(),m("ngIf",t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",y(19,19,t.data.Data,"SalesTarget")),o(2),m("ngIf",y(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||y(22,25,t.data.Data,"Achievement"))}}function CD(i,c){i&1&&I(0,"td",61)}function xD(i,c){i&1&&I(0,"td",61)}function hD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function SD(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function yD(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function DD(i,c){if(i&1&&(n(0,"td",62)(1,"a",63),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function vD(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,Wr,e.comparation<0,e.comparation>0)),o(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function wD(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function TD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),T(C(3,4,y(2,1,e.data.Data,"Profit")))}}function PD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.data.Data,"ProfitWithTax"))," ")}}function FD(i,c){if(i&1&&(n(0,"td",60),g(1,TD,4,6,"span",13)(2,PD,4,6,"span",13),a()),i&2){let e=s(2);o(),m("ngIf",e.pageData.IgnoreTax),o(),m("ngIf",!e.pageData.IgnoreTax)}}function ID(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function bD(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,Ma,y(1,2,e.data.Data,"Sales")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"Sales")/y(4,11,e.data.Data,"SalesTarget")>0)),o(5),v(" ",C(8,20,y(6,14,e.data.Data,"Sales")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function ED(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,Ma,y(1,2,e.data.Data,"SalesWithTax")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"SalesWithTax")/y(4,11,e.data.Data,"SalesTarget")>0)),o(5),v(" ",C(8,20,y(6,14,e.data.Data,"SalesWithTax")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function MD(i,c){if(i&1&&(n(0,"td",39),g(1,bD,9,25,"span",42)(2,ED,9,25,"span",42),a()),i&2){let e=s(2);o(),m("ngIf",!e.pageData.IgnoreTax),o(),m("ngIf",e.pageData.IgnoreTax)}}function VD(i,c){if(i&1){let e=F();n(0,"div",19)(1,"div",20)(2,"table",21),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",22)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",23),p(8,"Tag"),a(),g(9,q2,2,0,"th",24)(10,U2,2,0,"th",25)(11,K2,2,0,"th",26)(12,z2,2,0,"th",27),n(13,"th",28),p(14,"Sales"),a(),g(15,X2,2,0,"th",29),d(16,"HideSumZero"),g(17,J2,2,1,"th",30)(18,Z2,2,0,"th",31)(19,$2,2,0,"th",32)(20,eD,2,1,"th",30)(21,tD,2,0,"th",33),d(22,"HideSumZero"),g(23,iD,2,0,"th",34),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),g(27,fD,23,28,"tr",35),a(),n(28,"tfoot")(29,"tr",36),I(30,"td")(31,"td",37),g(32,CD,1,0,"td",38)(33,xD,1,0,"td",38)(34,hD,4,7,"td",31)(35,SD,4,6,"td",31),n(36,"td",39),p(37),d(38,"sum"),d(39,"amountFraction"),a(),g(40,yD,4,6,"td",40),d(41,"HideSumZero"),g(42,DD,5,6,"td",41)(43,vD,3,8,"td",42)(44,wD,4,6,"td",43)(45,FD,3,2,"td",44)(46,ID,4,6,"td",31),d(47,"HideSumZero"),g(48,MD,3,2,"td",31),d(49,"HideSumZero"),d(50,"HideSumZero"),a()()()()()}if(i&2){let e=s();o(9),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.data.WithCategory),o(3),m("ngIf",!e.data.WithCategory&&y(16,24,e.data.Data,"Tax")),o(2),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",y(22,27,e.data.Data,"SalesTarget")),o(2),m("ngIf",y(24,30,e.data.Data,"AchievementWithTax")||y(25,33,e.data.Data,"Achievement")&&e.roleService.report.Profit),o(4),m("ngForOf",e.data.Data),o(5),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.data.WithCategory),o(2),v(" ",C(39,39,y(38,36,e.data.Data,"SalesNet"))," "),o(3),m("ngIf",!e.data.WithCategory&&y(41,41,e.data.Data,"Tax")),o(2),m("ngIf",!e.data.WithCategory),o(),m("ngIf",e.showCompareColumn),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.product.Expense&&y(47,44,e.data.Data,"Expense")),o(2),m("ngIf",y(49,47,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||y(50,50,e.data.Data,"Achievement"))}}var Ea=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date;this.Year=w.getFullYear(),this.Month=w.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=M.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Count":return this.compare(t.Count,l.Count,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Gross":return this.compare(t.Gross,l.Gross,f);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,f);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,f);case"Expense":return this.compare(t.Expense,l.Expense,f);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,f);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,f);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,f);case"Achievement":return this.compare(t.Achievement,l.Achievement,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[4,"ngIf"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","class","flex-left","arrowPosition","before",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["arrowPosition","before","class","flex-left",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","flex-left",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","class","align-left","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Q2,3,0,"button",2),a(),n(3,"filters"),g(4,j2,17,10,"ng-template",null,0,V),a(),n(6,"content"),g(7,VD,51,53,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,Q,oe,ti,ie,ee,X,J],encapsulation:2})};var Nr=Qt(mr()),Ar=Qt(no());function BD(i,c){if(i&1){let e=F();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",6)(7,"div",7)(8,"datepicker",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(9,"div",7)(10,"datepicker",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),x("ngModel",e.pageData.Filter.ListIDs),o(5),x("ngModel",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("ngModel",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),x("ngModel",e.pageData.Filter.PriceRange)}}function OD(i,c){if(i&1){let e=F();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function LD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",23),p(6),d(7,"quantityFraction"),a(),n(8,"td",23),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;o(2),Xt(" ",C(3,4,e.KeyValue.Key.StartNumber)," - ",C(4,6,e.KeyValue.Key.EndNumber)," "),o(4),v(" ",e.KeyValue.Value!=0?C(7,8,e.KeyValue.Value):"-"," "),o(3),T(C(10,10,e.Sales))}}function RD(i,c){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",6)(3,"div",7)(4,"table",14)(5,"thead",15)(6,"tr",16)(7,"th",17),p(8,"Price"),a(),n(9,"th",18),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),g(14,LD,11,12,"tr",19),a()()(),n(15,"div",7)(16,"div",20)(17,"div",21),I(18,"highcharts-chart",22),a()()()()()()),i&2){let e=s();o(14),m("ngForOf",e.data.Data),o(4),m("Highcharts",e.Highcharts)("options",e.chartOptions())}}(0,Ar.default)(Nr);var Ba=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}Highcharts=Nr;chartOptions=mt(null);openExportModal(){this.matDialog.open(q,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[4,"ngFor","ngForOf"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"filters"),g(2,BD,14,11,"ng-template",null,0,V),a(),n(4,"actions"),g(5,OD,3,0,"button",2),a(),g(6,RD,19,3,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(5),m("ngIf",t.roleService.global.Export),o(),m("ngIf",t.data))},dependencies:[N,Y,k,K,ke,B,L,Qe,Q,ur,ie,J],encapsulation:2})};var kD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Gr=i=>({ID:i});function WD(i,c){if(i&1){let e=F();n(0,"button",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function ND(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",9)(10,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();o(4),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function AD(i,c){i&1&&(n(0,"th",37),p(1," Purchase "),a())}function GD(i,c){i&1&&(n(0,"th",38),p(1," Tax "),a())}function HD(i,c){if(i&1&&I(0,"th",39),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function QD(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function YD(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function jD(i,c){if(i&1&&(I(0,"td",47),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,r=s().$implicit,t=s(2);m("innerHtml",C(2,5,_i(1,1,t.data.Compenents,r,e)),Pe)}}function qD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",40),p(5),a()(),n(6,"td")(7,"a",41),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),g(14,QD,3,3,"td",42)(15,YD,3,3,"td",43)(16,jD,3,7,"td",44),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(14,kD))("queryParams",U(15,Gr,e.ID)),o(),T(e.Number),o(2),m("queryParams",U(17,Gr,e.SupplierID)),o(),v(" ",e.Name," "),o(2),T(e.TaxName),o(2),T(y(13,11,e.Date,"dd MMM yyyy")),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.product.Cost),o(),m("ngForOf",r.getComponent(r.data))}}function UD(i,c){if(i&1&&(n(0,"td",48)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function KD(i,c){if(i&1&&(n(0,"td",48)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function zD(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e.SumTaxAmount)," ")}}function XD(i,c){if(i&1){let e=F();n(0,"span",50),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",51),p(2,"?"),a()()}}function JD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function ZD(i,c){if(i&1){let e=F();n(0,"a",52),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",53),p(2," Next"),a()}}function $D(i,c){if(i&1){let e=F();n(0,"a",54),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),I(1,"i",55),p(2," Show All"),a()}}function ev(i,c){if(i&1){let e=F();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Outlet"),a(),n(8,"th",18),p(9,"Number"),a(),n(10,"th",19),p(11,"Supplier"),a(),n(12,"th",20),p(13," Type "),a(),n(14,"th",21),p(15,"Date"),a(),g(16,AD,2,0,"th",22)(17,GD,2,0,"th",23)(18,HD,1,1,"th",24),a()(),n(19,"tbody"),g(20,qD,17,19,"tr",25),a(),n(21,"tfoot")(22,"tr",26),I(23,"td",27),g(24,UD,5,6,"td",28)(25,KD,5,6,"td",28)(26,zD,3,3,"td",29),a()()()(),n(27,"div",30)(28,"div",31)(29,"div",32),p(30),d(31,"number"),g(32,XD,3,0,"span",33)(33,JD,3,3,"span",3),p(34),a()(),n(35,"div",34),g(36,ZD,3,0,"a",35)(37,$D,3,0,"a",36),a()()()()}if(i&2){let e=s();o(16),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngForOf",e.data.Compenents),o(2),m("ngForOf",e.infiniteList),o(4),m("ngIf",e.roleService.product.Cost),o(),m("ngIf",e.roleService.product.Cost),o(),m("ngForOf",e.data.Compenents),o(4),v(" Showing 1 - ",C(31,13,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var Oa=class i extends dn{constructor(e,r,t,l,f,w){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=f;this.matDialog=w}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Number":return this.compare(t.Number,l.Number,f);case"Date":return this.compare(t.Date,l.Date,f);case"Tax":return this.compare(t.Tax,l.Tax,f);default:return 0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Ke),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["style","width: 150px","mat-sort-header","Sales","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 150px","mat-sort-header","Tax","arrowPosition","before","class","flex-right text-end","matTooltip","Tax Amount",4,"ngIf"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,WD,3,0,"button",2),a(),n(3,"filters"),g(4,ND,17,10,"ng-template",null,0,V),a(),g(6,ev,38,15,"content",3),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,oe,xi,ie,ee,X],encapsulation:2})};var tv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],iv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function nv(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function av(i,c){if(i&1&&(n(0,"div",12),I(1,"POS-pie-chart",13),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var La=class i extends he{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[R],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[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"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),g(13,nv,10,6,"ng-template",null,0,V),a(),n(15,"content"),g(16,av,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(7,tv)),o(3),m("routerLink",b(8,iv)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,K,B,L,ni,Q],encapsulation:2})};var ov=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],Ti=i=>[i],Hr=(i,c)=>({"text-danger":i,"text-success":c});function rv(i,c){if(i&1){let e=F();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function lv(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("multiple",!0),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),m("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),m("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function pv(i,c){if(i&1&&(n(0,"th",29),p(1),a()),i&2){let e=s(2);o(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function mv(i,c){if(i&1&&(n(0,"th",30),p(1),a()),i&2){let e=s(2);o(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function sv(i,c){i&1&&(n(0,"th",31),p(1," Profit "),a())}function cv(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.NetProfit1)," ")}}function dv(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.NetProfit2)," ")}}function uv(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Hr,e.Growth<0,e.Growth>0)),o(),v(" ",C(2,2,e.Growth),"% ")}}function _v(i,c){if(i&1&&(n(0,"tr")(1,"td",32),p(2),a(),n(3,"td",33),p(4),d(5,"amountFraction"),a(),g(6,cv,3,3,"td",34),n(7,"td",33),p(8),d(9,"amountFraction"),a(),g(10,dv,3,3,"td",34),n(11,"td",35),p(12),d(13,"amountFraction"),a(),g(14,uv,3,7,"td",36),a()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(),m("colSpan",r.roleService.report.Profit?1:2),o(),v(" ",C(5,10,e.SalesNTax1)," "),o(2),m("ngIf",r.roleService.report.Profit),o(),m("colSpan",r.roleService.report.Profit?1:2),o(),v(" ",C(9,12,e.SalesNTax2)," "),o(2),m("ngIf",r.roleService.report.Profit),o(),m("ngClass",de(16,Hr,e.Revenue<0,e.Revenue>0)),o(),v(" ",C(13,14,e.Revenue),"% "),o(2),m("ngIf",r.roleService.report.Profit)}}function gv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.netProfit1Total>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.netProfit1Total)," ")}}function fv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.netProfit2Total>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.netProfit2Total)," ")}}function Cv(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,Ti,e.profitPercentage>0?"text-success":"text-danger")),o(),v(" ",C(2,2,e.profitPercentage),"% ")}}function xv(i,c){if(i&1){let e=F();n(0,"div",12)(1,"table",13),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5," Outlet "),a(),n(6,"th",16)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",17)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",17),p(23,"YOY Growth"),a()(),n(24,"tr",18)(25,"th",19),p(26),a(),g(27,pv,2,1,"th",20),n(28,"th",21),p(29),a(),g(30,mv,2,1,"th",22),n(31,"th",23),p(32,"Revenue"),a(),g(33,sv,2,0,"th",24),a()(),n(34,"tbody"),g(35,_v,15,19,"tr",25),a(),n(36,"tfoot")(37,"tr"),I(38,"td"),n(39,"td",26),p(40),d(41,"amountFraction"),a(),g(42,gv,3,6,"td",27),n(43,"td",26),p(44),d(45,"amountFraction"),a(),g(46,fv,3,6,"td",27),n(47,"td",28),p(48),d(49,"amountFraction"),a(),g(50,Cv,3,6,"td",27),a()()()()}if(i&2){let e=s();o(8),T(y(9,23,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),T(y(13,26,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),T(y(17,29,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),T(y(21,32,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),m("colSpan",e.roleService.report.Profit?1:2),o(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),m("ngIf",e.roleService.report.Profit),o(),m("colSpan",e.roleService.report.Profit?1:2),o(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),m("ngIf",e.roleService.report.Profit),o(3),m("ngIf",e.roleService.report.Profit),o(2),m("ngForOf",e.data),o(4),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(41,Ti,e.salesNTax1Total>0?"text-success":"text-danger")),o(),v(" ",C(41,35,e.salesNTax1Total)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(43,Ti,e.salesNTax2Total>0?"text-success":"text-danger")),o(),v(" ",C(45,37,e.salesNTax2Total)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngClass",U(45,Ti,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),v(" ",C(49,39,e.salesNTaxPercentage),"% "),o(2),m("ngIf",e.roleService.report.Profit)}}var Ra=class i extends ne{constructor(e,r,t,l,f,w){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=f;this.matDialog=w}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],f);case"string":return this.compare(t[e.active],l[e.active],f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(H),D(G),D(W),D(O),D(oe),D(j))};static \u0275cmp=E({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit1",4,"ngIf"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit2",4,"ngIf"],["mat-sort-header","Revenue",1,"align-center"],["class","align-center","mat-sort-header","Growth",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end",3,"colSpan","ngClass"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Growth",1,"align-center"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],["class","text-end border-end",4,"ngIf"],[1,"text-end","border-end",3,"ngClass"],["class","text-end border-end",3,"ngClass",4,"ngIf"],[1,"text-end","border-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,rv,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),g(6,lv,16,13,"ng-template",null,0,V),a(),n(8,"content"),g(9,xv,51,47,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(),m("routerLink",b(7,ov)),o(6),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,B,L,pe,ae,ge,Gt,fe,Q,ee,X],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Li=Qt(Oi());var hv={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Pi=class i{yearCtrl=new To(null);year=uo(null);minDate=(0,Li.default)().subtract(100,"years");maxDate=(0,Li.default)();constructor(){So(()=>{this.year()&&this.yearCtrl.setValue((0,Li.default)().year(this.year()).startOf("year"))})}chosenYearHandler(c,e){let r=c.year(),t=(0,Li.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en]},{provide:nn,useValue:hv}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let f=Ze(4);return _(f.open())}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))}),a()()}if(e&2){let t=Ze(4);o(),m("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),m("for",t)}},dependencies:[sn,on,an,fi,cn,gi,rn,ln,pn,At,ke,B,Xi,Fo],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
7
+ `],encapsulation:2,changeDetection:0})};var yv=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function Dv(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),S("yearChange",function(t){u(e);let l=s();return h(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),S("yearChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options.Currencies),o(4),x("year",e.pageData.Filter.FromYear),o(2),x("year",e.pageData.Filter.ToYear)}}function vv(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-line-chart",12),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var ka=class i extends ne{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,f="",w=Math.abs(t[this.x]?t[this.x]:0);return w>999&&w<1e10?(f="K",l=(w/1e3).toFixed(0)):w>=1e10?(f="M",l=(w/1e6).toFixed(0)):w<999&&(l=w.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+f}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(w=>this.series?.name?.includes("Cost")?w?.name?.includes("Cost"):w?.name?.includes("Cost")==!1);let t=[],l="",f=this.point.index;return r.forEach(w=>{w.options.stack===this.point.series.options.stack&&(t=w.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
8
+ ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(w.points[f]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(f=>f.Name=="Sales").map(f=>f.Amount),t=this.data.Series.filter(f=>f.Name=="Profit").map(f=>f.Amount),l=this.data.Series.filter(f=>f.Name=="Cost").map(f=>f.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G))};static \u0275cmp=E({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[R],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),g(6,Dv,16,10,"ng-template",null,0,V),a(),n(8,"content"),g(9,vv,2,2,"div",4),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,yv)),o(7),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,pe,Et,fe,Q,Pi],encapsulation:2})};var wv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Tv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Pv=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Fv=i=>({id:i}),Iv=i=>[i],Qr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],bv=(i,c,e)=>({CategoryID:i,From:c,To:e}),Yr=i=>({CategoryID:i}),Ev=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function Mv(i,c){if(i&1){let e=F();n(0,"button",9),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",10),p(2," Export "),a()}}function Vv(i,c){if(i&1&&(n(0,"span",24),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function Bv(i,c){if(i&1){let e=F();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,Vv,2,2,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Exclude Zero"),a(),n(31,"radio-options",23),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",U(21,Iv,U(19,Fv,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.TagID),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function Ov(i,c){i&1&&(n(0,"th",47),p(1," DISCOUNT "),a())}function Lv(i,c){i&1&&(n(0,"th",48),p(1," DISCOUNT (%) "),a(),n(2,"th",49),p(3," DISCOUNT (AMOUNT) "),a())}function Rv(i,c){i&1&&(n(0,"th",50),p(1," COST "),a())}function kv(i,c){i&1&&(n(0,"th",51),p(1," PROFIT "),a())}function Wv(i,c){i&1&&(n(0,"th",52),p(1," % "),a())}function Nv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function Av(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function Gv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Percentage),"% ")}}function Hv(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",53),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),n(9,"td",41)(10,"a",53),p(11),d(12,"amountFraction"),a()(),n(13,"td",41)(14,"a",53),p(15),d(16,"amountFraction"),a()(),n(17,"td",41),p(18),d(19,"amountFraction"),a(),n(20,"td",43),p(21),d(22,"amountFraction"),a(),n(23,"td",41),p(24),d(25,"amountFraction"),a(),g(26,Nv,3,3,"td",44)(27,Av,3,4,"td",45)(28,Gv,3,4,"td",45),a()),i&2){let e=c.$implicit,r=s(2);o(2),m("routerLink",b(34,Qr))("queryParams",st(35,bv,e.ID,y(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),y(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(e.Name),o(2),T(C(8,22,e.Quantity)),o(3),m("routerLink",b(39,Qr))("queryParams",U(40,Yr,e.ID)),o(),v(" ",C(12,24,e.GrossSales)," "),o(3),m("routerLink",b(42,Ev))("queryParams",U(43,Yr,e.ID)),o(),T(C(16,26,e.Discount)),o(3),T(C(19,28,e.Sales)),o(3),v(" ",C(22,30,e.Tax)," "),o(3),T(C(25,32,e.SalesNTax)),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit)}}function Qv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function Yv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.data.Aggregate.TotalProfit)," ")}}function jv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function qv(i,c){if(i&1){let e=F();n(0,"content")(1,"div",25)(2,"div",26)(3,"table",27),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",28)(5,"tr")(6,"th",29),p(7,"CATEGORY"),a(),n(8,"th",30),p(9," QUANTITY "),a(),n(10,"th",31),p(11," GROSS SALES "),a(),g(12,Ov,2,0,"th",32)(13,Lv,4,0,"ng-template",null,1,V),n(15,"th",33),p(16," NET SALES "),a(),n(17,"th",34),p(18," Tax "),a(),n(19,"th",35),p(20," Sales + Tax "),a(),g(21,Rv,2,0,"th",36)(22,kv,2,0,"th",37)(23,Wv,2,0,"th",38),a()(),n(24,"tbody"),g(25,Hv,29,45,"tr",39),a(),n(26,"tfoot")(27,"tr",40)(28,"td",41),p(29,"Total :"),a(),n(30,"td",41),p(31),d(32,"quantityFraction"),a(),n(33,"td",42)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",41),p(38),d(39,"amountFraction"),a(),n(40,"td",41),p(41),d(42,"amountFraction"),a(),n(43,"td",43),p(44),d(45,"amountFraction"),a(),n(46,"td",41),p(47),d(48,"amountFraction"),a(),g(49,Qv,3,3,"td",44)(50,Yv,3,4,"td",45)(51,jv,3,4,"td",45),a()()()(),n(52,"POS-complex-pagination",46),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=Ze(14),r=s();o(12),m("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit),o(2),m("ngForOf",r.data.Data),o(6),v(" ",C(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),T(C(36,19,r.data.Aggregate.TotalGross)),o(3),v(" ",C(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),v(" ",C(45,25,r.data.Aggregate.TotalTax)," "),o(3),v(" ",C(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),m("ngIf",r.roleService.product.Cost),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.roleService.report.Profit),o(),m("total",r.data.Count)("pageData",r.pageData)}}var Wa=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}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 f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Total":return this.compare(t.Total,l.Total,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Discount":return this.compare(t.Discount,l.Discount,f);case"NetSales":return this.compare(t.NetSales,l.NetSales,f);case"Cost":return this.compare(t.Cost,l.Cost,f);case"Profit":return this.compare(t.Profit,l.Profit,f);case"Percentage":return this.compare(t.Percentage,l.Percentage,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,f);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{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)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Mv,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),g(17,Bv,32,23,"ng-template",null,0,V),a(),g(19,qv,53,29,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,wv)),o(3),m("routerLink",b(11,Tv)),o(3),m("routerLink",b(12,Pv)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,B,L,pe,ae,ge,De,Le,bt,fe,Q,Ye,un,ie,ee,X,J],encapsulation:2})};var qr=(i,c)=>({"text-danger":i,"text-success":c}),Uv=()=>["/menu/Products/Catalog/Variants/Info"],jr=i=>({ID:i}),Kv=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function zv(i,c){if(i&1){let e=F();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function Xv(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(17,"div",12)(18,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",15)(25,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CompareDifference),m("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),x("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.Note),o(4),x("ngModel",e.pageData.Filter.DiscountFrom),o(),x("ngModel",e.pageData.Filter.DiscountTo)}}function Jv(i,c){i&1&&(se(0),n(1,"th",38),p(2,"Cost"),a(),ce())}function Zv(i,c){if(i&1&&(se(0),n(1,"td",36),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),T(C(3,1,e.UnitCost))}}function $v(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",39),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",39),p(10),a(),I(11,"span",40),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",34),p(16),d(17,"quantityFraction"),a(),g(18,Zv,4,3,"ng-container",3),n(19,"td",34),p(20),d(21,"amountFraction"),a(),n(22,"td",34),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",36),p(29),d(30,"amountFraction"),a(),n(31,"td",37),p(32),d(33,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(2);o(2),T(e.EntityName),o(2),m("routerLink",b(33,Uv))("queryParams",U(34,jr,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(2),m("routerLink",b(36,Kv))("queryParams",U(37,jr,e.InvoiceID)),o(),T(e.Number),o(),m("innerHTML",e.Note,Pe),o(2),T(y(14,18,e.Date,"dd MMM yyyy")),o(3),T(C(17,21,e.Quantity)),o(2),m("ngIf",r.roleService.product.Cost),o(2),T(C(21,23,e.UnitPriceOriginal)),o(3),T(C(24,25,e.UnitPrice)),o(2),m("ngClass",de(39,qr,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),v(" ",C(27,27,e.Discount),""),o(3),v(" ",C(30,29,e.DiscountPercentage),"% "),o(3),T(C(33,31,e.Sales))}}function ew(i,c){if(i&1&&(se(0),n(1,"td",36),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2);o(2),T(C(3,1,e.data.Aggregate.TotalUnitCost))}}function tw(i,c){if(i&1){let e=F();se(0),n(1,"POS-complex-pagination",41),P("jumpToPage",function(){u(e);let t=s(2);return _(t.getListData())})("previousPage",function(){u(e);let t=s(2);return _(t.getListData())})("nextPage",function(){u(e);let t=s(2);return _(t.getListData())}),a(),ce()}if(i&2){let e=s(2);o(),m("total",e.data.Data.length)("pageData",e.pageData)}}function iw(i,c){if(i&1){let e=F();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Variant"),a(),n(10,"th",23),p(11,"Code"),a(),n(12,"th",24),p(13,"Number / Note"),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17,"Quantity"),a(),g(18,Jv,3,0,"ng-container",3),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),g(30,$v,34,42,"tr",32),a(),n(31,"tfoot")(32,"tr"),I(33,"td",33),n(34,"td",34),p(35,"Total :"),a(),n(36,"td",34),p(37),d(38,"quantityFraction"),a(),g(39,ew,4,3,"ng-container",3),n(40,"td",34),p(41),d(42,"amountFraction"),a(),n(43,"td",34),p(44),d(45,"amountFraction"),a(),n(46,"td",35),p(47),d(48,"amountFraction"),a(),n(49,"td",36),p(50),d(51,"amountFraction"),a(),n(52,"td",37),p(53),d(54,"amountFraction"),a()()()()(),g(55,tw,2,2,"ng-container",3),a()()}if(i&2){let e=s();o(18),m("ngIf",e.roleService.product.Cost),o(12),m("ngForOf",e.data.Data),o(7),T(C(38,11,e.data.Aggregate.TotalQuantity)),o(2),m("ngIf",e.roleService.product.Cost),o(2),T(C(42,13,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),T(C(45,15,e.data.Aggregate.TotalUnitPrice)),o(2),m("ngClass",de(23,qr,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),v(" ",C(48,17,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount),""),o(3),v(" ",C(51,19,e.data.Aggregate.DiscountPercentage),"% "),o(3),T(C(54,21,e.data.Aggregate.TotalNetSales)),o(2),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.length)>0)}}var Na=class i extends he{constructor(e,r,t,l,f){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=f}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"EntityName":return M.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),f);case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Number":return M.compare(t.Number,l.Number,f);case"Date":return M.compare(t.Date,l.Date,f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"UnitCost":return M.compare(t.UnitCost,l.UnitCost,f);case"UnitPriceOriginal":return M.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,f);case"UnitPrice":return M.compare(t.UnitPrice,l.UnitPrice,f);case"Discount":return M.compare(t.Discount,l.Discount,f);case"Sales":return M.compare(t.Sales,l.Sales,f);case"DiscountPercentage":return M.compare(t.DiscountPercentage,l.DiscountPercentage,f);case"Note":return M.compare(t.Note,l.Note,f);default:return 0}})}openExportModal(){this.dialog.open(q,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"text-end"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,zv,3,0,"a",2),a(),n(3,"filters"),g(4,Xv,27,16,"ng-template",null,0,V),a(),g(6,iw,56,26,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Le,bt,fe,Q,ee,X,J],encapsulation:2})};var nw=()=>["/menu/Reports/Sales_Report/Standard/Person"],aw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],ow=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],rw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],lw=(i,c)=>({From:i,To:c}),Kr=i=>({ID:i}),Ur=i=>[i],pw=(i,c)=>({SalesPersonID:i,ListIDs:c}),mw=(i,c,e,r)=>({SalesPersonID:i,ListIDs:c,From:e,To:r});function sw(i,c){if(i&1){let e=F();n(0,"a",15),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function cw(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s(2);o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),m("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function dw(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38)(7,"a",40),p(8),d(9,"number"),a()(),n(10,"td",38),p(11),d(12,"quantityFraction"),a(),n(13,"td",38),p(14),d(15,"quantityFraction"),a(),n(16,"td",38),p(17),d(18,"quantityFraction"),a(),n(19,"td",38),p(20),d(21,"amountFraction"),a(),n(22,"td",38),p(23),d(24,"amountFraction"),a(),n(25,"td",38)(26,"a",40),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",38),p(32),d(33,"quantityFraction"),a(),n(34,"td",38),p(35),d(36,"quantityFraction"),a(),n(37,"td",38),p(38),d(39,"quantityFraction"),a(),n(40,"td",38),p(41),d(42,"amountFraction"),a(),n(43,"td",38),p(44),d(45,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s().$implicit,t=s(2);o(2),m("queryParams",U(47,Kr,e.PersonID)),o(),T(e.PersonName),o(2),T(e.PersonCode),o(2),m("queryParams",de(51,pw,e.PersonID,U(49,Ur,r.EntityID))),o(),T(C(9,17,e.CountOrder)),o(3),T(C(12,19,e.Quantity)),o(3),T(C(15,21,e.BasketSize)),o(3),T(C(18,23,e.BasketValue)),o(3),T(C(21,25,e.Sales)),o(3),T(C(24,27,e.AverageDailySales)),o(3),m("queryParams",qt(56,mw,e.PersonID,U(54,Ur,r.EntityID),y(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),y(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),v(" ",C(30,35,e.CountOrder1),""),o(3),T(C(33,37,e.Quantity1)),o(3),T(C(36,39,e.BasketSize1)),o(3),T(C(39,41,e.BasketValue1)),o(3),T(C(42,43,e.Sales1)),o(3),T(C(45,45,e.AverageDailySales1))}}function uw(i,c){if(i&1&&(n(0,"table",22)(1,"thead",23)(2,"tr",24)(3,"th",25)(4,"h2")(5,"a",26),p(6),a()()()(),n(7,"tr")(8,"th",27),p(9," Sales Person"),a(),n(10,"th",28)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",29)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",30)(27,"th",31),p(28," Ordr"),a(),n(29,"th",32),p(30,"Qty"),a(),n(31,"th",32),I(32,"i",33),a(),n(33,"th",34),p(34,"Basket Value"),a(),n(35,"th",34),p(36,"Sales"),a(),n(37,"th",34),p(38,"Avg Daily"),a(),n(39,"th",35),p(40,"Ordr"),a(),n(41,"th",32),p(42,"Qty"),a(),n(43,"th",32),I(44,"i",33),a(),n(45,"th",34),p(46,"Basket Value"),a(),n(47,"th",34),p(48,"Sales"),a(),n(49,"th",34),p(50,"Avg Daily"),a()()(),n(51,"tbody"),g(52,dw,46,61,"tr",36),a(),n(53,"tfoot")(54,"tr",37)(55,"td"),p(56,"Total"),a(),n(57,"td",38),p(58),d(59,"sum"),d(60,"number"),a(),n(61,"td",38),p(62),d(63,"sum"),d(64,"quantityFraction"),a(),n(65,"td",38),p(66),d(67,"sum"),d(68,"quantityFraction"),a(),n(69,"td",38),p(70),d(71,"sum"),d(72,"quantityFraction"),a(),n(73,"td",38),p(74),d(75,"sum"),d(76,"amountFraction"),a(),n(77,"td",38),p(78),d(79,"sum"),d(80,"amountFraction"),a(),n(81,"td",38),p(82),d(83,"sum"),d(84,"number"),a(),n(85,"td",38),p(86),d(87,"sum"),d(88,"quantityFraction"),a(),n(89,"td",38),p(90),d(91,"sum"),d(92,"quantityFraction"),a(),n(93,"td",38),p(94),d(95,"sum"),d(96,"quantityFraction"),a(),n(97,"td",38),p(98),d(99,"sum"),d(100,"amountFraction"),a(),n(101,"td",38),p(102),d(103,"sum"),d(104,"amountFraction"),a()()()()),i&2){let e=c.$implicit,r=s(2);o(5),m("queryParams",U(91,Kr,e.EntityID)),o(),T(e.EntityName),o(6),T(y(13,19,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),T(y(17,22,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),T(y(21,25,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),T(y(25,28,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),m("ngForOf",e.SalesCommison),o(6),T(C(60,34,y(59,31,e.SalesCommison,"CountOrder"))),o(4),T(C(64,39,y(63,36,e.SalesCommison,"Quantity"))),o(4),T(C(68,44,y(67,41,e.SalesCommison,"BasketSize"))),o(4),T(C(72,49,y(71,46,e.SalesCommison,"BasketValue"))),o(4),T(C(76,54,y(75,51,e.SalesCommison,"Sales"))),o(4),T(C(80,59,y(79,56,e.SalesCommison,"AverageDailySales"))),o(4),T(C(84,64,y(83,61,e.SalesCommison,"CountOrder1"))),o(4),T(C(88,69,y(87,66,e.SalesCommison,"Quantity1"))),o(4),T(C(92,74,y(91,71,e.SalesCommison,"BasketSize1"))),o(4),T(C(96,79,y(95,76,e.SalesCommison,"BasketValue1"))),o(4),T(C(100,84,y(99,81,e.SalesCommison,"Sales1"))),o(4),T(C(104,89,y(103,86,e.SalesCommison,"AverageDailySales1")))}}function _w(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),S("filterChange",function(t){u(e);let l=s();return h(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=s();return _(t.print())}),I(4,"i",5),p(5," Print"),a(),g(6,sw,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,cw,13,9,"ng-template",null,0,V),a(),n(28,"content")(29,"div",12)(30,"div",13),g(31,uw,105,93,"table",14),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),o(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),o(6),m("routerLink",b(17,nw)),o(3),m("routerLink",b(18,aw)),o(3),m("routerLink",b(19,ow)),o(3),m("routerLink",b(20,rw))("queryParams",de(21,lw,y(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),m("ngForOf",e.data==null?null:e.data.Data)}}var Aa=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,w);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(G),D(j),D(Oe))};static \u0275cmp=E({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[4,"ngFor","ngForOf"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&g(0,_w,32,24,"mainpanel-cmp",1),r&2&&m("ngIf",t.data)},dependencies:[N,Y,k,A,B,L,pe,Gt,Q,Ye,oe,ie,ee,X,J],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var gw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],fw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Cw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],xw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],hw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Sw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],zr=i=>({ID:i});function yw(i,c){if(i&1){let e=F();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",38),S("modelChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=s(2);o(2),x("model",e.pageData.Filter.ReleasedType),m("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function Dw(i,c){if(i&1){let e=F();n(0,"div",21)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",23),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),g(10,yw,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",25)(14,"datepicker",26),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",27),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",28)(17,"div",29),p(18,"Number Of Interval"),a(),n(19,"div",29),p(20,"Interval Of"),a()(),n(21,"div",30)(22,"input",31),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",32)(24,"input",33),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",34),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",35),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",36),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",36),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",37),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("ngModel",e.pageData.Filter.ListTagID),m("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),Nt((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),x("date",e.pageData.Filter.ReleasedFrom),o(),x("date",e.pageData.Filter.ReleasedTo),o(7),x("ngModel",e.pageData.Filter.IntervalCount),o(2),x("ngModel",e.pageData.Filter.IntervalDays),o(5),m("max",1e3),x("ngModel",e.pageData.Filter.RowCount),o(3),x("model",e.pageData.Filter.PurchaseType),m("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),x("model",e.pageData.Filter.GroupByProduct),m("options",e.scopeFilter),o(3),x("model",e.pageData.Filter.HideZero),m("options",e.hideZeroOptions)}}function vw(i,c){if(i&1){let e=F();n(0,"button",39),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",40),p(2," Export "),a()}}function ww(i,c){if(i&1&&(n(0,"th",41),p(1),a(),n(2,"th",42),p(3," % "),a()),i&2){let e=c.$index,r=s();m("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),v(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),m("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function Tw(i,c){if(i&1&&(se(0),n(1,"th",43),d(2,"date"),d(3,"date"),p(4," TOT "),a(),n(5,"th",44),d(6,"date"),d(7,"date"),p(8," % "),a(),ce()),i&2){let e=s();o(),m("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
9
9
  `+y(2,2,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+y(3,5,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):"")),o(4),m("matTooltip","Total Percentage items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
10
- `+y(6,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+y(7,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function Pw(i,c){i&1&&fo(0)}function Iw(i,c){i&1&&F(0,"img",54)}function Fw(i,c){if(i&1&&(se(0),n(1,"a",55),p(2),a(),ce()),i&2){let e=s().$implicit;o(),m("queryParams",U(2,zr,e.ID)),o(),T(e.Name)}}function bw(i,c){if(i&1&&(n(0,"a",56),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,zr,e.ID)),o(),T(e.Name)}}function Ew(i,c){if(i&1&&(n(0,"td",52)(1,"span",57),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",53)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=c.$implicit;o(),m("matTooltip","From : "+y(2,3,e.From,"dd MMM yyyy")+`
11
- To : `+y(3,6,e.To,"dd MMM yyyy")),o(3),v(" ",C(5,9,e.Value)," "),o(4),v(" ",y(9,11,e.Percentage,"1.0-0"),"%")}}function Mw(i,c){if(i&1&&(se(0),n(1,"td",52)(2,"span"),p(3),d(4,"number"),a()(),n(5,"td",58)(6,"small"),p(7),d(8,"number"),a()(),ce()),i&2){let e=s(2).$implicit;o(3),T(C(4,2,e==null?null:e.IntervalTotal)),o(4),v("",y(8,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function Vw(i,c){if(i&1&&g(0,Mw,9,7,"ng-container",18),i&2){let e=s().$implicit;m("ngIf",(e==null||e.Intervals==null?null:e.Intervals.length)>0)}}function Bw(i,c){if(i&1){let e=I();n(0,"tr")(1,"td")(2,"div",45)(3,"div",46),g(4,Pw,1,0,"ng-container",47),n(5,"img",48),P("click",function(t){u(e);let l=s();return _(l.onZoomImage(t,t))}),a(),g(6,Iw,1,0,"ng-template",null,1,M),a(),n(8,"div",49),g(9,Fw,3,4,"ng-container",47)(10,bw,2,4,"ng-template",null,2,M),n(12,"small",50),p(13),a()()()(),n(14,"td")(15,"div",49)(16,"div"),p(17),d(18,"date"),a(),n(19,"small",51),d(20,"date"),d(21,"date"),p(22),d(23,"number"),a()()(),n(24,"td",52),p(25),d(26,"number"),a(),Ei(27,Ew,10,14,null,null,za),n(29,"td",52)(30,"span"),p(31),d(32,"number"),a()(),n(33,"td",53)(34,"small"),p(35),d(36,"number"),a()(),g(37,Vw,1,1,"ng-container"),n(38,"td",52),p(39),d(40,"number"),a()()}if(i&2){let e=c.$implicit,r=Ze(7),t=Ze(11),l=s();o(4),m("ngIf",e.ThumbnailUrl)("ngIfElse",r),o(),dt("src",e.ThumbnailUrl,Hi),o(4),m("ngIf",l.pageData==null||l.pageData.Filter==null?null:l.pageData.Filter.GroupByProduct)("ngIfElse",t),o(4),T(e.Code),o(4),v(" ",y(18,14,e.Released,"dd MMM yyyy")," "),o(2),m("matTooltip",y(20,17,e.Released,"dd MMM yyyy")+" - "+y(21,20,l.today,"dd MMM yyyy")),o(3),v("",C(23,23,e.ReleasedDays)," days"),o(3),T(C(26,25,e.Purchased)),o(2),Mi(e==null?null:e.Intervals),o(4),T(C(32,27,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),v(" ",y(36,29,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),Nt((e==null||e.Intervals==null?null:e.Intervals.length)>0?37:-1),o(2),T(C(40,32,e.Inventory))}}function Ow(i,c){if(i&1){let e=I();se(0),n(1,"POS-complex-pagination",59),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a(),ce()}if(i&2){let e=s();o(),m("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var Ga=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=f;this.dialog=w}intervalDays=mt(30);today=new Date;defaultReleasedType=mt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((f,w)=>(t[`Interval${w}`]=f.Value,f.Percentage=this.calculatePercentage(f.Value,t.Purchased),t[`Percentage${w}`]=f.Percentage,f)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((f,w)=>f+w.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=V.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}openExportModal(){this.dialog.open(q,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe),D(Dn),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[R],decls:52,vars:24,consts:[["pageFilterTemplate",""],["NO_IMAGE",""],["SCPOPE_VARIANT",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],[4,"ngIf"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],[4,"ngIf","ngIfElse"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",3),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"filters"),g(2,Dw,39,24,"ng-template",null,0,M),a(),n(4,"actions"),g(5,vw,3,0,"button",4),n(6,"div",5)(7,"button",6),p(8," More "),a(),n(9,"ul",7)(10,"li")(11,"a",8),p(12," Product Sold "),a()(),n(13,"li")(14,"a",8),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",8),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",8),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",8),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",8),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",9)(30,"div",10)(31,"table",11),P("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(32,"thead",12)(33,"tr")(34,"th",13),p(35,"Name"),a(),n(36,"th",14),p(37," Released "),a(),n(38,"th",15),p(39," Purchased "),a(),Ei(40,ww,4,5,null,null,za),n(42,"th",16),p(43),a(),n(44,"th",17),p(45," % "),a(),g(46,Tw,9,14,"ng-container",18),n(47,"th",19),p(48," On Hand "),a()()(),n(49,"tbody"),g(50,Bw,41,34,"tr",20),a()()(),g(51,Ow,2,2,"ng-container",18),a()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("hideSearchBox",!0),o(5),m("ngIf",t.role==null||t.role.global==null?null:t.role.global.Export),o(6),m("routerLink",b(18,gw)),o(3),m("routerLink",b(19,fw)),o(3),m("routerLink",b(20,Cw)),o(3),m("routerLink",b(21,xw)),o(3),m("routerLink",b(22,hw)),o(3),m("routerLink",b(23,Sw)),o(14),Mi(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),m("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),v(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),m("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),m("ngIf",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,K,ke,Po,B,L,pe,ae,ge,Qe,De,bt,fe,Q,Ko,ie,ee],encapsulation:2})};var Lw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Rw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],kw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Ww=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Aw=()=>["/menu/Contacts/Contact/Customers/Info"],Gw=i=>({ID:i}),Hw=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Qw=i=>({CustomerID:i});function Yw(i,c){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",13),p(2," Export "),a()}}function jw(i,c){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function qw(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",21),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",21),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(19,Aw))("queryParams",U(20,Gw,e.CustomerID)),o(),T(e.Name),o(2),T(e.Mobile),o(2),T(y(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),T(y(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),T(e.Days),o(2),m("routerLink",b(22,Hw))("queryParams",U(23,Qw,e.CustomerID)),o(),T(e.Orders),o(2),T(C(19,17,e.Amount))}}function Uw(i,c){if(i&1&&(n(0,"tbody",19),g(1,qw,20,25,"tr",20),a()),i&2){let e=s();o(),m("ngForOf",e.data.Data)}}var Ha=class i extends he{constructor(e,r,t,l,f){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=f}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(q,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(j),D(ee),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[R],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],["class","border-bottom",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yw,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),g(23,jw,10,6,"ng-template",null,0,M),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),g(44,Uw,2,1,"tbody",11),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Lw)),o(3),m("routerLink",b(12,Rw)),o(3),m("routerLink",b(13,kw)),o(3),m("routerLink",b(14,Ww)),o(3),m("routerLink",b(15,Nw)),o(24),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,Q,ie,ee],encapsulation:2})};var Ri=Qt(mr()),Xr=Qt(no());var Ht=Qt(Oi());var Kw=["outletSelectorRef"],zw=(i,c)=>c.Key;function Xw(i,c){if(i&1){let e=I();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=s();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),F(4,"i",12),a()()}if(i&2){let e=c.$implicit;o(2),T(e.Value)}}var Qa=class i{constructor(c){this._dialogRef=c;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=Bi.Success,this.pageData.set(this.data.pageData)}modalConfig=new Ci;data=Ge($t);pageData=mt(null);injector=Ge(Ai);variant$;#e=Ge(O);listVariantSelected=mt([]);toastr=Ge(Ke);route=Ge(Oe);outletSelector;itemHashMap=new Map;router=Ge(zi);productOrVarariantAPIURL=mt("");minDateFrom=mt((0,Ht.default)().subtract(90,"days"));maxDateFrom=mt((0,Ht.default)().subtract(2,"days"));minDateTo=mt((0,Ht.default)().subtract(90,"days"));maxDateTo=mt((0,Ht.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){Ji(this.pageData,{injector:this.injector}).pipe(ri(c=>!!c),Ni(),kt(c=>{let e=c.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(kt(c=>{c.keys.length>0?this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{From:c.get("From"),To:c.get("To"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[],ListVariantID:c.get("ListVariantID")?c.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(c.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Ht.default)().subtract(2,"days")),this.minDateFrom.set((0,Ht.default)().subtract(90,"days")),this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{From:(0,Ht.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(c,e,r){let t=[...c,...e];return Array.from(new Set(t.map(f=>f[r]))).map(f=>t.find(w=>w[r]===f))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(c=>c&&c.keys.length>0),po(c=>{let r=[...c.get("ListVariantID").split(","),c.get("ID")].filter(f=>f),t=JSON.parse(c.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(c.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Fi(()=>si(null)))}),ri(c=>!!c),kt(c=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),c,"Key"))})).subscribe()}onVariantSelected(c){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(c).Key]};this.#e.post(e,r).pipe(Fi(()=>si(null)),kt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(c){this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{GroupByVariant:c})})),this.listVariantSelected.set([])}onRemoveHandler(c){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==c.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",Bi.Warning);return}this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:Je({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Ht.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Ht.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(D(Zt))};static \u0275cmp=E({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&Qi(Kw,5),e&2){let t;Yi(t=ji())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),S("ngModelChange",function(l){return h(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),Ei(12,Xw,5,1,"mat-chip",null,zw),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),S("dateChange",function(l){return h(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),S("dateChange",function(l){return h(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(m("config",r.modalConfig),o(6),m("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),x("ngModel",r.pageData().Filter.ListIDs),o(4),m("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),Mi(r.listVariantSelected()),o(5),m("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),x("date",r.pageData().Filter.From),o(),m("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),x("date",r.pageData().Filter.To),o(3),m("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[Jt,At,B,L,hi,_n,ei,Q,Si,K,lr,or,ar,rr,hn,De,xn,Le,$i,pe],styles:["[_nghost-%COMP%]{display:block}"]})};var ai=Qt(Oi());var Jw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Zw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],$w=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],e3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],t3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],i3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function n3(i,c){}(0,Xr.default)(Ri.default);var Ya=class i{constructor(c,e,r,t,l,f,w,Ee,xt){this.route=c;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=f;this.cdr=w;this.injector=Ee;this.router=xt}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=mt(null);Highcharts=mt(Ri.default);variantOrProductItems=mt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,ai.default)(e).isSame((0,ai.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,ai.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ai.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ai.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(Rt(1))}parseQueryParams(c){let e=c.get("ID")?[c.get("ID")]:c.get("ListVariantID")?[...c.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(c.get("GroupByVariant")||"false"),From:(0,ai.default)(c.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ai.default)(c.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(c,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:c}).pipe(ri(t=>!!t),Yt(t=>({Key:t.Key,Value:t.Value})),Rt(1))}fetchChartQuantitySold(c){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",c).pipe(Yt(e=>et(Je({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>et(Je({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),kt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Fi(e=>si(null)),Rt(1))}handleVariantOrProductItems(){let c=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(c);this.fetchVariantOrProductItems(e,r).pipe(kt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(mo(100),Ua(c=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(c.Filter)}),Rt(1)),qa([this.chartData$,this.pageSetupService.menu$]).pipe(Yt(([c,e])=>({chartData:c,menu:et(Je({},e),{H:c.FullPageTitle,T:e.T.replace("undefined",c.FullPageTitle)})})),kt(({chartData:c,menu:e})=>{this.menu$=si(e),this.seriesData.set(c.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(c){let e=document.cookie.match(new RegExp("(?:^|; )"+c.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){Ji(this.seriesData,{injector:this.injector}).pipe(ri(c=>!!c),Ni(),kt(c=>Ri.default.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Ri.default.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(c.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:c.Series.map((e,r)=>et(Je({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){qa([this.loader$]).pipe(Yt(([c])=>({loader:c})),Ua(({loader:c})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=et(Je({},c),{Filter:et(Je({},c.Filter),{From:e?e.from:c.Filter.From,To:e?e.to:c.Filter.To})});return this.matDialog.open(Qa,{data:{pageData:r}}).afterClosed()}),kt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(D(Oe),D(O),D(W),D(j),D(Ke),D(Do),D(xo),D(Ai),D(zi))};static \u0275cmp=E({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),d(1,"async"),se(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),F(5,"i",5)(6,"i",6),a()(),ce(),se(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),ce(),se(30,12),g(31,n3,0,0,"ng-template",null,0,M),ce(),n(33,"content"),F(34,"div",13),a()()}e&2&&(m("pageData",C(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),m("routerLink",b(11,Jw)),o(3),m("routerLink",b(12,Zw)),o(3),m("routerLink",b(13,$w)),o(3),m("routerLink",b(14,e3)),o(3),m("routerLink",b(15,t3)),o(3),m("routerLink",b(16,i3)))},dependencies:[Jt,Ki,Vi,A,hi,N,Si,At],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var a3=[{path:"Sales_Report/Standard/Detail",component:wn},{path:"Sales_Report/Standard/Summary",component:Pn},{path:"Sales_Report/Standard/Top_Brand",component:In},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:La},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:ba},{path:"Sales_Report/Standard/Top_Customers",component:bn},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:Ha},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:En},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Mn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Vn},{path:"Sales_Report/Standard/Top_Customers/City",component:Ca},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:xa},{path:"Sales_Report/Standard/Products_Sold",component:Bn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:Ya},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:Ga},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:On},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:Ln},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:Rn},{path:"Sales_Report/Standard/Category_Sold",component:Wa},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:kn},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:Wn},{path:"Sales_Report/Standard/Category_Sold/Category",component:Nn},{path:"Sales_Report/Standard/Peak",component:An},{path:"Sales_Report/Standard/Peak/Peak",component:Hn},{path:"Sales_Report/Standard/Daily",component:Qn},{path:"Sales_Report/Standard/Daily/Daily_Table",component:Un},{path:"Sales_Report/Standard/Monthly",component:jn},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:Kn},{path:"Sales_Report/Standard/Yearly",component:ka},{path:"Sales_Report/Standard/Yearly/Comparison",component:qn},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:zn},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:Xn},{path:"Sales_Report/Standard/Outlet_Performance",component:Zn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Jn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:$n},{path:"Sales_Report/Standard/Sales_Order_Tag",component:Ea},{path:"Sales_Report/Standard/Person",component:ta},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:Aa},{path:"Sales_Report/Standard/Person/Commission_Report",component:ia},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:na},{path:"Sales_Report/Standard/Person/Sales_Group",component:ha},{path:"Sales_Report/Standard/Discounted_Sales",component:Na},{path:"Purchases_Report/Detail",component:aa},{path:"Purchases_Report/Summary",component:oa},{path:"Purchases_Report/Supplier",component:ra},{path:"Purchases_Report/Product",component:la},{path:"Purchases_Report/History",component:ma},{path:"Purchases_Report/Daily",component:sa},{path:"Purchases_Report/Daily/Monthly",component:ca},{path:"Purchases_Report/Volume",component:da},{path:"Purchases_Report/Sales",component:ua},{path:"Purchases_Report/Tax",component:Oa},{path:"Purchases_Report/Outlet",component:_a},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:ga},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:fa},{path:"Sales_Report/Standard/Compare",component:Ra},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:ea},{path:"Sales_Report/Advanced/Tax_Report",component:Sa},{path:"Sales_Report/Advanced/Visitor",component:Gn},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:ya},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Da},{path:"Sales_Report/Advanced/Product_Profit",component:va},{path:"Sales_Report/Advanced/Exchanged_Sales",component:wa},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Ta},{path:"Sales_Report/Advanced/Logistics_Service",component:gr},{path:"Return/Sales_Return",component:Pa},{path:"Return/Purchase_Return",component:Ia},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:Fa},{path:"Sales_Report/Standard/Price_Analysis",component:Ba},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],ja=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=di({type:i});static \u0275inj=ci({imports:[Vi.forChild(a3),Vi]})};var o3=["input"],r3=({dt:i})=>`
10
+ `+y(6,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+y(7,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function Pw(i,c){i&1&&fo(0)}function Fw(i,c){i&1&&I(0,"img",54)}function Iw(i,c){if(i&1&&(se(0),n(1,"a",55),p(2),a(),ce()),i&2){let e=s().$implicit;o(),m("queryParams",U(2,zr,e.ID)),o(),T(e.Name)}}function bw(i,c){if(i&1&&(n(0,"a",56),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,zr,e.ID)),o(),T(e.Name)}}function Ew(i,c){if(i&1&&(n(0,"td",52)(1,"span",57),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",53)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=c.$implicit;o(),m("matTooltip","From : "+y(2,3,e.From,"dd MMM yyyy")+`
11
+ To : `+y(3,6,e.To,"dd MMM yyyy")),o(3),v(" ",C(5,9,e.Value)," "),o(4),v(" ",y(9,11,e.Percentage,"1.0-0"),"%")}}function Mw(i,c){if(i&1&&(se(0),n(1,"td",52)(2,"span"),p(3),d(4,"number"),a()(),n(5,"td",58)(6,"small"),p(7),d(8,"number"),a()(),ce()),i&2){let e=s(2).$implicit;o(3),T(C(4,2,e==null?null:e.IntervalTotal)),o(4),v("",y(8,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function Vw(i,c){if(i&1&&g(0,Mw,9,7,"ng-container",18),i&2){let e=s().$implicit;m("ngIf",(e==null||e.Intervals==null?null:e.Intervals.length)>0)}}function Bw(i,c){if(i&1){let e=F();n(0,"tr")(1,"td")(2,"div",45)(3,"div",46),g(4,Pw,1,0,"ng-container",47),n(5,"img",48),P("click",function(t){u(e);let l=s();return _(l.onZoomImage(t,t))}),a(),g(6,Fw,1,0,"ng-template",null,1,V),a(),n(8,"div",49),g(9,Iw,3,4,"ng-container",47)(10,bw,2,4,"ng-template",null,2,V),n(12,"small",50),p(13),a()()()(),n(14,"td")(15,"div",49)(16,"div"),p(17),d(18,"date"),a(),n(19,"small",51),d(20,"date"),d(21,"date"),p(22),d(23,"number"),a()()(),n(24,"td",52),p(25),d(26,"number"),a(),Ei(27,Ew,10,14,null,null,za),n(29,"td",52)(30,"span"),p(31),d(32,"number"),a()(),n(33,"td",53)(34,"small"),p(35),d(36,"number"),a()(),g(37,Vw,1,1,"ng-container"),n(38,"td",52),p(39),d(40,"number"),a()()}if(i&2){let e=c.$implicit,r=Ze(7),t=Ze(11),l=s();o(4),m("ngIf",e.ThumbnailUrl)("ngIfElse",r),o(),dt("src",e.ThumbnailUrl,Hi),o(4),m("ngIf",l.pageData==null||l.pageData.Filter==null?null:l.pageData.Filter.GroupByProduct)("ngIfElse",t),o(4),T(e.Code),o(4),v(" ",y(18,14,e.Released,"dd MMM yyyy")," "),o(2),m("matTooltip",y(20,17,e.Released,"dd MMM yyyy")+" - "+y(21,20,l.today,"dd MMM yyyy")),o(3),v("",C(23,23,e.ReleasedDays)," days"),o(3),T(C(26,25,e.Purchased)),o(2),Mi(e==null?null:e.Intervals),o(4),T(C(32,27,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),o(4),v(" ",y(36,29,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),o(2),Nt((e==null||e.Intervals==null?null:e.Intervals.length)>0?37:-1),o(2),T(C(40,32,e.Inventory))}}function Ow(i,c){if(i&1){let e=F();se(0),n(1,"POS-complex-pagination",59),P("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a(),ce()}if(i&2){let e=s();o(),m("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var Ga=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=f;this.dialog=w}intervalDays=mt(30);today=new Date;defaultReleasedType=mt(0);hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let r=JSON.parse(JSON.stringify(e));this.data.Data=r.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((f,w)=>(t[`Interval${w}`]=f.Value,f.Percentage=this.calculatePercentage(f.Value,t.Purchased),t[`Percentage${w}`]=f.Percentage,f)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((f,w)=>f+w.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let r=0;if(e){let t=new Date,l=new Date(e);r=M.differentInDays(l,t)}return r}calculatePercentage(e,r){let t=0;return r!==0&&(t=e/r*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null,this.defaultReleasedType.set(this.pageData.Filter.ReleasedType)}onZoomImage(e,r){this.biggerPictureService.openBiggerPicture(e,r)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";return this.compare(t[e.active],l[e.active],f)})}openExportModal(){this.dialog.open(q,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}onProductTagChange(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType())}preGetList(){(this.pageData.Filter.ListTagID?.length||0)>1&&(this.pageData.Filter.ReleasedType=this.defaultReleasedType()),super.preGetList()}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(Oe),D(Dn),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[R],decls:52,vars:24,consts:[["pageFilterTemplate",""],["NO_IMAGE",""],["SCPOPE_VARIANT",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],[4,"ngIf"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["optionLabel","Name","optionValue","ID","name","ListTagID","placeholder","Choose Product Tag","display","chip","fluid","",3,"ngModelChange","ngModel","options","showClear","maxSelectedLabels"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],["name","ReleasedType",3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],[4,"ngIf","ngIfElse"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",3),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"filters"),g(2,Dw,39,24,"ng-template",null,0,V),a(),n(4,"actions"),g(5,vw,3,0,"button",4),n(6,"div",5)(7,"button",6),p(8," More "),a(),n(9,"ul",7)(10,"li")(11,"a",8),p(12," Product Sold "),a()(),n(13,"li")(14,"a",8),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",8),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",8),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",8),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",8),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",9)(30,"div",10)(31,"table",11),P("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(32,"thead",12)(33,"tr")(34,"th",13),p(35,"Name"),a(),n(36,"th",14),p(37," Released "),a(),n(38,"th",15),p(39," Purchased "),a(),Ei(40,ww,4,5,null,null,za),n(42,"th",16),p(43),a(),n(44,"th",17),p(45," % "),a(),g(46,Tw,9,14,"ng-container",18),n(47,"th",19),p(48," On Hand "),a()()(),n(49,"tbody"),g(50,Bw,41,34,"tr",20),a()()(),g(51,Ow,2,2,"ng-container",18),a()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("hideSearchBox",!0),o(5),m("ngIf",t.role==null||t.role.global==null?null:t.role.global.Export),o(6),m("routerLink",b(18,gw)),o(3),m("routerLink",b(19,fw)),o(3),m("routerLink",b(20,Cw)),o(3),m("routerLink",b(21,xw)),o(3),m("routerLink",b(22,hw)),o(3),m("routerLink",b(23,Sw)),o(14),Mi(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),o(2),m("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(),v(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),o(),m("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),o(2),m("ngIf",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,K,ke,Po,B,L,pe,ae,ge,Qe,De,bt,fe,Q,Ko,ie,ee],encapsulation:2})};var Lw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Rw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],kw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Ww=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Aw=()=>["/menu/Contacts/Contact/Customers/Info"],Gw=i=>({ID:i}),Hw=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Qw=i=>({CustomerID:i});function Yw(i,c){if(i&1){let e=F();n(0,"a",12),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",13),p(2," Export "),a()}}function jw(i,c){if(i&1){let e=F();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",17)(9,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function qw(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",21),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),d(11,"date"),a(),n(12,"td"),p(13),a(),n(14,"td")(15,"a",21),p(16),a()(),n(17,"td"),p(18),d(19,"number"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(19,Aw))("queryParams",U(20,Gw,e.CustomerID)),o(),T(e.Name),o(2),T(e.Mobile),o(2),T(y(8,11,e.FirstPurchase,"dd/MM/yyyy")),o(3),T(y(11,14,e.LastPurchase,"dd/MM/yyyy")),o(3),T(e.Days),o(2),m("routerLink",b(22,Hw))("queryParams",U(23,Qw,e.CustomerID)),o(),T(e.Orders),o(2),T(C(19,17,e.Amount))}}function Uw(i,c){if(i&1&&(n(0,"tbody",19),g(1,qw,20,25,"tr",20),a()),i&2){let e=s();o(),m("ngForOf",e.data.Data)}}var Ha=class i extends he{constructor(e,r,t,l,f){super(e,r,"SalesReport/CustomerLastPurchase");this.httpService=r;this.matDialog=t;this.datePipe=l;this.roleService=f}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(q,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(j),D(ee),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[R],decls:45,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],["class","border-bottom",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yw,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),g(23,jw,10,6,"ng-template",null,0,V),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"Mobile"),a(),n(34,"th"),p(35,"First Purchase"),a(),n(36,"th"),p(37,"Last Purchase"),a(),n(38,"th",10),p(39,"Days Ago"),a(),n(40,"th"),p(41,"Orders"),a(),n(42,"th"),p(43,"Amount"),a()()(),g(44,Uw,2,1,"tbody",11),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Lw)),o(3),m("routerLink",b(12,Rw)),o(3),m("routerLink",b(13,kw)),o(3),m("routerLink",b(14,Ww)),o(3),m("routerLink",b(15,Nw)),o(24),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,Q,ie,ee],encapsulation:2})};var Ri=Qt(mr()),Xr=Qt(no());var Ht=Qt(Oi());var Kw=["outletSelectorRef"],zw=(i,c)=>c.Key;function Xw(i,c){if(i&1){let e=F();n(0,"mat-chip",9),P("removed",function(){let t=u(e).$implicit,l=s();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),I(4,"i",12),a()()}if(i&2){let e=c.$implicit;o(2),T(e.Value)}}var Qa=class i{constructor(c){this._dialogRef=c;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=Bi.Success,this.pageData.set(this.data.pageData)}modalConfig=new Ci;data=Ge($t);pageData=mt(null);injector=Ge(Ai);variant$;#e=Ge(O);listVariantSelected=mt([]);toastr=Ge(Ke);route=Ge(Oe);outletSelector;itemHashMap=new Map;router=Ge(zi);productOrVarariantAPIURL=mt("");minDateFrom=mt((0,Ht.default)().subtract(90,"days"));maxDateFrom=mt((0,Ht.default)().subtract(2,"days"));minDateTo=mt((0,Ht.default)().subtract(90,"days"));maxDateTo=mt((0,Ht.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){Ji(this.pageData,{injector:this.injector}).pipe(ri(c=>!!c),Ni(),kt(c=>{let e=c.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(kt(c=>{c.keys.length>0?this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{From:c.get("From"),To:c.get("To"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[],ListVariantID:c.get("ListVariantID")?c.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(c.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,Ht.default)().subtract(2,"days")),this.minDateFrom.set((0,Ht.default)().subtract(90,"days")),this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{From:(0,Ht.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(c,e,r){let t=[...c,...e];return Array.from(new Set(t.map(f=>f[r]))).map(f=>t.find(w=>w[r]===f))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(c=>c&&c.keys.length>0),po(c=>{let r=[...c.get("ListVariantID").split(","),c.get("ID")].filter(f=>f),t=JSON.parse(c.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(c.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(r)]};return this.#e.post(t,l).pipe(Ii(()=>si(null)))}),ri(c=>!!c),kt(c=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),c,"Key"))})).subscribe()}onVariantSelected(c){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",r={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(c).Key]};this.#e.post(e,r).pipe(Ii(()=>si(null)),kt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(c){this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{GroupByVariant:c})})),this.listVariantSelected.set([])}onRemoveHandler(c){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==c.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",Bi.Warning);return}this.pageData.update(e=>et(Je({},e),{Filter:et(Je({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(r=>r.Key)]})})),this._dialogRef.close({role:"OK",data:Je({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,Ht.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,Ht.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(D(Zt))};static \u0275cmp=E({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,r){if(e&1&&Qi(Kw,5),e&2){let t;Yi(t=ji())&&(r.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.close()})("onClose",function(){return r.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),S("ngModelChange",function(l){return h(r.pageData().Filter.ListIDs,l)||(r.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),P("optionSelected",function(l){return r.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),Ei(12,Xw,5,1,"mat-chip",null,zw),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),S("dateChange",function(l){return h(r.pageData().Filter.From,l)||(r.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),S("dateChange",function(l){return h(r.pageData().Filter.To,l)||(r.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),P("modelChange",function(l){return r.onScopeChange(l)}),a()()()()),e&2&&(m("config",r.modalConfig),o(6),m("multiple",!0)("accessType",2)("outlets",r.pageData().Options.Entities),x("ngModel",r.pageData().Filter.ListIDs),o(4),m("matTooltip",r.tooltipMessage)("readonly",r.listVariantSelected().length>=5)("requestUrl",r.productOrVarariantAPIURL())("clearOnSelect",!0),o(2),Mi(r.listVariantSelected()),o(5),m("maxDateValidation",r.maxDateFrom())("minDateValidation",r.minDateFrom()),x("date",r.pageData().Filter.From),o(),m("maxDateValidation",r.maxDateTo())("minDateValidation",r.minDateTo()),x("date",r.pageData().Filter.To),o(3),m("model",r.pageData().Filter.GroupByVariant)("options",r.scopeFilter))},dependencies:[Jt,At,B,L,hi,_n,ei,Q,Si,K,lr,or,ar,rr,hn,De,xn,Le,$i,pe],styles:["[_nghost-%COMP%]{display:block}"]})};var ai=Qt(Oi());var Jw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Zw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],$w=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],e3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],t3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],i3=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function n3(i,c){}(0,Xr.default)(Ri.default);var Ya=class i{constructor(c,e,r,t,l,f,w,Ee,xt){this.route=c;this.httpService=e;this.pageSetupService=r;this.matDialog=t;this.toastr=l;this.title=f;this.cdr=w;this.injector=Ee;this.router=xt}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=mt(null);Highcharts=mt(Ri.default);variantOrProductItems=mt([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),r=this.route.snapshot.queryParamMap.get("To"),t=(0,ai.default)(e).isSame((0,ai.default)(r),"day");this.router.navigate([],{queryParams:{From:t?(0,ai.default)(r).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ai.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ai.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(Rt(1))}parseQueryParams(c){let e=c.get("ID")?[c.get("ID")]:c.get("ListVariantID")?[...c.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(c.get("GroupByVariant")||"false"),From:(0,ai.default)(c.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ai.default)(c.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(c,e){let r=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(r,{[e?"ListVariantID":"ListProductID"]:c}).pipe(ri(t=>!!t),Yt(t=>({Key:t.Key,Value:t.Value})),Rt(1))}fetchChartQuantitySold(c){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",c).pipe(Yt(e=>et(Je({},e),{chart:{type:"spline"},series:e.Data.Series.map((r,t)=>et(Je({},r),{data:r.data,name:r.name,color:this.colorsChart[t]}))})),kt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Ii(e=>si(null)),Rt(1))}handleVariantOrProductItems(){let c=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:r}=this.parseQueryParams(c);this.fetchVariantOrProductItems(e,r).pipe(kt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(mo(100),Ua(c=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let r=this.parseQueryParams(e);return this.fetchChartQuantitySold(r)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(c.Filter)}),Rt(1)),qa([this.chartData$,this.pageSetupService.menu$]).pipe(Yt(([c,e])=>({chartData:c,menu:et(Je({},e),{H:c.FullPageTitle,T:e.T.replace("undefined",c.FullPageTitle)})})),kt(({chartData:c,menu:e})=>{this.menu$=si(e),this.seriesData.set(c.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(c){let e=document.cookie.match(new RegExp("(?:^|; )"+c.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){Ji(this.seriesData,{injector:this.injector}).pipe(ri(c=>!!c),Ni(),kt(c=>Ri.default.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Ri.default.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(c.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:c.Series.map((e,r)=>et(Je({},e),{color:this.colorsChart[r]}))}))).subscribe()}openDialogFilter(){qa([this.loader$]).pipe(Yt(([c])=>({loader:c})),Ua(({loader:c})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,r=et(Je({},c),{Filter:et(Je({},c.Filter),{From:e?e.from:c.Filter.From,To:e?e.to:c.Filter.To})});return this.matDialog.open(Qa,{data:{pageData:r}}).afterClosed()}),kt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(D(Oe),D(O),D(W),D(j),D(Ke),D(Do),D(xo),D(Ai),D(zi))};static \u0275cmp=E({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,r){if(e&1){let t=F();n(0,"mainpanel-cmp",1),d(1,"async"),se(2,2),n(3,"nav",3)(4,"div",4),P("click",function(){return u(t),_(r.openDialogFilter())}),I(5,"i",5)(6,"i",6),a()(),ce(),se(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),ce(),se(30,12),g(31,n3,0,0,"ng-template",null,0,V),ce(),n(33,"content"),I(34,"div",13),a()()}e&2&&(m("pageData",C(1,9,r.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),o(13),m("routerLink",b(11,Jw)),o(3),m("routerLink",b(12,Zw)),o(3),m("routerLink",b(13,$w)),o(3),m("routerLink",b(14,e3)),o(3),m("routerLink",b(15,t3)),o(3),m("routerLink",b(16,i3)))},dependencies:[Jt,Ki,Vi,A,hi,N,Si,At],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var a3=[{path:"Sales_Report/Standard/Detail",component:wn},{path:"Sales_Report/Standard/Summary",component:Pn},{path:"Sales_Report/Standard/Top_Brand",component:Fn},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:La},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:ba},{path:"Sales_Report/Standard/Top_Customers",component:bn},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:Ha},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:En},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:Mn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:Vn},{path:"Sales_Report/Standard/Top_Customers/City",component:Ca},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:xa},{path:"Sales_Report/Standard/Products_Sold",component:Bn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:Ya},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:Ga},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:On},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:Ln},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:Rn},{path:"Sales_Report/Standard/Category_Sold",component:Wa},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:kn},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:Wn},{path:"Sales_Report/Standard/Category_Sold/Category",component:Nn},{path:"Sales_Report/Standard/Peak",component:An},{path:"Sales_Report/Standard/Peak/Peak",component:Hn},{path:"Sales_Report/Standard/Daily",component:Qn},{path:"Sales_Report/Standard/Daily/Daily_Table",component:Un},{path:"Sales_Report/Standard/Monthly",component:jn},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:Kn},{path:"Sales_Report/Standard/Yearly",component:ka},{path:"Sales_Report/Standard/Yearly/Comparison",component:qn},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:zn},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:Xn},{path:"Sales_Report/Standard/Outlet_Performance",component:Zn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Jn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:$n},{path:"Sales_Report/Standard/Sales_Order_Tag",component:Ea},{path:"Sales_Report/Standard/Person",component:ta},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:Aa},{path:"Sales_Report/Standard/Person/Commission_Report",component:ia},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:na},{path:"Sales_Report/Standard/Person/Sales_Group",component:ha},{path:"Sales_Report/Standard/Discounted_Sales",component:Na},{path:"Purchases_Report/Detail",component:aa},{path:"Purchases_Report/Summary",component:oa},{path:"Purchases_Report/Supplier",component:ra},{path:"Purchases_Report/Product",component:la},{path:"Purchases_Report/History",component:ma},{path:"Purchases_Report/Daily",component:sa},{path:"Purchases_Report/Daily/Monthly",component:ca},{path:"Purchases_Report/Volume",component:da},{path:"Purchases_Report/Sales",component:ua},{path:"Purchases_Report/Tax",component:Oa},{path:"Purchases_Report/Outlet",component:_a},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:ga},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:fa},{path:"Sales_Report/Standard/Compare",component:Ra},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:ea},{path:"Sales_Report/Advanced/Tax_Report",component:Sa},{path:"Sales_Report/Advanced/Visitor",component:Gn},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:ya},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Da},{path:"Sales_Report/Advanced/Product_Profit",component:va},{path:"Sales_Report/Advanced/Exchanged_Sales",component:wa},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Ta},{path:"Sales_Report/Advanced/Logistics_Service",component:gr},{path:"Return/Sales_Return",component:Pa},{path:"Return/Purchase_Return",component:Fa},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:Ia},{path:"Sales_Report/Standard/Price_Analysis",component:Ba},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],ja=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=di({type:i});static \u0275inj=ci({imports:[Vi.forChild(a3),Vi]})};var o3=["input"],r3=({dt:i})=>`
12
12
  .p-toggleswitch {
13
13
  display: inline-block;
14
14
  width: ${i("toggleswitch.width")};
@@ -109,4 +109,4 @@ import{a as ni,b as sr}from"./chunk-NVWJ6HZD.js";import{a as ur,b as _r}from"./c
109
109
  .p-toggleswitch.p-disabled .p-toggleswitch-slider:before {
110
110
  background: ${i("toggleswitch.handle.disabled.background")};
111
111
  }
112
- `,l3={root:{position:"relative"}},p3={root:({instance:i})=>({"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.disabled,"p-invalid":i.invalid}),input:"p-toggleswitch-input",slider:"p-toggleswitch-slider"},Jr=(()=>{class i extends bo{name="toggleswitch";theme=r3;classes=p3;inlineStyles=l3;static \u0275fac=(()=>{let e;return function(t){return(e||(e=Ka(i)))(t||i)}})();static \u0275prov=co({token:i,factory:i.\u0275fac})}return i})(),m3={provide:vo,useExisting:so(()=>Zr),multi:!0},Zr=(()=>{class i extends Eo{style;styleClass;tabindex;inputId;name;disabled;readonly;trueValue=!0;falseValue=!1;ariaLabel;ariaLabelledBy;autofocus;onChange=new Gi;input;modelValue=!1;focused=!1;onModelChange=()=>{};onModelTouched=()=>{};_componentStyle=Ge(Jr);onClick(e){!this.disabled&&!this.readonly&&(this.modelValue=this.checked()?this.falseValue:this.trueValue,this.onModelChange(this.modelValue),this.onChange.emit({originalEvent:e,checked:this.modelValue}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}writeValue(e){this.modelValue=e,this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}checked(){return this.modelValue===this.trueValue}static \u0275fac=(()=>{let e;return function(t){return(e||(e=Ka(i)))(t||i)}})();static \u0275cmp=E({type:i,selectors:[["p-inputSwitch"],["p-inputswitch"]],viewQuery:function(r,t){if(r&1&&Qi(o3,5),r&2){let l;Yi(l=ji())&&(t.input=l.first)}},inputs:{style:"style",styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",ho],inputId:"inputId",name:"name",disabled:[2,"disabled","disabled",Ui],readonly:[2,"readonly","readonly",Ui],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",Ui]},outputs:{onChange:"onChange"},features:[ui([m3,Jr]),R],decls:5,vars:22,consts:[["input",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["type","checkbox","role","switch",3,"focus","blur","ngClass","checked","disabled","pAutoFocus"],[3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"div",1),P("click",function(w){return u(l),_(t.onClick(w))}),n(1,"div",2)(2,"input",3,0),P("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a()(),F(4,"span",4),a()}r&2&&(go(t.styleClass),m("ngClass",t.cx("root"))("ngStyle",t.sx("root"))("ngStyle",t.style),jt("data-pc-name","inputswitch")("data-pc-section","root"),o(),jt("data-pc-section","hiddenInputWrapper")("data-p-hidden-accessible",!0),o(),m("ngClass",t.cx("input"))("checked",t.checked())("disabled",t.disabled)("pAutoFocus",t.autofocus),jt("id",t.inputId)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name)("tabindex",t.tabindex)("data-pc-section","hiddenInput"),o(2),m("ngClass",t.cx("slider")),jt("data-pc-section","slider"))},dependencies:[Jt,He,yo,Vo,Mo,Zi],encapsulation:2,changeDetection:0})}return i})(),$r=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=di({type:i});static \u0275inj=ci({imports:[Zr,Zi,Zi]})}return i})();var el=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=di({type:i});static \u0275inj=ci({providers:[ee],imports:[hi,jo,Jt,ja,z,Si,At,Xi,gi,mn,ko,fi,Ro,Wo,$i,No,Ao,z,Oo,Lo,Go,_n,hn,sr,cr,xn,Xo,dr,q,yi,li,nr,li,fe,Q,Uo,Ye,ii,$r,qo,_r,yn,Pi,zo]})};export{el as ReportsModule};
112
+ `,l3={root:{position:"relative"}},p3={root:({instance:i})=>({"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.disabled,"p-invalid":i.invalid}),input:"p-toggleswitch-input",slider:"p-toggleswitch-slider"},Jr=(()=>{class i extends bo{name="toggleswitch";theme=r3;classes=p3;inlineStyles=l3;static \u0275fac=(()=>{let e;return function(t){return(e||(e=Ka(i)))(t||i)}})();static \u0275prov=co({token:i,factory:i.\u0275fac})}return i})(),m3={provide:vo,useExisting:so(()=>Zr),multi:!0},Zr=(()=>{class i extends Eo{style;styleClass;tabindex;inputId;name;disabled;readonly;trueValue=!0;falseValue=!1;ariaLabel;ariaLabelledBy;autofocus;onChange=new Gi;input;modelValue=!1;focused=!1;onModelChange=()=>{};onModelTouched=()=>{};_componentStyle=Ge(Jr);onClick(e){!this.disabled&&!this.readonly&&(this.modelValue=this.checked()?this.falseValue:this.trueValue,this.onModelChange(this.modelValue),this.onChange.emit({originalEvent:e,checked:this.modelValue}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}writeValue(e){this.modelValue=e,this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}checked(){return this.modelValue===this.trueValue}static \u0275fac=(()=>{let e;return function(t){return(e||(e=Ka(i)))(t||i)}})();static \u0275cmp=E({type:i,selectors:[["p-inputSwitch"],["p-inputswitch"]],viewQuery:function(r,t){if(r&1&&Qi(o3,5),r&2){let l;Yi(l=ji())&&(t.input=l.first)}},inputs:{style:"style",styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",ho],inputId:"inputId",name:"name",disabled:[2,"disabled","disabled",Ui],readonly:[2,"readonly","readonly",Ui],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",Ui]},outputs:{onChange:"onChange"},features:[ui([m3,Jr]),R],decls:5,vars:22,consts:[["input",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["type","checkbox","role","switch",3,"focus","blur","ngClass","checked","disabled","pAutoFocus"],[3,"ngClass"]],template:function(r,t){if(r&1){let l=F();n(0,"div",1),P("click",function(w){return u(l),_(t.onClick(w))}),n(1,"div",2)(2,"input",3,0),P("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a()(),I(4,"span",4),a()}r&2&&(go(t.styleClass),m("ngClass",t.cx("root"))("ngStyle",t.sx("root"))("ngStyle",t.style),jt("data-pc-name","inputswitch")("data-pc-section","root"),o(),jt("data-pc-section","hiddenInputWrapper")("data-p-hidden-accessible",!0),o(),m("ngClass",t.cx("input"))("checked",t.checked())("disabled",t.disabled)("pAutoFocus",t.autofocus),jt("id",t.inputId)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name)("tabindex",t.tabindex)("data-pc-section","hiddenInput"),o(2),m("ngClass",t.cx("slider")),jt("data-pc-section","slider"))},dependencies:[Jt,He,yo,Vo,Mo,Zi],encapsulation:2,changeDetection:0})}return i})(),$r=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=di({type:i});static \u0275inj=ci({imports:[Zr,Zi,Zi]})}return i})();var el=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=di({type:i});static \u0275inj=ci({providers:[ee],imports:[hi,jo,Jt,ja,z,Si,At,Xi,gi,mn,ko,fi,Ro,Wo,$i,No,Ao,z,Oo,Lo,Go,_n,hn,sr,cr,xn,Xo,dr,q,yi,li,nr,li,fe,Q,Uo,Ye,ii,$r,qo,_r,yn,Pi,zo]})};export{el as ReportsModule};