dealpos 26.19.2 → 26.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/browser/{chunk-EOCE2O64.js → chunk-222ST6BV.js} +1 -1
  2. package/browser/{chunk-BSQ4IMR7.js → chunk-23YYZHYE.js} +1 -1
  3. package/browser/{chunk-OWXNG34O.js → chunk-2GKOGCQL.js} +1 -1
  4. package/browser/{chunk-ERHO76Z3.js → chunk-3AI3Q3ND.js} +1 -1
  5. package/browser/{chunk-DG4BUBUL.js → chunk-3N76PC4G.js} +2 -2
  6. package/browser/{chunk-LT6JP4SJ.js → chunk-3QFVPGT2.js} +1 -1
  7. package/browser/{chunk-K7LXQZ6U.js → chunk-4IZBOUZR.js} +1 -1
  8. package/browser/{chunk-J4TFUX4X.js → chunk-4ZYB3EZJ.js} +1 -1
  9. package/browser/{chunk-EJS77L7Y.js → chunk-54SYBLEP.js} +1 -1
  10. package/browser/{chunk-P6MSVUMP.js → chunk-57SVR7NW.js} +1 -1
  11. package/browser/{chunk-OTGPZNBU.js → chunk-5B27RDU7.js} +14 -14
  12. package/browser/{chunk-MERI4X23.js → chunk-5W5K2LNS.js} +1 -1
  13. package/browser/{chunk-EMZGYUWV.js → chunk-5XH3RMP4.js} +1 -1
  14. package/browser/{chunk-O32TIOBA.js → chunk-67HWCOXD.js} +1 -1
  15. package/browser/{chunk-UEBD6W4H.js → chunk-67MUU2VE.js} +1 -1
  16. package/browser/{chunk-IKPNTIU3.js → chunk-6WYKK3OG.js} +1 -1
  17. package/browser/{chunk-D3ZGNT4J.js → chunk-74E2IF65.js} +1 -1
  18. package/browser/{chunk-VN65ZKSP.js → chunk-7AJX7U3R.js} +1 -1
  19. package/browser/{chunk-AXGSLQYT.js → chunk-7ASMIHFW.js} +1 -1
  20. package/browser/{chunk-FD24AM3O.js → chunk-7AX6S7TS.js} +1 -1
  21. package/browser/{chunk-XCY5YJI5.js → chunk-7HCL5AUK.js} +1 -1
  22. package/browser/{chunk-3QKHIX5O.js → chunk-7KKDBUAN.js} +1 -1
  23. package/browser/{chunk-3I4OJPN4.js → chunk-7QGD5FN2.js} +1 -1
  24. package/browser/{chunk-ELZ4BFZ6.js → chunk-AF5QRZTS.js} +2 -2
  25. package/browser/{chunk-A2EXEMPZ.js → chunk-ANOCHK5D.js} +1 -1
  26. package/browser/{chunk-ZJPITW6V.js → chunk-AV6LL7T7.js} +1 -1
  27. package/browser/{chunk-3KCJWTWS.js → chunk-AXR24KU4.js} +1 -1
  28. package/browser/{chunk-URPDCGAB.js → chunk-B66QPHH2.js} +2 -2
  29. package/browser/{chunk-36NQKESG.js → chunk-B7EOVJ3W.js} +1 -1
  30. package/browser/{chunk-V2S5KCOO.js → chunk-BBBEI4JU.js} +1 -1
  31. package/browser/{chunk-TQXFRJTB.js → chunk-BQ4WTL5Z.js} +1 -1
  32. package/browser/{chunk-VRJ3UFDM.js → chunk-C6FPMO5E.js} +1 -1
  33. package/browser/{chunk-5C55YZTD.js → chunk-CHRHJOU7.js} +1 -1
  34. package/browser/{chunk-YPG46AFP.js → chunk-CK3Z53JE.js} +1 -1
  35. package/browser/{chunk-EDZTV4NC.js → chunk-CPC57TKX.js} +1 -1
  36. package/browser/{chunk-BTLVWR2Z.js → chunk-D5Q3KRFY.js} +1 -1
  37. package/browser/{chunk-3CXLRUBF.js → chunk-DIRDQNW6.js} +1 -1
  38. package/browser/{chunk-3BJIND2I.js → chunk-DM5M3VPU.js} +1 -1
  39. package/browser/{chunk-YEOLAQGH.js → chunk-DR77HZH3.js} +2 -2
  40. package/browser/{chunk-V4ERSEQK.js → chunk-DRWABVFT.js} +1 -1
  41. package/browser/{chunk-65U2TQMH.js → chunk-F3VGQ57K.js} +1 -1
  42. package/browser/{chunk-FNIIKV7X.js → chunk-G2DKN5OW.js} +1 -1
  43. package/browser/{chunk-KTVYCWKQ.js → chunk-GHIZ6KU6.js} +1 -1
  44. package/browser/{chunk-D46Z5LZF.js → chunk-GUJJHZVX.js} +1 -1
  45. package/browser/{chunk-MY62EXE6.js → chunk-GXPJQTIT.js} +1 -1
  46. package/browser/{chunk-AP4BNDXV.js → chunk-H3UVK2QX.js} +1 -1
  47. package/browser/{chunk-XRPM6WMA.js → chunk-HL226HMZ.js} +1 -1
  48. package/browser/{chunk-6XAYGQXG.js → chunk-HRJKLOPH.js} +1 -1
  49. package/browser/{chunk-GGS7WX4W.js → chunk-I2A7YSSS.js} +1 -1
  50. package/browser/{chunk-LRXS3QTY.js → chunk-IMB4WO7C.js} +1 -1
  51. package/browser/{chunk-T22QKCZK.js → chunk-ISO2YCY7.js} +1 -1
  52. package/browser/{chunk-WGQ4V5IA.js → chunk-ITIPUQFU.js} +1 -1
  53. package/browser/{chunk-P62BUWTW.js → chunk-IUG65W2Y.js} +1 -1
  54. package/browser/{chunk-VMNDRJWK.js → chunk-JFYIZWQX.js} +1 -1
  55. package/browser/{chunk-FFEIL3TN.js → chunk-JQUC4D3I.js} +1 -1
  56. package/browser/{chunk-DZECOXOJ.js → chunk-JUZ5F54S.js} +1 -1
  57. package/browser/{chunk-FABNEHCT.js → chunk-K4ITYVID.js} +1 -1
  58. package/browser/{chunk-QNOZD4IA.js → chunk-KA27DE2Y.js} +1 -1
  59. package/browser/chunk-KAD556EB.js +1 -0
  60. package/browser/{chunk-OHMDXE4H.js → chunk-KDFPGH7S.js} +1 -1
  61. package/browser/{chunk-5U5FOY7E.js → chunk-KW6EH3HE.js} +1 -1
  62. package/browser/{chunk-PQ5KIK37.js → chunk-LAYUYVB5.js} +2 -2
  63. package/browser/{chunk-MMNDNTKP.js → chunk-LDPSHDVZ.js} +9 -9
  64. package/browser/{chunk-S7NR52EQ.js → chunk-LVY72SE2.js} +1 -1
  65. package/browser/{chunk-5Q4JDHFV.js → chunk-MV3KSMZT.js} +1 -1
  66. package/browser/{chunk-JENIKNBZ.js → chunk-NNSC3LJC.js} +1 -1
  67. package/browser/{chunk-TUYSR2EK.js → chunk-OHKCP34R.js} +1 -1
  68. package/browser/{chunk-2OH7NF4Y.js → chunk-OIUUHVYE.js} +2 -2
  69. package/browser/{chunk-L23L6S47.js → chunk-PV2KXL45.js} +1 -1
  70. package/browser/{chunk-Z34WDVCI.js → chunk-QXVRUFQX.js} +1 -1
  71. package/browser/{chunk-PODEZ52K.js → chunk-R4WRYN66.js} +1 -1
  72. package/browser/{chunk-NBKP2GUU.js → chunk-RVZTJFUM.js} +1 -1
  73. package/browser/{chunk-KVUCAVGG.js → chunk-S6HF7TYD.js} +1 -1
  74. package/browser/{chunk-5C2RQFRO.js → chunk-SJZA6OKN.js} +1 -1
  75. package/browser/{chunk-374ZFJTF.js → chunk-SNNAJP4J.js} +1 -1
  76. package/browser/{chunk-HNBNOK55.js → chunk-TNHVTQN6.js} +1 -1
  77. package/browser/{chunk-5HAG322O.js → chunk-TQ56EBCT.js} +1 -1
  78. package/browser/{chunk-664LON7O.js → chunk-U4HQSNDI.js} +1 -1
  79. package/browser/{chunk-GU47QXR6.js → chunk-U6TL3NX4.js} +1 -1
  80. package/browser/{chunk-HZOXLDQY.js → chunk-U7A2LIM6.js} +1 -1
  81. package/browser/{chunk-ALLNKHAS.js → chunk-UAKYIKEV.js} +1 -1
  82. package/browser/{chunk-V5M6O6GP.js → chunk-UMMOBUSP.js} +1 -1
  83. package/browser/{chunk-CGZJPCLP.js → chunk-UQ5PBFGR.js} +1 -1
  84. package/browser/{chunk-RS6FMBMF.js → chunk-UVTB2JUC.js} +1 -1
  85. package/browser/{chunk-YTDGG2OX.js → chunk-UYDGQ2J6.js} +1 -1
  86. package/browser/{chunk-HJINCDBS.js → chunk-V4AZXNFY.js} +1 -1
  87. package/browser/{chunk-BNY2RDEO.js → chunk-V7FSMA5I.js} +1 -1
  88. package/browser/{chunk-QKQBLQDF.js → chunk-VTO7AEJ7.js} +1 -1
  89. package/browser/{chunk-HIZ3R7YG.js → chunk-VYPFXHYZ.js} +1 -1
  90. package/browser/{chunk-7FVJJKZR.js → chunk-WORMAWOA.js} +1 -1
  91. package/browser/{chunk-BGTDXTCL.js → chunk-WWPIIY42.js} +1 -1
  92. package/browser/{chunk-QOQYCAZN.js → chunk-XBNN4C3K.js} +1 -1
  93. package/browser/{chunk-77XRZD4H.js → chunk-XPDSAELN.js} +1 -1
  94. package/browser/{chunk-YPLYDE5K.js → chunk-XVWSK6AP.js} +1 -1
  95. package/browser/{chunk-RJSQDNAL.js → chunk-XWPWQ66M.js} +1 -1
  96. package/browser/{chunk-TRCDJIF7.js → chunk-Y2Y2L2HC.js} +1 -1
  97. package/browser/{chunk-XKQBCZON.js → chunk-YDOG2VTF.js} +1 -1
  98. package/browser/{chunk-GIGZV3LY.js → chunk-YGEC7V4O.js} +1 -1
  99. package/browser/chunk-ZAMJXORL.js +1 -0
  100. package/browser/{chunk-6VKSVXA7.js → chunk-ZF2I7CAB.js} +1 -1
  101. package/browser/{chunk-7A4XI3TC.js → chunk-ZFXYWCIT.js} +1 -1
  102. package/browser/{chunk-GAUFDMOM.js → chunk-ZHB3TNAM.js} +2 -2
  103. package/browser/{chunk-BL7JFSDO.js → chunk-ZVYG6FFO.js} +1 -1
  104. package/browser/index.html +2 -2
  105. package/browser/{main-MIVOS5IA.js → main-JHQFLMM7.js} +2 -2
  106. package/package.json +1 -1
  107. package/browser/chunk-5ZE3YOQU.js +0 -1
  108. package/browser/chunk-7GOH2CDV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ii,b as hr}from"./chunk-BWRSAUCR.js";import{a as Sr}from"./chunk-LCO3LO7L.js";import{a as ve}from"./chunk-BL7JFSDO.js";import{a as Dr}from"./chunk-HJINCDBS.js";import{a as ze}from"./chunk-NOF55KZZ.js";import{a as Ft,b as yr}from"./chunk-GWQWKZCJ.js";import{a as Ot}from"./chunk-XJTZNTJ7.js";import{b as vr}from"./chunk-DI3HRQ2Y.js";import{a as En}from"./chunk-NEKBV3FU.js";import{a as wi}from"./chunk-3KDQ42LP.js";import{a as st}from"./chunk-P2I7DDV6.js";import{a as Ho}from"./chunk-BW3AS55J.js";import{b as qo}from"./chunk-LPFB4TBW.js";import"./chunk-YECO23BV.js";import{a as Di}from"./chunk-J6SDXI74.js";import{a as Lt}from"./chunk-5FGX2TVD.js";import{a as Ti}from"./chunk-MERI4X23.js";import{a as $t}from"./chunk-NBKP2GUU.js";import{a as mr,b as sr,c as dr,e as cr,f as ur,g as _r}from"./chunk-J4TFUX4X.js";import"./chunk-XV3LZZ5N.js";import{a as bn,b as pi}from"./chunk-AVOTGRPZ.js";import{a as Cr,b as gr,d as xr,g as fr}from"./chunk-ZOY3GIWS.js";import{e as jo}from"./chunk-CIDPGJ5I.js";import"./chunk-6FI765LW.js";import{a as ti,b as pr,c as Fn,d as X}from"./chunk-3XXHI4EL.js";import{a as vi}from"./chunk-XC2DOMTX.js";import{c as xn,d as fn,e as Sn,m as gi}from"./chunk-OFAMZL4W.js";import{a as cn,b as un,c as _n,d as hn}from"./chunk-PRC6BIGW.js";import{b as Dn,c as xi}from"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import{b as yn}from"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import{b as le,c as ge,d as Go}from"./chunk-W2DHHNBD.js";import{a as Pt,b as lr}from"./chunk-MVXEAR7T.js";import{b as tr,c as ir,e as ce}from"./chunk-JENIKNBZ.js";import"./chunk-BGTDXTCL.js";import{c as nr,d as ar}from"./chunk-HMG4CYEC.js";import"./chunk-NS7JQEFX.js";import{a as Z}from"./chunk-45724ODM.js";import{a as U}from"./chunk-VMNDRJWK.js";import{b as or,c as rr}from"./chunk-P6MSVUMP.js";import{c as Qo,d as we}from"./chunk-DU3EU6UY.js";import{a as ie}from"./chunk-ZDHOVOGV.js";import"./chunk-5FZQUUGO.js";import"./chunk-PODEZ52K.js";import"./chunk-FKYSDVEG.js";import"./chunk-ELS45DNO.js";import"./chunk-TMLUWER3.js";import{b as z}from"./chunk-4OXYU3IN.js";import"./chunk-S5D6TMC7.js";import{a as pe}from"./chunk-FD24AM3O.js";import{a as Ao}from"./chunk-P62BUWTW.js";import"./chunk-GQLZJQI6.js";import{c as Uo}from"./chunk-Z3E6ZNA3.js";import"./chunk-KCKWSNMS.js";import"./chunk-IEXCLXA2.js";import{a as Ke}from"./chunk-7TPO6NBM.js";import"./chunk-NS5MW6GH.js";import"./chunk-WQ627RLB.js";import"./chunk-QKQBLQDF.js";import"./chunk-YQH2QORC.js";import"./chunk-ZAPREM3S.js";import"./chunk-X36HAWOW.js";import"./chunk-KXQNUECI.js";import"./chunk-QWL5S2RG.js";import"./chunk-UL6HUKIC.js";import"./chunk-NLFBNSNG.js";import{a as q}from"./chunk-JYCI6IOX.js";import{f as H,g as yi}from"./chunk-ERHO76Z3.js";import"./chunk-3CXLRUBF.js";import"./chunk-M42U7VID.js";import{a as G}from"./chunk-D46Z5LZF.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import{b as er}from"./chunk-FABNEHCT.js";import{b as wn,e as Ae,f as Pn}from"./chunk-FFEIL3TN.js";import"./chunk-INL666X3.js";import{d as Cn,g as gn,n as Yo}from"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import{a as ae,b as dn}from"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{A as Tn,B as Zo,C as ei,K as hi,O as $o,g as me,o as Jo,s as vn,z as Xo}from"./chunk-UICLTBFW.js";import"./chunk-5UKWQA6U.js";import"./chunk-QYSFCWV7.js";import{a as Ko,b as zo,d as $}from"./chunk-Q7OVBNEW.js";import"./chunk-K7LXQZ6U.js";import{a as fi,b as Si,c as K}from"./chunk-6RFU4RXC.js";import{b as mn}from"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import"./chunk-PG5RORVW.js";import"./chunk-OQDKFI6M.js";import"./chunk-TKBQO5Z6.js";import{a as ki,b as sn,c as Zt}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import{va as No}from"./chunk-FMECWSCG.js";import{E as Ht,F as pn,b as Oo,c as Ye,h as k,l as Ro,o as W,q as ko,s as Wo}from"./chunk-QMS2MBIA.js";import"./chunk-BSQ4IMR7.js";import"./chunk-HNBNOK55.js";import"./chunk-WLVEHCCR.js";import{b as j}from"./chunk-P7GOTTNS.js";import{a as M}from"./chunk-3DEA4WWC.js";import"./chunk-65U2TQMH.js";import{n as Ue,q as N}from"./chunk-3GXUD7K4.js";import{Ba as To,Bb as C,Bc as en,Bd as Bo,Cc as I,Db as g,Dc as J,Eb as Bi,Ec as xe,F as li,Fa as at,Fb as R,Fc as mt,Gb as V,Gc as Kt,Ha as Ui,Hb as B,Hc as tn,Ib as c,Ic as bo,J as Mi,Jb as n,Kb as a,Kc as d,L as yo,La as wo,Lb as E,Lc as x,Mc as v,N as Do,Nc as _i,Nd as Lo,Oa as Po,Pb as Wt,Qb as Nt,Qc as A,R as Qi,Rd as Ne,Sa as be,Sc as Eo,Tc as Oi,Td as ln,Ua as Ki,Ub as b,Ud as Q,Wd as Ri,Xb as P,Xc as nn,Yc as Ci,Z as qt,Za as o,Zb as m,ad as an,ba as no,bc as Xi,cc as Zi,dc as $i,dd as Io,eb as w,ga as kt,hc as Xt,ib as O,ic as Ut,jb as zi,jc as Li,kb as Ji,mb as Fo,mc as p,md as $e,na as vo,nb as Y,nc as F,o as ci,oa as ji,ob as L,oc as D,od as Mo,pa as ui,pc as At,pd as on,ra as Me,rc as f,sc as S,sd as Vo,tc as h,u as ri,ud as oe,v as io,va as u,wa as _,wd as re,xb as Vi,xc as ft,za as qi,zd as rn}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import{a as Xe,b as Ze,f as gl,h as Gt,k as di}from"./chunk-SNAKHGZS.js";var Co=gl((Wi,_o)=>{(function(i,s){typeof Wi=="object"&&typeof _o=="object"?_o.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Wi=="object"?Wi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})("u"<typeof window?Wi:window,(i,s)=>(()=>{"use strict";var e={944:he=>{he.exports=i},984:he=>{he.exports=s}},r={};function t(he){var te=r[he];if(te!==void 0)return te.exports;var Oe=r[he]={exports:{}};return e[he](Oe,Oe.exports,t),Oe.exports}t.n=he=>{var te=he&&he.__esModule?()=>he.default:()=>he;return t.d(te,{a:te}),te},t.d=(he,te)=>{for(var Oe in te)t.o(te,Oe)&&!t.o(he,Oe)&&Object.defineProperty(he,Oe,{enumerable:!0,get:te[Oe]})},t.o=(he,te)=>Object.prototype.hasOwnProperty.call(he,te);var l={};t.d(l,{default:()=>Cl});var y=t(944),T=t.n(y),je=t(984),vt=t.n(je);let ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Ai(he,te,Oe,Ie,et,ee){let Be=(ee-te)*(Oe-he)-(Ie-te)*(et-he);return Be>0||!(Be<0)}function Gi(he,te,Oe,Ie,et,ee,Be,ke){return Ai(he,te,et,ee,Be,ke)!==Ai(Oe,Ie,et,ee,Be,ke)&&Ai(he,te,Oe,Ie,et,ee)!==Ai(he,te,Oe,Ie,Be,ke)}let{animObject:to}=T(),{format:ll}=vt(),{setOptions:pl}=T(),{composed:ml}=T(),{boxIntersectLine:go,intersectRect:sl}={boxIntersectLine:function(he,te,Oe,Ie,et,ee,Be,ke){return Gi(he,te,he+Oe,te,et,ee,Be,ke)||Gi(he+Oe,te,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te+Ie,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te,he,te+Ie,et,ee,Be,ke)},intersectRect:function(he,te){return!(te.left>he.right||te.right<he.left||te.top>he.bottom||te.bottom<he.top)}},{addEvent:xo,extend:fo,fireEvent:dl,isNumber:Hi,pick:zt,pushUnique:cl,syncTimeout:ul}=T();function mi(he,te,Oe,Ie,et){let ee=he.chart,Be=he.options.label||{},ke=zt(Be.onArea,!!he.area),tt=ke||Be.connectorAllowed,dt=ee.boxesToAvoid,St=Number.MAX_VALUE,ct=Number.MAX_VALUE,_t,ht,It,Tt,ot,rt,Le;for(rt=0;dt&&rt<dt.length;rt+=1)if(sl(dt[rt],{left:te,right:te+Ie.width,top:Oe,bottom:Oe+Ie.height}))return!1;for(rt=0;rt<ee.series.length;rt+=1){let xt=ee.series[rt],De=xt.interpolatedPoints&&[...xt.interpolatedPoints];if(xt.visible&&De){let lt=ee.plotHeight/10;for(let pt=ee.plotTop;pt<=ee.plotTop+ee.plotHeight;pt+=lt)De.unshift({chartX:ee.plotLeft,chartY:pt}),De.push({chartX:ee.plotLeft+ee.plotWidth,chartY:pt});for(Le=1;Le<De.length;Le+=1){if(De[Le].chartX>=te-16&&De[Le-1].chartX<=te+Ie.width+16){if(go(te,Oe,Ie.width,Ie.height,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))return!1;he===xt&&!It&&et&&(It=go(te-16,Oe-16,Ie.width+32,Ie.height+32,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))}(tt||It)&&(he!==xt||ke)&&(St=Math.min(St,(Tt=te+Ie.width/2-De[Le].chartX)*Tt+(ot=Oe+Ie.height/2-De[Le].chartY)*ot))}if(!ke&&tt&&he===xt&&(et&&!It||St<Math.pow(Be.connectorNeighbourDistance||1,2))){for(Le=1;Le<De.length;Le+=1)(_t=Math.min(Math.pow(te+Ie.width/2-De[Le].chartX,2)+Math.pow(Oe+Ie.height/2-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2)))<ct&&(ct=_t,ht=De[Le]);It=!0}}}return(!et||!!It)&&{x:te,y:Oe,weight:St-(ht?ct:0),connectorPoint:ht}}function So(he){if(this.renderer){let te=this,Oe=to(te.renderer.globalAnimation).duration;te.labelSeries=[],te.labelSeriesMaxSum=0,te.seriesLabelTimer&&T().clearTimeout(te.seriesLabelTimer),te.series.forEach(function(Ie){let et=Ie.options.label||{},ee=Ie.labelBySeries,Be=ee&&ee.closest,ke=Ie.getColumn("y");et.enabled&&Ie.visible&&(Ie.graph||Ie.area)&&!Ie.boosted&&te.labelSeries&&(te.labelSeries.push(Ie),et.minFontSize&&et.maxFontSize&&ke.length&&(Ie.sum=ke.reduce((tt,dt)=>(tt||0)+(dt||0),0),te.labelSeriesMaxSum=Math.max(te.labelSeriesMaxSum||0,Ie.sum||0)),he.type==="load"&&(Oe=Math.max(Oe,to(Ie.options.animation).duration)),Be&&(Be[0].plotX!==void 0?ee.animate({x:Be[0].plotX+Be[1],y:Be[0].plotY+Be[2]}):ee.attr({opacity:0})))}),te.seriesLabelTimer=ul(function(){let Ie,et;te.series&&te.labelSeries&&(te.boxesToAvoid=[],Ie=te.labelSeries||[],et=te.boxesToAvoid,te.series.forEach(ee=>(ee.points||[]).forEach(Be=>(Be.dataLabels||[]).forEach(ke=>{let{width:tt,height:dt}=ke.getBBox(),St=(ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),ct=(ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);et.push({left:St,top:ct,right:St+tt,bottom:ct+dt})}))),Ie.forEach(function(ee){let Be=ee.options.label||{};ee.interpolatedPoints=(function(ke){let tt,dt,St,ct,_t;if(!ke.xAxis&&!ke.yAxis)return;let ht=ke.points,It=[],Tt=ke.graph||ke.area,ot=Tt&&Tt.element,rt=ke.chart.inverted,Le=ke.xAxis,xt=ke.yAxis,De=rt?xt.pos:Le.pos,lt=rt?Le.pos:xt.pos,pt=rt?Le.len:xt.len,Ii=rt?xt.len:Le.len,ut=zt((ke.options.label||{}).onArea,!!ke.area),qe=xt.getThreshold(ke.options.threshold),yt={},Jt=rt?"chartCenterX":"chartCenterY";function oi(it){let Ct=Math.round((it.plotX||0)/8)+","+Math.round((it.plotY||0)/8);yt[Ct]||(yt[Ct]=1,It.push(it))}if(ke.getPointSpline&&ot&&ot.getPointAtLength&&!ut&&ht.length<(ke.chart.plotSizeX||0)/16){let it=Tt.toD&&Tt.attr("d");for(Tt.toD&&Tt.attr({d:Tt.toD}),St=ot.getTotalLength(),tt=0;tt<St;tt+=16){let Mt=ot.getPointAtLength(tt),Vt=rt?Ii-Mt.y:Mt.x,Bt=rt?pt-Mt.x:Mt.y;oi({chartX:De+Vt,chartY:lt+Bt,plotX:Vt,plotY:Bt})}it&&Tt.attr({d:it});let Ct=ht[ht.length-1].pos();oi({chartX:De+(Ct?.[0]||0),chartY:lt+(Ct?.[1]||0)})}else{let it;for(tt=0,St=ht.length;tt<St;tt+=1){let Ct=ht[tt],[Mt,Vt]=Ct.pos()||[],{plotHigh:Bt}=Ct;if(Hi(Mt)&&Hi(Vt)){let wt={plotX:Mt,plotY:Vt,chartX:De+Mt,chartY:lt+Vt};if(ut&&(Bt&&(wt.plotY=Bt,wt.chartY=lt+Bt),rt?wt.chartCenterX=De+Ii-((Bt||Ct.plotY||0)+zt(Ct.yBottom,qe))/2:wt.chartCenterY=lt+((Bt||Vt)+zt(Ct.yBottom,qe))/2),it&&(dt=Math.max(Math.abs(wt.chartX-it.chartX),Math.abs(wt.chartY-it.chartY)))>16&&dt<999)for(_t=1,ct=Math.ceil(dt/16);_t<ct;_t+=1)oi({chartX:it.chartX+(wt.chartX-it.chartX)*(_t/ct),chartY:it.chartY+(wt.chartY-it.chartY)*(_t/ct),[Jt]:(it[Jt]||0)+((wt[Jt]||0)-(it[Jt]||0))*(_t/ct),plotX:(it.plotX||0)+(Mt-(it.plotX||0))*(_t/ct),plotY:(it.plotY||0)+(Vt-(it.plotY||0))*(_t/ct)});oi(wt),it=wt}}}return It})(ee),et.push(...Be.boxesToAvoid||[])}),te.series.forEach(function(ee){let Be=ee.options.label;if(!Be||!ee.xAxis&&!ee.yAxis)return;let ke="highcharts-color-"+zt(ee.colorIndex,"none"),tt=!ee.labelBySeries,dt=Be.minFontSize,St=Be.maxFontSize,ct=te.inverted,_t=ct?ee.yAxis.pos:ee.xAxis.pos,ht=ct?ee.xAxis.pos:ee.yAxis.pos,It=te.inverted?ee.yAxis.len:ee.xAxis.len,Tt=te.inverted?ee.xAxis.len:ee.yAxis.len,ot=ee.interpolatedPoints,rt=zt(Be.onArea,!!ee.area),Le=[],xt=ee.getColumn("x"),De,lt,pt,Ii,ut,qe,yt=ee.labelBySeries,Jt,oi,it;function Ct(Qt,Rt,jt){let Yi=Math.max(_t,zt(oi,-1/0)),si=Math.min(_t+It,zt(it,1/0));return Qt>Yi&&Qt<=si-jt.width&&Rt>=ht&&Rt<=ht+Tt-jt.height}function Mt(){yt&&(ee.labelBySeries=yt.destroy())}if(rt&&!ct&&(Jt=[ee.xAxis.toPixels(xt[0]),ee.xAxis.toPixels(xt[xt.length-1])],oi=Math.min.apply(Math,Jt),it=Math.max.apply(Math,Jt)),ee.visible&&!ee.boosted&&ot){if(!yt){var Vt,Bt,wt;let Qt=ee.name;if(typeof Be.format=="string"?Qt=ll(Be.format,ee,te):Be.formatter&&(Qt=Be.formatter.call(ee)),ee.labelBySeries=yt=te.renderer.label(Qt,0,0,"connector",0,0,Be.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+ke),!te.renderer.styledMode){let Rt=typeof ee.color=="string"?ee.color:"#666666";yt.css(fo({color:rt?te.renderer.getContrast(Rt):Rt},Be.style||{})),yt.attr({opacity:+!!te.renderer.forExport,stroke:ee.color,"stroke-width":1})}dt&&St&&yt.css({fontSize:(Vt=ee,Bt=dt,wt=St,Bt+(Vt.sum||0)/(Vt.chart.labelSeriesMaxSum||0)*(wt-Bt)+"px")}),yt.attr({padding:0,zIndex:3}).add()}for((De=yt.getBBox()).width=Math.round(De.width),ut=ot.length-1;ut>0;ut-=1)rt?Ct(lt=(ot[ut].chartCenterX??ot[ut].chartX)-De.width/2,pt=(ot[ut].chartCenterY??ot[ut].chartY)-De.height/2,De)&&(qe=mi(ee,lt,pt,De)):(Ct(lt=ot[ut].chartX+3,pt=ot[ut].chartY-De.height-3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX+3,pt=ot[ut].chartY+3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX-De.width-3,pt=ot[ut].chartY+3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX-De.width-3,pt=ot[ut].chartY-De.height-3,De)&&(qe=mi(ee,lt,pt,De,!0))),qe&&Le.push(qe);if(Be.connectorAllowed&&!Le.length&&!rt)for(lt=_t+It-De.width;lt>=_t;lt-=16)for(pt=ht;pt<ht+Tt-De.height;pt+=16)(Ii=mi(ee,lt,pt,De,!0))&&Le.push(Ii);if(Le.length){Le.sort((Rt,jt)=>jt.weight-Rt.weight),qe=Le[0],(te.boxesToAvoid||[]).push({left:qe.x,right:qe.x+De.width,top:qe.y,bottom:qe.y+De.height});let Qt=Math.sqrt(Math.pow(Math.abs(qe.x-(yt.x||0)),2)+Math.pow(Math.abs(qe.y-(yt.y||0)),2));if(Qt&&ee.labelBySeries){let Rt,jt={opacity:+!!te.renderer.forExport,x:qe.x,y:qe.y},Yi={opacity:1};Qt<=10&&(Yi={x:jt.x,y:jt.y},jt={}),tt&&(Rt=to(ee.options.animation),Rt.duration*=.2),ee.labelBySeries.attr(fo(jt,{anchorX:qe.connectorPoint&&(qe.connectorPoint.plotX||0)+_t,anchorY:qe.connectorPoint&&(qe.connectorPoint.plotY||0)+ht})).animate(Yi,Rt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:qe.x,chartY:qe.y},!0);si&&(yt.closest=[si,qe.x-(si.plotX||0),qe.y-(si.plotY||0)])}}else Mt()}else Mt()}),dl(te,"afterDrawSeriesLabels"))},te.renderer.forExport||!Oe?0:Oe)}}function _l(he,te,Oe,Ie,et){let ee=et&&et.anchorX,Be=et&&et.anchorY,ke,tt,dt=Oe/2;return Hi(ee)&&Hi(Be)&&(ke=[["M",ee,Be]],(tt=te-Be)<0&&(tt=-Ie-tt),tt<Oe&&(dt=ee<he+Oe/2?tt:Oe-tt),Be>te+Ie?ke.push(["L",he+dt,te+Ie]):Be<te?ke.push(["L",he+dt,te]):ee<he?ke.push(["L",he,te+Ie/2]):ee>he+Oe&&ke.push(["L",he+Oe,te+Ie/2])),ke||[]}let ho=T();({compose:function(he,te){cl(ml,"SeriesLabel")&&(xo(he,"load",So),xo(he,"redraw",So),te.prototype.symbols.connector=_l,pl({plotOptions:{series:{label:ai}}}))}}).compose(ho.Chart,ho.SVGRenderer);let Cl=T();return l.default})())});var fl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Tr=i=>({ID:i});function Sl(i,s){if(i&1){let e=b();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function hl(i,s){if(i&1&&(n(0,"div",2),C(1,Sl,3,0,"button",3),a()),i&2){let e=m();o(),g(e.roleService.global.Export?1:-1)}}function yl(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),E(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Dl(i,s){i&1&&(n(0,"th",32),p(1,"@ Cost"),a())}function vl(i,s){i&1&&(n(0,"th",33),p(1,"@ Price"),a(),n(2,"th",30),p(3,"Disc."),a(),n(4,"th",33),p(5,"Total"),a())}function Tl(i,s){if(i&1&&(n(0,"small",40),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function wl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Pl(i,s){if(i&1&&(n(0,"span",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+x(2,1,e.Profit)," ")}}function Fl(i,s){if(i&1&&(n(0,"i",43),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function bl(i,s){if(i&1&&(n(0,"span",44),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function El(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function Il(i,s){if(i&1&&(E(0,"div",45),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",x(1,1,e.SONote),be)}}function Ml(i,s){if(i&1&&(n(0,"div")(1,"a",51),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",J(2,Tr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Vl(i,s){if(i&1&&(n(0,"div",46),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PaymentStateLabel," ")}}function Bl(i,s){if(i&1&&(n(0,"i",54),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Ll(i,s){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e==null?null:e.UnitCost)," ")}}function Ol(i,s){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),a(),n(3,"th",61)(4,"div",62),p(5),a(),n(6,"div",63),p(7),d(8,"amountFraction"),a()(),n(9,"th",60),p(10),d(11,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,4,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":x(8,6,e==null?null:e.DiscountAmount)," "),o(3),D(" ",x(11,8,e==null?null:e.Total)," ")}}function Rl(i,s){if(i&1&&(n(0,"tr",49)(1,"th",28)(2,"div",52)(3,"span",53),p(4),a(),C(5,Bl,2,1,"i",54),E(6,"small",55),a()(),n(7,"th",56),p(8),a(),n(9,"th",57),p(10),d(11,"quantityFraction"),a(),n(12,"th",58),p(13),a(),C(14,Ll,3,3,"th",59),C(15,Ol,12,10),a()),i&2){let e=s.$implicit,r=m(4);o(4),F(e==null?null:e.Name),o(),g((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,be),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",x(11,8,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),g(r.roleService.product.Cost?14:-1),o(),g(r.roleService.report.Price?15:-1)}}function kl(i,s){if(i&1&&(n(0,"tr")(1,"th",64),p(2),a(),n(3,"th",65),p(4),a(),n(5,"th",66),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",x(7,3,e.Amount)," ")}}function Wl(i,s){if(i&1&&(n(0,"table",50),V(1,kl,8,5,"tr",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Aggregate)}}function Nl(i,s){if(i&1&&(n(0,"div")(1,"div",35)(2,"div",36)(3,"div")(4,"a",37)(5,"span",38),p(6),a()(),n(7,"span"),p(8),d(9,"date"),E(10,"small",39),d(11,"date"),C(12,Tl,3,4,"small",40),a()(),n(13,"div",41)(14,"strong",42),p(15),C(16,wl,3,4,"span"),a(),C(17,Pl,3,3,"span",40),C(18,Fl,2,1,"i",43),C(19,bl,2,1,"span",44),C(20,El,2,0,"span"),a(),C(21,Il,2,3,"div",45),C(22,Ml,3,4,"div"),a(),C(23,Vl,2,1,"div",46),a(),n(24,"table",47)(25,"tbody",48),V(26,Rl,16,10,"tr",49,R),a()(),C(28,Wl,3,0,"table",50),a()),i&2){let e=s.$implicit,r=m(3);o(4),c("routerLink",I(22,fl))("queryParams",J(23,Tr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,16,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,19,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",be),o(2),g(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),g(r.isNotEmpty(e.SalesName)?16:-1),o(),g(r.roleService.report.Profit&&r.roleService.report.Price&&r.roleService.product.Cost?17:-1),o(),g(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),g(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),g(e.SONote&&e.PromotionCoupon?20:-1),o(),g(r.isNotEmpty(e.SONote)?21:-1),o(),g(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(),g(r.roleService.report.Price?23:-1),o(3),B(e.Items),o(2),g(r.roleService.report.Price?28:-1)}}function Al(i,s){if(i&1&&(n(0,"tr")(1,"td",34),V(2,Nl,29,25,"div",null,R),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7),o(),B(e.infiniteList)}}function Gl(i,s){if(i&1&&(n(0,"tr")(1,"td"),E(2,"app-empty-state"),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7)}}function Hl(i,s){if(i&1){let e=b();n(0,"span",73),P("click",function(){u(e);let t=m(3);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function Yl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),F(x(2,1,e.listTotal))}}function Ql(i,s){if(i&1){let e=b();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(3);return t.currentRowCount=100,_(t.NextPage(!0))}),E(2,"i",76),p(3," Next 100"),a()()}}function jl(i,s){if(i&1){let e=b();n(0,"div",67)(1,"button",68),P("click",function(){u(e);let t=m(2);return _(t.showSummaryReport())}),p(2," View Report Summary "),a()(),n(3,"div",69)(4,"div",70)(5,"div",71),p(6),d(7,"number"),C(8,Hl,3,0,"span",72),C(9,Yl,3,3,"span"),p(10),a()(),C(11,Ql,4,0,"div",2),a()}if(i&2){let e=m(2);o(6),D(" Showing 1 - ",x(7,5,e.infiniteList.length)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),g(e.nextPageDisabled?11:-1)}}function ql(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),C(14,Dl,2,0,"th",32),C(15,vl,6,0),a()(),n(16,"tbody"),C(17,Al,4,1,"tr")(18,Gl,3,1,"tr"),a()()(),C(19,jl,12,7),a()()),i&2){let e=m();o(14),g(e.roleService.product.Cost?14:-1),o(),g(e.roleService.report.Price?15:-1),o(2),g(e.infiniteList.length>0?17:18),o(2),g((e.infiniteList==null?null:e.infiniteList.length)>0?19:-1)}}var In=class i extends ve{constructor(e,r,t,l,y,T,je,vt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,y);this.csvConverter=t;this.datePipe=l;this.activatedRoute=y;this.matDialog=T;this.toaster=je;this.roleService=vt}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(y=>y):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(z,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Sr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(Ne),w(K),w(Ue),w(j))};static \u0275cmp=O({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[Y],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,hl,2,1,"div",2),a(),n(3,"filters"),L(4,yl,46,26,"ng-template",null,0,A),a(),C(6,ql,20,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,U,ze,vi,Jo,vn,re,oe,Z,ie],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media(max-width:992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Mn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new sn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(fi),w(Si))};static \u0275cmp=O({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return S(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return S(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Ye,k,W,Ke,Zt],encapsulation:2})};var zl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],wr=i=>({ID:i}),Jl=()=>["/menu/Contacts/Contact/Customers/Info"],Xl=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function Zl(i,s){if(i&1){let e=b();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",4),p(2," Export "),a()}}function $l(i,s){if(i&1){let e=b();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),Wt(18),n(19,"div",11)(20,"div",12)(21,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",14)(23,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",16)(25,"div",12)(26,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(27,"div",14)(28,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),Nt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function ep(i,s){i&1&&(n(0,"th",36),p(1,"DATE"),a())}function tp(i,s){i&1&&(n(0,"th",37),p(1," CUSTOMER "),a())}function ip(i,s){i&1&&(n(0,"th",38),p(1,"JOIN DATE"),a())}function np(i,s){i&1&&(n(0,"th",39),p(1,"GROUPS"),a())}function ap(i,s){i&1&&(n(0,"th",40),p(1," SALES PERSON "),a())}function op(i,s){i&1&&(n(0,"th",41),p(1," COST "),a())}function rp(i,s){i&1&&(n(0,"th",44),p(1," GROSS "),a())}function lp(i,s){i&1&&(n(0,"th",45),p(1," SALES "),a())}function pp(i,s){i&1&&(n(0,"th",46),p(1," TAX "),a())}function mp(i,s){i&1&&(n(0,"th",47),p(1," SURCHARGE "),a())}function sp(i,s){i&1&&(n(0,"th",48),p(1," TOTAL "),a())}function dp(i,s){if(i&1&&(C(0,rp,2,0,"th",44),C(1,lp,2,0,"th",45),C(2,pp,2,0,"th",46),C(3,mp,2,0,"th",47),C(4,sp,2,0,"th",48)),i&2){let e=m(3);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function cp(i,s){i&1&&(n(0,"th",42),p(1," PAYMENT "),a())}function up(i,s){i&1&&E(0,"br")}function _p(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Cp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function gp(i,s){if(i&1&&(n(0,"td")(1,"a",52),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",I(3,Jl))("queryParams",J(4,wr,e.CustomerID)),o(),F(e.CustomerName)}}function xp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function fp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Sp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function hp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function yp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function Dp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function vp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Tp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SurchargeAmount)," ")}}function wp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SalesNSurcharge)," ")}}function Pp(i,s){if(i&1&&(C(0,yp,3,3,"td",53),C(1,Dp,3,3,"td",53),C(2,vp,3,3,"td",54),C(3,Tp,3,3,"td",53),C(4,wp,3,3,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function Fp(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;c("ngClass",mt(2,Xl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function bp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",49),p(5),a(),C(6,up,1,0,"br"),C(7,_p,2,1,"i"),a(),C(8,Cp,7,8,"td"),C(9,gp,3,6,"td"),C(10,xp,3,4,"td"),C(11,fp,2,1,"td"),C(12,Sp,2,1,"td"),C(13,hp,3,3,"td",50),C(14,Pp,5,5),C(15,Fp,2,6,"td",51),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",I(14,zl))("queryParams",J(15,wr,e.ID)),o(),D(" ",e.Number," "),o(),g(e.Note?6:-1),o(),g(e.Note?7:-1),o(),g(r.column.Date.selected?8:-1),o(),g(r.column.Customer.selected?9:-1),o(),g(r.column.JoinDate.selected?10:-1),o(),g(r.column.Groups.selected?11:-1),o(),g(r.column.SalesPerson.selected?12:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.role&&r.column.Cost.selected?13:-1),o(),g(r.roleService.report.Price?14:-1),o(),g(r.column.Payment.selected?15:-1)}}function Ep(i,s){i&1&&E(0,"td",56)}function Ip(i,s){i&1&&E(0,"td",56)}function Mp(i,s){i&1&&E(0,"td",56)}function Vp(i,s){i&1&&(n(0,"td",57),p(1," Total: "),a())}function Bp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Lp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Op(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Rp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function kp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Wp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Np(i,s){if(i&1&&(C(0,Vp,2,0,"td",57),C(1,Bp,4,6,"td",50),C(2,Lp,4,6,"td",53),C(3,Op,4,6,"td",53),C(4,Rp,4,6,"td",54),C(5,kp,4,6,"td",53),C(6,Wp,4,6,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected?0:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?1:-1),o(),g(e.column.Gross.selected?2:-1),o(),g(e.column.Sales.selected?3:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?4:-1),o(),g(e.data.SurchargeVisible?5:-1),o(),g(e.column.Total.selected?6:-1)}}function Ap(i,s){if(i&1&&(n(0,"tfoot",43)(1,"tr",55),E(2,"td",56),C(3,Ep,1,0,"td",56),C(4,Ip,1,0,"td",56),C(5,Mp,1,0,"td",56),C(6,Np,7,7),a()()),i&2){let e=m(3);o(3),g(e.column.Date.selected?3:-1),o(),g(e.column.Customer.selected?4:-1),o(),g(e.column.SalesPerson.selected?5:-1),o(),g(e.roleService.report.Price?6:-1)}}function Gp(i,s){if(i&1){let e=b();n(0,"div",24)(1,"table",32),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",33)(3,"tr")(4,"th",34),p(5,"OUTLET"),a(),n(6,"th",35),p(7,"NUMBER"),a(),C(8,ep,2,0,"th",36),C(9,tp,2,0,"th",37),C(10,ip,2,0,"th",38),C(11,np,2,0,"th",39),C(12,ap,2,0,"th",40),C(13,op,2,0,"th",41),C(14,dp,5,5),C(15,cp,2,0,"th",42),a()(),n(16,"tbody"),V(17,bp,16,17,"tr",null,R),a(),C(19,Ap,7,4,"tfoot",43),a()()}if(i&2){let e=m(2);o(8),g(e.column.Date.selected?8:-1),o(),g(e.column.Customer.selected?9:-1),o(),g(e.column.JoinDate.selected?10:-1),o(),g(e.column.Groups.selected?11:-1),o(),g(e.column.SalesPerson.selected?12:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.role&&e.column.Cost.selected?13:-1),o(),g(e.roleService.report.Price?14:-1),o(),g(e.column.Payment.selected?15:-1),o(2),B(e.infiniteList),o(2),g(e.data?19:-1)}}function Hp(i,s){if(i&1){let e=b();n(0,"span",58),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",59),p(2,"?"),a()()}}function Yp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Qp(i,s){if(i&1){let e=b();n(0,"a",60),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",61),p(2," Next"),a()}}function jp(i,s){if(i&1){let e=b();n(0,"a",62),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),E(1,"i",63),p(2," Show All"),a()}}function qp(i,s){if(i&1&&(n(0,"content")(1,"div",23),C(2,Gp,20,9,"div",24),n(3,"div",25)(4,"div",26)(5,"div",27),p(6),d(7,"number"),C(8,Hp,3,0,"span",28),C(9,Yp,3,3,"span"),p(10),a()(),n(11,"div",29),C(12,Qp,3,0,"a",30),C(13,jp,3,0,"a",31),a()()()()),i&2){let e=m();o(2),g(e.data?2:-1),o(4),D(" Showing 1 - ",x(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),g(!e.nextPageDisabled&&!e.goToLast?12:-1),o(),g(!e.nextPageDisabled&&!e.goToLast?13:-1)}}var Vn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=y}roleService=Me(j);columnService=Me(st);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},Total:{selected:!0,name:"Total",role:this.roleService.report.Price},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Mn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),y);case"number":return this.compare(t.Number,l.Number,y);case"date":return this.compare(t.Date,l.Date,y);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),y);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),y);case"cost":return this.compare(t.Cost,l.Cost,y);case"gross":return this.compare(t.Gross,l.Gross,y);case"sales":return this.compare(t.Sales,l.Sales,y);case"tax":return this.compare(t.Tax,l.Tax,y);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,y);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,y);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,y);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,y);case"groups":return this.compare(t.Groups,l.Groups,y);default:return 0}})}openExportModal(){this._matDialog.open(z,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ne),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[Y],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time","customStyle"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],[1,"border-top"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-start",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"table","table-borderless"],[1,"empty-column"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Zl,3,0,"button",2),a(),n(3,"filters"),L(4,$l,44,26,"ng-template",null,0,A),a(),C(6,qp,14,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,$e,Q,$,X,Ye,k,W,ae,le,ge,Ke,we,Ae,Di,U,ze,me,re,oe,Z],encapsulation:2})};var Up=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],zp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Jp=i=>({ID:i}),Xp=(i,s)=>({BrandID:i,Name:s});function Zp(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function $p(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"p-treeSelect",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectetOutletGroup,t)||(l.selectetOutletGroup=t),_(t)}),P("ngModelChange",function(t){u(e);let l=m();return _(l.onSelectOutletGroup(t))})("onClear",function(){u(e);let t=m();return _(t.onClearOutletGroup())}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(13,"div",15)(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("disabled",(e.pageData.Filter==null||e.pageData.Filter.ListIDs==null?null:e.pageData.Filter.ListIDs.length)>0)("options",e.pageData.Options==null?null:e.pageData.Options.OutletGroupsTree),f("ngModel",e.selectetOutletGroup),c("showClear",!0),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function em(i,s){i&1&&(n(0,"th",21),p(1," Cost "),a())}function tm(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Gross))}}function im(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",27),p(3),a()(),n(4,"td",28)(5,"a",29),p(6),d(7,"quantityFraction"),a()(),n(8,"td",28),p(9),d(10,"amountFraction"),a(),C(11,tm,3,3,"td",28),n(12,"td",28),p(13),d(14,"amountFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),n(18,"td",28),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",I(20,zp))("queryParams",J(21,Jp,e.ID)),o(),D("",e.BrandName," "),o(2),c("queryParams",xe(23,Xp,e.ID,e.BrandName)),o(),F(x(7,10,e.Quantity)),o(3),F(x(10,12,e.Cost)),o(2),g(r.roleService.product.Cost?11:-1),o(2),F(x(14,14,e.NetSales)),o(3),F(x(17,16,e.Tax)),o(3),F(x(20,18,e.SalesTax))}}function nm(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(x(3,4,v(2,1,e.data.Data,"Cost")))}}function am(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Brand"),a(),n(6,"th",20),p(7," Quantity "),a(),C(8,em,2,0,"th",21),n(9,"th",22),p(10," Gross "),a(),n(11,"th",23),p(12," Sales "),a(),n(13,"th",24),p(14," Tax "),a(),n(15,"th",25),p(16," Sales + Tax "),a()()(),n(17,"tbody"),V(18,im,21,26,"tr",null,R),a(),n(20,"tfoot")(21,"tr",26)(22,"td"),p(23,"Total"),a(),n(24,"td"),p(25),d(26,"sum"),a(),C(27,nm,4,6,"td"),n(28,"td"),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td"),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td"),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td"),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()}if(i&2){let e=m();o(8),g(e.roleService.product.Cost?8:-1),o(10),B(e.data.Data),o(7),F(v(26,7,e.data.Data,"Quantity")),o(2),g(e.roleService.product.Cost?27:-1),o(2),F(x(31,13,v(30,10,e.data.Data,"Gross"))),o(4),F(x(35,18,v(34,15,e.data.Data,"NetSales"))),o(4),F(x(39,23,v(38,20,e.data.Data,"Tax"))),o(4),F(x(43,28,v(42,25,e.data.Data,"SalesTax")))}}var Bn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=y;this.matDialog=T}selectetOutletGroup;preInitList(){super.preInitList(),this.pageData.Options=Ze(Xe({},this.pageData.Options),{Categories:[]})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=JSON.parse(JSON.stringify(this.originalData));return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";return this.compare(t[e.active],l[e.active],y)})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e.key,this.selectetOutletGroup=e}onClearOutletGroup(){this.pageData.Filter.OutletGroupID=null}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ne),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[Y],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","placeholder","Choose Outlet",1,"tree-select-as-filter",3,"ngModelChange","onClear","disabled","options","ngModel","showClear"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","BrandName",2,"width","250px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before","matTooltip","Brand Cost Cost",1,"flex-right",2,"width","120px"],["mat-sort-header","Gross","arrowPosition","before","matTooltip","Brand Gross Gross",1,"flex-right",2,"width","120px"],["mat-sort-header","NetSales","arrowPosition","before","matTooltip","Brand Net Sales",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Brand Net Tax",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesTax","arrowPosition","before","matTooltip","Brand Net Sales + Tax",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,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," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),L(14,$p,15,14,"ng-template",null,0,A),a(),n(16,"content"),C(17,am,44,30,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(8,Up)),o(3),c("routerLink",I(9,Kp)),o(6),g(t.data?17:-1))},dependencies:[H,Q,X,k,W,ae,le,ge,ce,U,tr,me,Z,ie],encapsulation:2})};function om(i,s){if(i&1){let e=b();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),E(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var Ln=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(fi),w(Si))};static \u0275cmp=O({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),V(3,om,4,3,"label",null,R),a()()()),e&2&&(c("title","Edit Groups"),o(3),B(r.options))},dependencies:[Zt],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],dm=()=>["/menu/Contacts/Contact/Customers/Info"],cm=i=>({ID:i});function um(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function _m(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Cm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function gm(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function xm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function fm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Sm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function hm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function ym(i,s){if(i&1){let e=b();n(0,"span")(1,"span"),p(2),a(),n(3,"a",42),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Dm(i,s){if(i&1&&(n(0,"span"),V(1,ym,5,2,"span",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Groups)}}function vm(i,s){if(i&1){let e=b();n(0,"a",42),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Tm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Orders)," ")}}function wm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Quantity)," ")}}function Pm(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function Fm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function bm(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Em(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales+e.Tax)," ")}}function Im(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",35),p(3),a(),n(4,"div",36),C(5,Dm,3,0,"span"),C(6,vm,2,0,"a",37),a()(),n(7,"td")(8,"span",38),p(9),a()(),C(10,Tm,3,3,"td",39),C(11,wm,3,3,"td",39),C(12,Pm,3,3,"td",40),C(13,Fm,3,3,"td",39),C(14,bm,3,3,"td",41),C(15,Em,3,3,"td",39),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",I(13,dm))("queryParams",J(14,cm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),g(e.Groups.length>0?5:-1),o(),g(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),g(r.column.Orders.selected?10:-1),o(),g(r.column.QTY.selected?11:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),g(r.column.Sales.selected?13:-1),o(),g(r.column.Tax.selected?14:-1),o(),g(r.column.SalesNTax.selected?15:-1)}}function Mm(i,s){if(i&1&&(n(0,"tbody",28),V(1,Im,16,16,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.infiniteList)}}function Vm(i,s){if(i&1){let e=b();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))}),n(1,"i",44),p(2,"?"),a()()}}function Bm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Lm(i,s){if(i&1){let e=b();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",46),p(2," Next"),a()}}function Om(i,s){if(i&1){let e=b();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),C(9,Cm,2,0,"th",22),C(10,gm,2,0,"th",23),C(11,xm,2,0,"th",24),C(12,fm,2,0,"th",25),C(13,Sm,2,0,"th",26),C(14,hm,2,0,"th",27),a()(),C(15,Mm,3,0,"tbody",28),a()(),n(16,"div",29)(17,"div",30)(18,"div",31),p(19),d(20,"number"),L(21,Vm,3,0,"span",32)(22,Bm,3,3,"span",33),p(23),a()(),L(24,Lm,3,0,"a",34),a()()}if(i&2){let e=m();o(9),g(e.column.Orders.selected?9:-1),o(),g(e.column.QTY.selected?10:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),g(e.column.Sales.selected?12:-1),o(),g(e.column.Tax.selected?13:-1),o(),g(e.column.SalesNTax.selected?14:-1),o(),g(e.data.Data?15:-1),o(4),D(" Showing 1 - ",x(20,12,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var On=class i extends $t{constructor(e,r,t,l,y){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=wn.maskingField;postInit(e){super.postInit(e),this.maskingFields=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(qt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Orders":return this.compare(t.Orders,l.Orders,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Sales":return this.compare(t.Sales,l.Sales,y);case"Tax":return this.compare(t.Tax,l.Tax,y);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,y);case"Cost":return this.compare(t.Cost,l.Cost,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(Ln,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let y={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",y).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(z,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[Y],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),E(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),L(24,_m,16,10,"ng-template",null,0,A),a(),n(26,"content"),C(27,Om,25,14,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,rm)),o(3),c("routerLink",I(13,lm)),o(3),c("routerLink",I(14,pm)),o(3),c("routerLink",I(15,mm)),o(4),c("routerLink",I(16,sm)),o(6),g(t.data?27:-1))},dependencies:[H,on,Q,$,X,Ye,k,W,ae,le,ge,Ke,U,re,Z,ie],encapsulation:2})};var Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Gm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Hm(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(x(5,4,e.TotalOrders)),o(3),F(x(8,6,e.TotalCost)),o(3),F(x(11,8,e.TotalAmount))}}function Qm(i,s){if(i&1&&(n(0,"tbody",22),V(1,Ym,12,10,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.data.Data)}}function jm(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),C(12,Qm,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),g(e.data.Data?12:-1)}}var Rn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;this.datePipe=T}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(z,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[Y],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Gm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),L(23,Hm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,jm,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(11,Rm)),o(3),c("routerLink",I(12,km)),o(3),c("routerLink",I(13,Wm)),o(3),c("routerLink",I(14,Nm)),o(3),c("routerLink",I(15,Am)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z],encapsulation:2})};var qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Xm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Zm(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function $m(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function e0(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function t0(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function i0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalOrders))}}function n0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.TotalQuantity)," ")}}function a0(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalAmount))}}function o0(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),C(3,i0,3,3,"td",23),C(4,n0,3,3,"td",23),C(5,a0,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),g(r.column.Orders.selected?3:-1),o(),g(r.column.QTY.selected?4:-1),o(),g(r.column.Amount.selected?5:-1)}}function r0(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),C(6,$m,2,0,"th",19),C(7,e0,2,0,"th",20),C(8,t0,2,0,"th",21),a()(),n(9,"tbody",22),V(10,o0,6,4,"tr",null,R),a()()()}if(i&2){let e=m();o(6),g(e.column.Orders.selected?6:-1),o(),g(e.column.QTY.selected?7:-1),o(),g(e.column.Amount.selected?8:-1),o(2),B(e.data==null?null:e.data.Data)}}var kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(qt(1))}openExportModal(){this.matDialog.open(z,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[Y],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Xm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),L(23,Zm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,r0,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,qm)),o(3),c("routerLink",I(13,Um)),o(3),c("routerLink",I(14,Km)),o(3),c("routerLink",I(15,zm)),o(3),c("routerLink",I(16,Jm)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z,ie],encapsulation:2})};var Pr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],c0=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],u0=i=>({ID:i}),_0=(i,s,e)=>({From:i,SupplierID:s,To:e});function C0(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function g0(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function x0(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",I(19,c0))("queryParams",J(20,u0,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",x(10,9,e.Quantity)," "),o(3),c("routerLink",I(22,Pr))("queryParams",mt(23,_0,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",x(16,17,e.Total))}}function f0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),E(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),E(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function S0(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),V(15,x0,17,27,"tr",24,R),a(),C(17,f0,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),B(e.data.Data),o(2),g((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Wn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,y);case"Supplier":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Total":return this.compare(t.Total,l.Total,y);default:return 0}})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[Y],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,C0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,g0,16,10,"ng-template",null,0,A),a(),n(28,"content"),C(29,S0,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Pr)),o(3),c("routerLink",I(13,l0)),o(3),c("routerLink",I(14,p0)),o(3),c("routerLink",I(15,m0)),o(3),c("routerLink",I(16,s0)),o(3),c("routerLink",I(17,d0)),o(6),g(t.data?29:-1))},dependencies:[H,Q,$,X,Ye,k,W,le,ge,Ke,U,oe,Z,ie],encapsulation:2})};var Fr=Gt(ti());var D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],b0=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),E0=i=>[i],I0=i=>({ID:i}),M0=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),br=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],V0=(i,s,e)=>({VariantID:i,From:s,To:e}),B0=(i,s,e)=>({ProductID:i,From:s,To:e});function L0(i,s){if(i&1&&(n(0,"a",9),E(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",tn(1,b0,(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 O0(i,s){if(i&1){let e=b();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",12),p(2," Export "),a()}}function R0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function k0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function W0(i,s){if(i&1){let e=b();n(0,"div",13)(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a()(),n(5,"div",14)(6,"h6"),p(7,"Category"),a(),n(8,"POS-product-category-select",16),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a()(),n(9,"div",14)(10,"h6"),p(11,"From Date"),a(),n(12,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(13,"div",14)(14,"h6"),p(15,"To Date"),a(),n(16,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"div",14)(18,"h6"),p(19,"Brand"),a(),n(20,"POS-brand-options",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.generateQueryParams())}),a()(),n(21,"div",14)(22,"h6"),p(23,"Product Tag"),a(),n(24,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a()(),n(25,"div",14)(26,"h6"),p(27,"Sales Order Tag"),a(),n(28,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()(),n(29,"div",14)(30,"h6"),p(31,"Customer Group"),a(),n(32,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a()(),n(33,"div",14)(34,"h6"),p(35,"Sales Person"),a(),n(36,"sales-person-selector",23),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()(),n(37,"div",14)(38,"h6"),p(39,"Scope"),a(),n(40,"radio-options",24),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),n(41,"div",14)(42,"h6"),p(43,"Customer"),a(),n(44,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()(),n(45,"div",14)(46,"h6"),p(47,"Supplier"),a(),n(48,"autocompleteV2",26),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()(),n(49,"div",14)(50,"h6"),p(51,"Cost Currency"),a(),n(52,"ng-select",27),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectedCurrencyID,t)||(l.selectedCurrencyID=t),_(t)}),L(53,R0,5,2,"ng-template",28)(54,k0,5,2,"ng-template",29),a()(),n(55,"div",14)(56,"h6"),p(57,"Logistics Service"),a(),n(58,"ng-select",30),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a()(),n(59,"div",14)(60,"h6"),p(61,"Product Type"),a(),n(62,"radio-options",31),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()(),n(63,"div",14)(64,"h6"),p(65,"Multiply Unit Quantity"),a(),n(66,"radio-options",32),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(4),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(4),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(4),f("ngModel",e.pageData.Filter.BrandIDs),c("multiple",!0)("clearable",!0),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(4),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(4),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(4),f("ngModel",e.pageData.Filter.SalesID),o(4),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(4),f("ngModel",e.pageData.Filter.CustomerID),o(4),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(4),c("items",e.pageData.Options.Currencies),f("ngModel",e.selectedCurrencyID),o(6),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(4),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function N0(i,s){if(i&1){let e=b();n(0,"th",54)(1,"div",55)(2,"input",56),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function A0(i,s){if(i&1&&(n(0,"th",57),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function G0(i,s){i&1&&(n(0,"th",58),p(1," On Hand "),a())}function H0(i,s){i&1&&(n(0,"th",59),p(1," Cost "),a())}function Y0(i,s){i&1&&(n(0,"th",60),p(1," GROSS "),a())}function Q0(i,s){if(i&1&&(n(0,"th",61),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function j0(i,s){i&1&&(n(0,"th",62),p(1," Tax "),a())}function q0(i,s){if(i&1&&(n(0,"th",63),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function U0(i,s){i&1&&(n(0,"th",64),p(1," PROFIT "),a())}function K0(i,s){i&1&&(n(0,"th",65),p(1," % "),a())}function z0(i,s){if(i&1){let e=b();n(0,"td")(1,"div",55)(2,"input",77),h("ngModelChange",function(t){u(e);let l=m().$implicit;return S(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function J0(i,s){if(i&1){let e=b();Wt(0),n(1,"img",78),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l==null?null:l.ImageURL,t))}),a(),Nt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,Ki)}}function X0(i,s){if(i&1){let e=b();n(0,"a",79)(1,"img",80),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function Z0(i,s){if(i&1&&(n(0,"td",81)(1,"a",82),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",bo(4,M0,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(x(3,2,r.Quantity))}}function $0(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.OnHand)," ")}}function es(i,s){if(i&1&&(p(0),d(1,"amountFraction")),i&2){let e=m(2).$implicit,r=m(2);At(" ",r.primaryCurrency().Symbol," ",x(1,2,e.UnitCost*e.CostCurrencyExchangeRate)," ")}}function ts(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"amountFraction"),E(3,"br"),C(4,es,2,4),a()),i&2){let e,r=m().$implicit,t=m(2);o(),At(" ",r.CostCurrencySymbol," ",x(2,3,r.UnitCost)," "),o(3),g(r.CostCurrencyID&&r.CostCurrencyID!==((e=t.primaryCurrency())==null?null:e.ID)?4:-1)}}function is(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function ns(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,br))("queryParams",mt(12,V0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function as(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,br))("queryParams",mt(12,B0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function os(i,s){if(i&1&&(n(0,"td",81),L(1,ns,5,16,"a",84)(2,as,5,16,"a",84),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function rs(i,s){if(i&1&&(n(0,"td",85),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function ls(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.SalesNTax)," ")}}function ps(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Profit)," ")}}function ms(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Margin)," ")}}function ss(i,s){if(i&1&&(n(0,"tr",66),L(1,z0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",67)(6,"div",68),L(7,J0,2,1,"ng-container",8)(8,X0,2,1,"a",69),a(),n(9,"div",70)(10,"a",71),p(11),a(),n(12,"small",72),p(13),a()()()(),L(14,Z0,4,11,"td",73)(15,$0,3,3,"td",73)(16,ts,5,5,"td",74)(17,is,3,3,"td",73)(18,os,3,2,"td",73)(19,rs,3,3,"td",75)(20,ls,3,3,"td",73)(21,ps,3,4,"td",76)(22,ms,3,4,"td",76),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",J(17,E0,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(19,I0,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function ds(i,s){i&1&&E(0,"td",81)}function cs(i,s){i&1&&(n(0,"td",81),p(1," Total : "),a())}function us(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function _s(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function Cs(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function gs(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function xs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Sales")))}}function fs(i,s){if(i&1&&(n(0,"td",85)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Tax")))}}function Ss(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function hs(i,s){if(i&1&&(n(0,"td",86),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",x(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function ys(i,s){if(i&1&&(n(0,"td",86),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",x(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function Ds(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",87),E(2,"td",81),L(3,ds,1,0,"td",73)(4,cs,2,0,"td",73)(5,us,4,6,"td",73)(6,_s,4,6,"td",73)(7,Cs,4,6,"td",74)(8,gs,4,6,"td",73)(9,xs,5,6,"td",88)(10,fs,5,6,"td",75)(11,Ss,5,6,"td",88)(12,hs,5,10,"td",76)(13,ys,7,16,"td",76),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function vs(i,s){if(i&1){let e=b();n(0,"content")(1,"div",36)(2,"div",37)(3,"table",38),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",39)(5,"tr"),L(6,N0,3,1,"th",40),n(7,"th",41),p(8,"No"),a(),n(9,"th",42),p(10,"Name"),a(),L(11,A0,2,1,"th",43)(12,G0,2,0,"th",44)(13,H0,2,0,"th",45)(14,Y0,2,0,"th",46)(15,Q0,2,1,"th",47)(16,j0,2,0,"th",48)(17,q0,2,1,"th",49)(18,U0,2,0,"th",50)(19,K0,2,0,"th",51),a()(),n(20,"tbody"),L(21,ss,23,21,"tr",52),a(),L(22,Ds,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",53),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Nn=class i extends ve{constructor(e,r,t,l,y,T,je){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,y);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=y;this.matDialog=T;this.bigPicture=je}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Me(j);columnService=Me(st);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=at([]);queryParams=at(null);primaryCurrency=at(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=Ze(Xe({},this.data),{Data:e.Data.map(t=>Ze(Xe({},t),{checked:!1}))}),this.primaryCurrency.set(e.PrimaryCurrency);for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=Ze(Xe({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=Ze(Xe({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>Ze(Xe({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,ki.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=Ze(Xe({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),y);case"Quantity":return M.compare(t.Quantity,l.Quantity,y);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,y);case"Inventory":return M.compare(t.OnHand,l.OnHand,y);case"Total_Sales":return M.compare(t.Total,l.Total,y);case"Total_Tax":return M.compare(t.Tax,l.Tax,y);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,y);case"ReOrder":return M.compare(t.MinStock,l.MinStock,y);case"Gross":return M.compare(t.Gross,l.Gross,y);case"Margin":return M.compare(t.Margin,l.Margin,y);case"Profit":return M.compare(t.Profit,l.Profit,y);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(z,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Fr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}showCurrencyExchangeRate(e){return this.primaryCurrency().ID===e}get selectedCurrencyID(){return this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID:this.pageData.Filter.ProductCostCurrencyID}set selectedCurrencyID(e){this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID=e:this.pageData.Filter.ProductCostCurrencyID=e}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ue),w(Ne),w(K),w(En))};static \u0275cmp=O({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[Y],decls:30,vars:20,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["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"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindValue","ID","bindLabel","Name",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),L(2,L0,3,7,"a",2),C(3,O0,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),L(27,W0,67,37,"ng-template",null,0,A),a(),L(29,vs,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),g(t.roleService.global.Export?3:-1),o(6),c("routerLink",I(14,D0)),o(3),c("routerLink",I(15,v0)),o(3),c("routerLink",I(16,T0)),o(3),c("routerLink",I(17,w0)),o(3),c("routerLink",I(18,P0)),o(3),c("routerLink",I(19,F0)),o(5),c("ngIf",t.data))},dependencies:[H,$e,Mo,on,Q,$,X,Oo,k,W,ae,le,ge,we,Ae,ce,Lt,U,ze,wi,Ko,zo,me,oe,Z,ie],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var ws=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ms=i=>({ID:i}),Vs=(i,s)=>s.Name,Bs=(i,s)=>s.ID;function Ls(i,s){if(i&1){let e=b();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",17),p(2," Export "),a()}}function Os(i,s){if(i&1){let e=b();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"POS-brand-options",23),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(31,"h6"),p(32,"Hide Zero"),a(),n(33,"radio-options",30),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter),o(3),f("model",e.pageData.Filter.HideZero)}}function Rs(i,s){i&1&&(n(0,"th",31),p(1,"Code"),a()),i&2&&Ut("text-align","right")}function ks(i,s){i&1&&(n(0,"th",32),p(1," Cost "),a()),i&2&&Ut("text-align","right")}function Ws(i,s){i&1&&(n(0,"th",32),p(1," Sales "),a()),i&2&&Ut("text-align","right")}function Ns(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",ft(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function As(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function Gs(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),F(e.Code)}}function Hs(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",x(2,3,e.UnitCost)," ")}}function Ys(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",x(2,3,e.UnitPrice)," ")}}function Qs(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function js(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function qs(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",33),p(3),a()(),C(4,Gs,2,3,"td",34),C(5,Hs,3,5,"td",34),C(6,Ys,3,5,"td",34),V(7,Qs,2,1,"td",14,Bi),C(9,js,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",J(7,Ms,e.ID)),o(),D(" ",e.Name),o(),g(r.column.code.selected?4:-1),o(),g(r.column.cost&&r.column.cost.selected?5:-1),o(),g(r.column.sales&&r.column.sales.selected?6:-1),o(),B(e.Quantities),o(2),g(r.column.total.selected?9:-1)}}var Gn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(K),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[Y],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose...",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["name","HideZero",3,"modelChange","model"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.submit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Ls,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,Os,34,18,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),C(35,Rs,2,2,"th",11),C(36,ks,2,2,"th",12),C(37,Ws,2,2,"th",12),V(38,Ns,2,3,"th",13,Vs),C(40,As,2,0,"th",14),a()(),n(41,"tbody"),V(42,qs,10,9,"tr",15,Bs),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(16,ws)),o(3),c("routerLink",I(17,Ps)),o(3),c("routerLink",I(18,Fs)),o(3),c("routerLink",I(19,bs)),o(3),c("routerLink",I(20,Es)),o(3),c("routerLink",I(21,Is)),o(12),g(t.column.code.selected?35:-1),o(),g(t.column.cost&&t.column.cost.selected?36:-1),o(),g(t.column.sales&&t.column.sales.selected?37:-1),o(),B(t.data==null?null:t.data.Outlet),o(2),g(t.column.total.selected?40:-1),o(2),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,ce,Lt,U,ze,Ti,Z],encapsulation:2})};var ao=Gt(ti());var Us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Er=()=>({standalone:!0}),Ir=()=>({overflow:"visible"}),$s=i=>[i],ed=i=>({ID:i});function td(i,s){if(i&1){let e=b();n(0,"a",14),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",15),p(2," Export"),a()}}function id(i,s){if(i&1){let e=b();n(0,"div",16)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",18),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",19)(8,"div",20)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",22)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",I(18,Er))("contentStyle",I(19,Ir))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",I(20,Er))("contentStyle",I(21,Ir))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function nd(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function ad(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function od(i,s){i&1&&(n(0,"th",13)(1,"span",24),p(2," On Hand "),a()())}function rd(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function ld(i,s){i&1&&(n(0,"th",13)(1,"span",25),p(2," Total "),a()())}function pd(i,s){if(i&1&&(n(0,"td")(1,"a",27),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",J(3,$s,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(5,ed,e.ID)),o(),D(" ",e.Name," ")}}function md(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function sd(i,s){if(i&1&&(n(0,"td",26)(1,"span",24),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function dd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function cd(i,s){if(i&1&&(n(0,"td",26)(1,"span",25),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function ud(i,s){if(i&1&&(n(0,"tr"),C(1,pd,3,7,"td"),C(2,md,2,1,"td"),C(3,sd,4,4,"td",26),V(4,dd,3,4,"td",26,R),C(6,cd,5,7,"td",26),a()),i&2){let e=m();o(),g(e.column.name.selected?1:-1),o(),g(e.column.code.selected?2:-1),o(),g(e.column.OnHand.selected?3:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?6:-1)}}function _d(i,s){i&1&&E(0,"td")}function Cd(i,s){i&1&&(n(0,"td",26),p(1,"Total :"),a())}function gd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function xd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function fd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Sd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",28),C(2,_d,1,0,"td"),C(3,Cd,2,0,"td",26),C(4,gd,3,4,"td",26),V(5,xd,3,4,"td",26,R),C(7,fd,4,7,"td",26),a()()),i&2){let e=m();o(2),g(e.column.name.selected?2:-1),o(),g(e.column.code.selected?3:-1),o(),g(e.column.OnHand.selected?4:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?7:-1)}}var Hn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;let T=new Date().getFullYear(),je=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,je)}_toastrService=Me(Ue);columnService=Me(st);years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,ao.default)(this.pageData.Filter.MonthFrom),r=(0,ao.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",y=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(y),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[Y],decls:43,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.onSubmit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,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," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,id,19,22,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return t.sortData(T)}),n(31,"thead",9)(32,"tr",10),C(33,nd,2,0,"th",11),C(34,ad,2,0,"th",12),C(35,od,3,0,"th",13),V(36,rd,2,1,"th",13,R),C(38,ld,3,0,"th",13),a()(),n(39,"tbody"),V(40,ud,7,4,"tr",null,R),a(),C(42,Sd,8,4,"tfoot"),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(17,Us)),o(3),c("routerLink",I(18,Ks)),o(3),c("routerLink",I(19,zs)),o(3),c("routerLink",I(20,Js)),o(3),c("routerLink",I(21,Xs)),o(3),c("routerLink",I(22,Zs)),o(10),g(t.column.name.selected?33:-1),o(),g(t.column.code.selected?34:-1),o(),g(t.column.OnHand.selected?35:-1),o(),B(t.data==null?null:t.data.MonthlySales),o(2),g(t.column.total.selected?38:-1),o(2),B(t.data==null?null:t.data.Data),o(2),g((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?42:-1))},dependencies:[H,Q,k,W,ae,le,ge,we,ce,U,nr,me,re],encapsulation:2})};var hd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],yd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],vd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Td=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],wd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Pd=i=>[i],Fd=i=>({ID:i});function bd(i,s){if(i&1){let e=b();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",14),p(2," Export"),a()}}function Ed(i,s){if(i&1){let e=b();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Id(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Md(i,s){if(i&1&&(n(0,"tr"),E(1,"th")(2,"th"),V(3,Id,2,1,"th",22,R),a()),i&2){let e=m();o(3),B(e.data==null?null:e.data.Outlet)}}function Vd(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Bd(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",J(3,Pd,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",J(5,Fd,r[1])),o(),F(r[e])}}function Ld(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Od(i,s){if(i&1&&(n(0,"td",11),C(1,Bd,2,7,"a",23)(2,Ld,1,1),a()),i&2){let e=s.$index;o(),g(e===0?1:2)}}function Rd(i,s){if(i&1&&(n(0,"tr",11),V(1,Od,3,1,"td",11,R),a()),i&2){let e=s.$implicit,r=m();o(),B(r.getFilteredKeys(e))}}var Yn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[Y],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,bd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,Ed,16,10,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),C(32,Md,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),V(38,Vd,2,1,"th",12,R),a()(),n(40,"tbody"),V(41,Rd,3,0,"tr",11,R),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,hd)),o(3),c("routerLink",I(13,yd)),o(3),c("routerLink",I(14,Dd)),o(3),c("routerLink",I(15,vd)),o(3),c("routerLink",I(16,Td)),o(3),c("routerLink",I(17,wd)),o(9),g((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),B(t.data==null?null:t.data.Header),o(3),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,X,k,W,we,ce,U],encapsulation:2})};var kd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Wd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Nd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Ad=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Gd=(i,s,e)=>({CategoryID:i,From:s,To:e}),Hd=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Mr=i=>({CategoryID:i});function Yd(i,s){if(i&1){let e=b();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",8),p(2," Export "),a()}}function Qd(i,s){if(i&1){let e=b();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"POS-brand-options",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",14)(15,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Sales Person"),a(),n(18,"sales-person-selector",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(19,"h6"),p(20,"Customer"),a(),n(21,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(22,"h6"),p(23,"Discount Calculation"),a(),n(24,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(25,"h6"),p(26,"Hide Zero & Negative"),a(),n(27,"radio-options",19),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(28,"h6"),p(29,"Product Type"),a(),n(30,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.BrandID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function jd(i,s){i&1&&(n(0,"th",31),p(1," Cost "),E(2,"p-treeTableSortIcon",32),a())}function qd(i,s){i&1&&(n(0,"th",33),p(1," Gross "),E(2,"p-treeTableSortIcon",34),a(),n(3,"th",35),p(4," Disc "),E(5,"p-treeTableSortIcon",36),a(),n(6,"th",37),p(7," Sales "),E(8,"p-treeTableSortIcon",38),a())}function Ud(i,s){i&1&&(n(0,"th",39),p(1," Profit "),E(2,"p-treeTableSortIcon",40),a(),n(3,"th",41),p(4," % "),E(5,"p-treeTableSortIcon",42),a())}function Kd(i,s){if(i&1&&(n(0,"tr",26)(1,"th",27),p(2," Category "),E(3,"p-treeTableSortIcon",28),a(),n(4,"th",29),p(5," Qty "),E(6,"p-treeTableSortIcon",30),a(),C(7,jd,3,0,"th",31),C(8,qd,9,0),C(9,Ud,6,0),a()),i&2){let e=m(2);o(7),g(e.roleService.product.Cost?7:-1),o(),g(e.roleService.report.Price?8:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?9:-1)}}function zd(i,s){if(i&1&&(n(0,"td",47)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",ft(e.CostInDirect&&e.Cost?"Direct ("+x(2,3,e.Cost)+") Indirect ("+x(3,5,e.CostInDirect)+")":"")),o(3),F(x(5,7,e.DisplayedCost))}}function Jd(i,s){if(i&1&&(n(0,"td",48)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td",49)(7,"a",50),d(8,"number"),d(9,"number"),p(10),d(11,"amountFraction"),a()(),n(12,"td",48)(13,"span",46),d(14,"number"),d(15,"number"),n(16,"a",45),p(17),d(18,"amountFraction"),a()()()),i&2){let e=m().rowData;o(),c("matTooltip",ft(e.GrossIndirect&&e.GrossSales?"Direct ("+x(2,13,e.GrossSales)+") Indirect ("+x(3,15,e.GrossIndirect)+")":"")),o(3),F(x(5,17,e.DisplayedGross)),o(3),c("matTooltip",ft(e.DiscountIndirect&&e.Discount?"Direct ("+x(8,19,e.Discount)+") Indirect ("+x(9,21,e.DiscountIndirect)+")":""))("routerLink",I(31,Hd))("queryParams",J(32,Mr,e.ID)),o(3),F(x(11,23,e.DisplayedTotalDiscount)),o(3),c("matTooltip",ft(e.NetSalesIndirect&&e.Sales?"Direct ("+x(14,25,e.Sales)+") Indirect ("+x(15,27,e.NetSalesIndirect)+")":"")),o(3),c("routerLink",I(34,Vr))("queryParams",J(35,Mr,e.ID)),o(),F(x(18,29,e.DisplayedNetSales))}}function Xd(i,s){if(i&1&&(n(0,"span",46),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",ft(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",x(4,9,e.DisplayedPercentage),"%")}}function Zd(i,s){if(i&1&&(n(0,"td",51)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td"),C(7,Xd,5,11,"span",46),a()),i&2){let e=m().rowData,r=m(2);o(),c("matTooltip",ft(e.ProfitInDirect&&e.Profit?"Direct ("+x(2,4,e.Profit)+") Indirect ("+x(3,6,e.ProfitInDirect)+")":"")),o(3),F(x(5,8,e.DisplayedProfit)),o(3),g(r.roleService.report.Profit?7:-1)}}function $d(i,s){if(i&1&&(n(0,"tr",43)(1,"td"),E(2,"p-treeTableToggler",44),n(3,"a",45),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",46),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),C(13,zd,6,9,"td",47),C(14,Jd,19,37),C(15,Zd,8,10),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",I(23,Vr))("queryParams",mt(24,Gd,r.ID,v(4,11,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,14,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",ft(r.QuantityIndirect&&r.Quantity?"Direct ("+x(9,17,r.Quantity)+") Indirect ("+x(10,19,r.QuantityIndirect)+")":"")),o(3),F(x(12,21,r.DisplayedQuantity)),o(2),g(t.roleService.product.Cost?13:-1),o(),g(t.roleService.report.Price?14:-1),o(),g(t.roleService.product.Cost&&t.roleService.report.Price&&t.roleService.report.Profit?15:-1)}}function ec(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(2,1,e.data.Aggregate.TotalCost)," ")}}function tc(i,s){if(i&1&&(n(0,"td",55)(1,"a"),p(2),d(3,"amountFraction"),a()(),n(4,"td",53),p(5),d(6,"amountFraction"),a(),n(7,"td",55),p(8),d(9,"amountFraction"),a()),i&2){let e=m(3);o(2),F(x(3,3,e.data.Aggregate.TotalGross)),o(3),D(" ",x(6,5,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",x(9,7,e.data.Aggregate.TotalNetSales)," ")}}function ic(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a(),n(3,"td",53),p(4),d(5,"number"),a()),i&2){let e=m(3);o(),D(" ",x(2,2,e.data.Aggregate.TotalProfit)," "),o(3),D(" ",x(5,4,e.data.Aggregate.TotalPercentage),"% ")}}function nc(i,s){if(i&1&&(n(0,"tr",52)(1,"td",53),p(2,"Total :"),a(),n(3,"td",53),p(4),d(5,"quantityFraction"),a(),C(6,ec,3,3,"td",54),C(7,tc,10,9),C(8,ic,6,6),a()),i&2){let e=m(2);o(4),D(" ",x(5,4,e.data.Aggregate.TotalQuantity)," "),o(2),g(e.roleService.product.Cost?6:-1),o(),g(e.roleService.report.Price?7:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?8:-1)}}function ac(i,s){if(i&1&&(n(0,"content")(1,"div",21)(2,"p-treeTable",22),L(3,Kd,10,3,"ng-template",23)(4,$d,16,28,"ng-template",24)(5,nc,9,6,"ng-template",25),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",I(4,Ad))}}var Qn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(z,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[Y],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-danger",2,"width","120px"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[1,"text-success",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Yd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),L(17,Qd,31,16,"ng-template",null,0,A),a(),C(19,ac,6,5,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,kd)),o(3),c("routerLink",I(11,Wd)),o(3),c("routerLink",I(12,Nd)),o(5),g(t.data?19:-1))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,mr,No,ur,sr,dr,cr,ce,Lt,U,ze,re,oe,Z,ie],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var oc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],lc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function pc(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function mc(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function sc(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function dc(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function cc(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Value))}}function uc(i,s){if(i&1&&(n(0,"td"),C(1,dc,2,1,"span"),C(2,cc,3,3,"span"),a()),i&2){let e=s.$implicit;o(),g(e.Key=="Category"?1:-1),o(),g(e.Key!="Category"?2:-1)}}function _c(i,s){if(i&1&&(n(0,"tr"),V(1,uc,3,2,"td",null,R),a()),i&2){let e=s.$implicit;o(),B(e)}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",x(2,1,e))}}function gc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),V(4,Cc,3,3,"td",null,R),a()()),i&2){let e=m(2);o(4),B(e.data.Sum)}}function xc(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),V(4,sc,2,2,"th",19,R),a()(),n(6,"tbody"),V(7,_c,3,0,"tr",null,R),a(),C(9,gc,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),B(e.data.Dataheader),o(3),B(e.data.Data),o(2),g(e.data.Data.length>0?9:-1)}}var jn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}openExportModal(){this.matDialog.open(z,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let je=t.find(ai=>ai.Key===[this.data.Dataheader[T]].toString()).Value,vt=l.find(ai=>ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(je,vt,y)}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[Y],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),L(17,mc,16,9,"ng-template",null,0,A),a(),n(19,"content"),C(20,xc,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,oc)),o(3),c("routerLink",I(11,rc)),o(3),c("routerLink",I(12,lc)),o(6),g(t.data?20:-1))},dependencies:[H,Q,X,k,W,le,ge,Ae,ce,U,Z],encapsulation:2})};var fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function yc(i,s){if(i&1){let e=b();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Dc(i,s){if(i&1&&(n(0,"div",6),E(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var qn=class i extends pe{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(G),w(N))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[Y],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),L(16,yc,10,6,"ng-template",null,0,A),a(),n(18,"content"),C(19,Dc,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",I(8,fc)),o(3),c("routerLink",I(9,Sc)),o(3),c("routerLink",I(10,hc)),o(6),g(t.data?19:-1))},dependencies:[H,Q,$,k,W,ii],encapsulation:2})};var vc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Tc(i,s){if(i&1){let e=b();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function wc(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),E(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),E(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var Un=class i extends ve{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let y={name:l.Name+": "+l.Description,y:l.Transaction};t.push(y)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,y){return l+"<br/>"+y.series.name+": <b>"+y.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[Y],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),E(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),L(6,Tc,13,9,"ng-template",null,0,A),a(),C(8,wc,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",I(6,vc)),o(6),g(t.data?8:-1))},dependencies:[H,Q,$,X,k,W,ii,Ft,U],encapsulation:2})};function Pc(i,s){if(i&1){let e=b();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function Fc(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function bc(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(x(3,5,e.Visitor)),o(3),F(x(6,7,e.Orders)),o(3),F(x(9,9,e.TotalVisitor)),o(3),F(x(12,11,e.Sales)),o(3),F(x(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Ec(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),V(15,bc,16,15,"tr",null,R),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),B(e.data.Data),o(7),F(x(24,7,v(23,4,e.data.Data,"Orders"))),o(4),F(x(28,12,v(27,9,e.data.Data,"TotalVisitor"))),o(4),F(x(32,17,v(31,14,e.data.Data,"Sales"))),o(4),F(x(35,19,e.getSpendingPerPersonSum(e.data.Data)))}}var Kn=class i extends pe{constructor(e,r,t,l,y){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(z,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[Y],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Pc,3,0,"a",2),a(),n(3,"filters"),L(4,Fc,10,6,"ng-template",null,0,A),a(),n(6,"content"),C(7,Ec,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),g(t.data?7:-1))},dependencies:[H,X,k,W,U,me,re,Z],encapsulation:2})};var Ic=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Mc(i,s){if(i&1){let e=b();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",16),p(2," Export "),a()}}function Vc(i,s){if(i&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Bc(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Lc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Revenue))}}function Oc(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),C(20,Lc,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(x(5,7,e.Count)),o(3),F(x(8,9,e.Quantity)),o(3),F(x(11,11,e.Sales)),o(3),F(x(15,15,x(14,13,e.Tax))),o(4),F(x(19,19,x(18,17,e.SalesWithTax))),o(3),g(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Rc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(x(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var zn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(z,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[Y],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Mc,3,0,"a",2),n(3,"a",3),E(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),L(7,Vc,10,6,"ng-template",null,0,A),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),C(26,Bc,2,0,"th",10),a()(),n(27,"tbody"),V(28,Oc,21,21,"tr",null,R),a(),n(30,"tfoot")(31,"tr",11),E(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),C(55,Rc,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",I(42,Ic)),o(23),g(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),B(t.data==null?null:t.data.Data),o(6),F(x(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(x(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(x(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(x(49,33,x(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(x(54,40,x(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),g(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[H,Q,X,k,W,U,me,Xo,re,Z,ie],encapsulation:2})};var lo=Gt(ti());var kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],ro=(i,s)=>({From:i,To:s}),Wc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Nc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Ac(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Gc(i,s){if(i&1&&(n(0,"content")(1,"div",11),E(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Jn=class i extends pe{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(s,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=(0,lo.default)(s.from).format("YYYY-MM-DD[T]00:00:00"),this.pageData.Filter.To=(0,lo.default)(s.to).format("YYYY-MM-DD[T]00:00:00")}static \u0275fac=function(e){return new(e||i)(w(G),w(N),w(Ne))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[Y],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return r.searchFromPageOne()}),h("filterChange",function(y){return u(t),S(r.pageData.Filter,y)||(r.pageData.Filter=y),_(y)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),L(16,Ac,13,11,"ng-template",null,0,A),a(),C(18,Gc,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",I(11,kc))("queryParams",xe(12,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(15,Wc))("queryParams",xe(16,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(19,Nc))("queryParams",xe(20,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),g(r.data?18:-1))},dependencies:[H,Q,$,k,W,Ft,Ot,ce,U],encapsulation:2})};var Qc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Zn=(()=>{class i{constructor(){this.dateChange=nn(),this.width=Ci(),this.minDate=M.MinDate}ngOnInit(){}setMonthAndYear(e,r){let t=null;e&&(t=e.toDate(),t.setHours(0,0,0,0)),this.date=t,this.dateChange.emit(t),r.close()}onDateChange(e){let r=null;e&&(r=e.toDate()),this.date=r,this.dateChange.emit(r)}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="outside")}}chosenYearHandler(e,r){let t=new Date(e.getFullYear(),0,1);this.date=t.toISOString(),r.close()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=O({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:[1,"width"]},outputs:{dateChange:"dateChange"},features:[en([{provide:un,useClass:Fn,deps:[cn,pr]},{provide:_n,useValue:Qc}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(r,t){if(r&1){let l=b();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(T){return t.onDateChange(T.value)}),a(),E(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(T){u(l);let je=Xt(4);return _(t.chosenYearHandler(T,je))})("monthSelected",function(T){u(l);let je=Xt(4);return _(t.setMonthAndYear(T,je))})("opened",function(){return t.onOpenDatepicker()})("closed",function(){return t.onCloseDatepicker()}),a()()}if(r&2){let l=Xt(4);Ut("width",t.width()||100,"%"),o(),c("matDatepicker",l)("value",t.date==t.minDate?null:t.date),o(),c("for",l)}},dependencies:[Ht,hn,gi,xn,fn,Sn,xi,Dn,gn,Cn,yn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{a as ii,b as hr}from"./chunk-BWRSAUCR.js";import{a as Sr}from"./chunk-LCO3LO7L.js";import{a as ve}from"./chunk-ZVYG6FFO.js";import{a as Dr}from"./chunk-V4AZXNFY.js";import{a as ze}from"./chunk-NOF55KZZ.js";import{a as Ft,b as yr}from"./chunk-GWQWKZCJ.js";import{a as Ot}from"./chunk-XJTZNTJ7.js";import{b as vr}from"./chunk-DI3HRQ2Y.js";import{a as En}from"./chunk-NEKBV3FU.js";import{a as wi}from"./chunk-3KDQ42LP.js";import{a as st}from"./chunk-P2I7DDV6.js";import{a as Ho}from"./chunk-BW3AS55J.js";import{b as qo}from"./chunk-LPFB4TBW.js";import"./chunk-YECO23BV.js";import{a as Di}from"./chunk-J6SDXI74.js";import{a as Lt}from"./chunk-5FGX2TVD.js";import{a as Ti}from"./chunk-5W5K2LNS.js";import{a as $t}from"./chunk-RVZTJFUM.js";import{a as mr,b as sr,c as dr,e as cr,f as ur,g as _r}from"./chunk-4ZYB3EZJ.js";import"./chunk-XV3LZZ5N.js";import{a as bn,b as pi}from"./chunk-AVOTGRPZ.js";import{a as Cr,b as gr,d as xr,g as fr}from"./chunk-ZOY3GIWS.js";import{e as jo}from"./chunk-CIDPGJ5I.js";import"./chunk-6FI765LW.js";import{a as ti,b as pr,c as Fn,d as X}from"./chunk-3XXHI4EL.js";import{a as vi}from"./chunk-XC2DOMTX.js";import{c as xn,d as fn,e as Sn,m as gi}from"./chunk-OFAMZL4W.js";import{a as cn,b as un,c as _n,d as hn}from"./chunk-PRC6BIGW.js";import{b as Dn,c as xi}from"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import{b as yn}from"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import{b as le,c as ge,d as Go}from"./chunk-W2DHHNBD.js";import{a as Pt,b as lr}from"./chunk-MVXEAR7T.js";import{b as tr,c as ir,e as ce}from"./chunk-NNSC3LJC.js";import"./chunk-WWPIIY42.js";import{c as nr,d as ar}from"./chunk-HMG4CYEC.js";import"./chunk-NS7JQEFX.js";import{a as Z}from"./chunk-45724ODM.js";import{a as U}from"./chunk-JFYIZWQX.js";import{b as or,c as rr}from"./chunk-57SVR7NW.js";import{c as Qo,d as we}from"./chunk-DU3EU6UY.js";import{a as ie}from"./chunk-ZDHOVOGV.js";import"./chunk-5FZQUUGO.js";import"./chunk-R4WRYN66.js";import"./chunk-FKYSDVEG.js";import"./chunk-ELS45DNO.js";import"./chunk-TMLUWER3.js";import{b as z}from"./chunk-4OXYU3IN.js";import"./chunk-S5D6TMC7.js";import{a as pe}from"./chunk-7AX6S7TS.js";import{a as Ao}from"./chunk-IUG65W2Y.js";import"./chunk-GQLZJQI6.js";import{c as Uo}from"./chunk-Z3E6ZNA3.js";import"./chunk-KCKWSNMS.js";import"./chunk-IEXCLXA2.js";import{a as Ke}from"./chunk-7TPO6NBM.js";import"./chunk-NS5MW6GH.js";import"./chunk-WQ627RLB.js";import"./chunk-VTO7AEJ7.js";import"./chunk-YQH2QORC.js";import"./chunk-ZAPREM3S.js";import"./chunk-X36HAWOW.js";import"./chunk-KXQNUECI.js";import"./chunk-QWL5S2RG.js";import"./chunk-UL6HUKIC.js";import"./chunk-NLFBNSNG.js";import{a as q}from"./chunk-JYCI6IOX.js";import{f as H,g as yi}from"./chunk-3AI3Q3ND.js";import"./chunk-DIRDQNW6.js";import"./chunk-M42U7VID.js";import{a as G}from"./chunk-GUJJHZVX.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import{b as er}from"./chunk-K4ITYVID.js";import{b as wn,e as Ae,f as Pn}from"./chunk-JQUC4D3I.js";import"./chunk-INL666X3.js";import{d as Cn,g as gn,n as Yo}from"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import{a as ae,b as dn}from"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{A as Tn,B as Zo,C as ei,K as hi,O as $o,g as me,o as Jo,s as vn,z as Xo}from"./chunk-UICLTBFW.js";import"./chunk-5UKWQA6U.js";import"./chunk-QYSFCWV7.js";import{a as Ko,b as zo,d as $}from"./chunk-Q7OVBNEW.js";import"./chunk-4IZBOUZR.js";import{a as fi,b as Si,c as K}from"./chunk-6RFU4RXC.js";import{b as mn}from"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import"./chunk-PG5RORVW.js";import"./chunk-OQDKFI6M.js";import"./chunk-TKBQO5Z6.js";import{a as ki,b as sn,c as Zt}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import{va as No}from"./chunk-FMECWSCG.js";import{E as Ht,F as pn,b as Oo,c as Ye,h as k,l as Ro,o as W,q as ko,s as Wo}from"./chunk-QMS2MBIA.js";import"./chunk-23YYZHYE.js";import"./chunk-TNHVTQN6.js";import"./chunk-WLVEHCCR.js";import{b as j}from"./chunk-P7GOTTNS.js";import{a as M}from"./chunk-3DEA4WWC.js";import"./chunk-F3VGQ57K.js";import{n as Ue,q as N}from"./chunk-3GXUD7K4.js";import{Ba as To,Bb as C,Bc as en,Bd as Bo,Cc as I,Db as g,Dc as J,Eb as Bi,Ec as xe,F as li,Fa as at,Fb as R,Fc as mt,Gb as V,Gc as Kt,Ha as Ui,Hb as B,Hc as tn,Ib as c,Ic as bo,J as Mi,Jb as n,Kb as a,Kc as d,L as yo,La as wo,Lb as E,Lc as x,Mc as v,N as Do,Nc as _i,Nd as Lo,Oa as Po,Pb as Wt,Qb as Nt,Qc as A,R as Qi,Rd as Ne,Sa as be,Sc as Eo,Tc as Oi,Td as ln,Ua as Ki,Ub as b,Ud as Q,Wd as Ri,Xb as P,Xc as nn,Yc as Ci,Z as qt,Za as o,Zb as m,ad as an,ba as no,bc as Xi,cc as Zi,dc as $i,dd as Io,eb as w,ga as kt,hc as Xt,ib as O,ic as Ut,jb as zi,jc as Li,kb as Ji,mb as Fo,mc as p,md as $e,na as vo,nb as Y,nc as F,o as ci,oa as ji,ob as L,oc as D,od as Mo,pa as ui,pc as At,pd as on,ra as Me,rc as f,sc as S,sd as Vo,tc as h,u as ri,ud as oe,v as io,va as u,wa as _,wd as re,xb as Vi,xc as ft,za as qi,zd as rn}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import{a as Xe,b as Ze,f as gl,h as Gt,k as di}from"./chunk-SNAKHGZS.js";var Co=gl((Wi,_o)=>{(function(i,s){typeof Wi=="object"&&typeof _o=="object"?_o.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Wi=="object"?Wi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})("u"<typeof window?Wi:window,(i,s)=>(()=>{"use strict";var e={944:he=>{he.exports=i},984:he=>{he.exports=s}},r={};function t(he){var te=r[he];if(te!==void 0)return te.exports;var Oe=r[he]={exports:{}};return e[he](Oe,Oe.exports,t),Oe.exports}t.n=he=>{var te=he&&he.__esModule?()=>he.default:()=>he;return t.d(te,{a:te}),te},t.d=(he,te)=>{for(var Oe in te)t.o(te,Oe)&&!t.o(he,Oe)&&Object.defineProperty(he,Oe,{enumerable:!0,get:te[Oe]})},t.o=(he,te)=>Object.prototype.hasOwnProperty.call(he,te);var l={};t.d(l,{default:()=>Cl});var y=t(944),T=t.n(y),je=t(984),vt=t.n(je);let ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Ai(he,te,Oe,Ie,et,ee){let Be=(ee-te)*(Oe-he)-(Ie-te)*(et-he);return Be>0||!(Be<0)}function Gi(he,te,Oe,Ie,et,ee,Be,ke){return Ai(he,te,et,ee,Be,ke)!==Ai(Oe,Ie,et,ee,Be,ke)&&Ai(he,te,Oe,Ie,et,ee)!==Ai(he,te,Oe,Ie,Be,ke)}let{animObject:to}=T(),{format:ll}=vt(),{setOptions:pl}=T(),{composed:ml}=T(),{boxIntersectLine:go,intersectRect:sl}={boxIntersectLine:function(he,te,Oe,Ie,et,ee,Be,ke){return Gi(he,te,he+Oe,te,et,ee,Be,ke)||Gi(he+Oe,te,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te+Ie,he+Oe,te+Ie,et,ee,Be,ke)||Gi(he,te,he,te+Ie,et,ee,Be,ke)},intersectRect:function(he,te){return!(te.left>he.right||te.right<he.left||te.top>he.bottom||te.bottom<he.top)}},{addEvent:xo,extend:fo,fireEvent:dl,isNumber:Hi,pick:zt,pushUnique:cl,syncTimeout:ul}=T();function mi(he,te,Oe,Ie,et){let ee=he.chart,Be=he.options.label||{},ke=zt(Be.onArea,!!he.area),tt=ke||Be.connectorAllowed,dt=ee.boxesToAvoid,St=Number.MAX_VALUE,ct=Number.MAX_VALUE,_t,ht,It,Tt,ot,rt,Le;for(rt=0;dt&&rt<dt.length;rt+=1)if(sl(dt[rt],{left:te,right:te+Ie.width,top:Oe,bottom:Oe+Ie.height}))return!1;for(rt=0;rt<ee.series.length;rt+=1){let xt=ee.series[rt],De=xt.interpolatedPoints&&[...xt.interpolatedPoints];if(xt.visible&&De){let lt=ee.plotHeight/10;for(let pt=ee.plotTop;pt<=ee.plotTop+ee.plotHeight;pt+=lt)De.unshift({chartX:ee.plotLeft,chartY:pt}),De.push({chartX:ee.plotLeft+ee.plotWidth,chartY:pt});for(Le=1;Le<De.length;Le+=1){if(De[Le].chartX>=te-16&&De[Le-1].chartX<=te+Ie.width+16){if(go(te,Oe,Ie.width,Ie.height,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))return!1;he===xt&&!It&&et&&(It=go(te-16,Oe-16,Ie.width+32,Ie.height+32,De[Le-1].chartX,De[Le-1].chartY,De[Le].chartX,De[Le].chartY))}(tt||It)&&(he!==xt||ke)&&(St=Math.min(St,(Tt=te+Ie.width/2-De[Le].chartX)*Tt+(ot=Oe+Ie.height/2-De[Le].chartY)*ot))}if(!ke&&tt&&he===xt&&(et&&!It||St<Math.pow(Be.connectorNeighbourDistance||1,2))){for(Le=1;Le<De.length;Le+=1)(_t=Math.min(Math.pow(te+Ie.width/2-De[Le].chartX,2)+Math.pow(Oe+Ie.height/2-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe-De[Le].chartY,2),Math.pow(te+Ie.width-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2),Math.pow(te-De[Le].chartX,2)+Math.pow(Oe+Ie.height-De[Le].chartY,2)))<ct&&(ct=_t,ht=De[Le]);It=!0}}}return(!et||!!It)&&{x:te,y:Oe,weight:St-(ht?ct:0),connectorPoint:ht}}function So(he){if(this.renderer){let te=this,Oe=to(te.renderer.globalAnimation).duration;te.labelSeries=[],te.labelSeriesMaxSum=0,te.seriesLabelTimer&&T().clearTimeout(te.seriesLabelTimer),te.series.forEach(function(Ie){let et=Ie.options.label||{},ee=Ie.labelBySeries,Be=ee&&ee.closest,ke=Ie.getColumn("y");et.enabled&&Ie.visible&&(Ie.graph||Ie.area)&&!Ie.boosted&&te.labelSeries&&(te.labelSeries.push(Ie),et.minFontSize&&et.maxFontSize&&ke.length&&(Ie.sum=ke.reduce((tt,dt)=>(tt||0)+(dt||0),0),te.labelSeriesMaxSum=Math.max(te.labelSeriesMaxSum||0,Ie.sum||0)),he.type==="load"&&(Oe=Math.max(Oe,to(Ie.options.animation).duration)),Be&&(Be[0].plotX!==void 0?ee.animate({x:Be[0].plotX+Be[1],y:Be[0].plotY+Be[2]}):ee.attr({opacity:0})))}),te.seriesLabelTimer=ul(function(){let Ie,et;te.series&&te.labelSeries&&(te.boxesToAvoid=[],Ie=te.labelSeries||[],et=te.boxesToAvoid,te.series.forEach(ee=>(ee.points||[]).forEach(Be=>(Be.dataLabels||[]).forEach(ke=>{let{width:tt,height:dt}=ke.getBBox(),St=(ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),ct=(ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);et.push({left:St,top:ct,right:St+tt,bottom:ct+dt})}))),Ie.forEach(function(ee){let Be=ee.options.label||{};ee.interpolatedPoints=(function(ke){let tt,dt,St,ct,_t;if(!ke.xAxis&&!ke.yAxis)return;let ht=ke.points,It=[],Tt=ke.graph||ke.area,ot=Tt&&Tt.element,rt=ke.chart.inverted,Le=ke.xAxis,xt=ke.yAxis,De=rt?xt.pos:Le.pos,lt=rt?Le.pos:xt.pos,pt=rt?Le.len:xt.len,Ii=rt?xt.len:Le.len,ut=zt((ke.options.label||{}).onArea,!!ke.area),qe=xt.getThreshold(ke.options.threshold),yt={},Jt=rt?"chartCenterX":"chartCenterY";function oi(it){let Ct=Math.round((it.plotX||0)/8)+","+Math.round((it.plotY||0)/8);yt[Ct]||(yt[Ct]=1,It.push(it))}if(ke.getPointSpline&&ot&&ot.getPointAtLength&&!ut&&ht.length<(ke.chart.plotSizeX||0)/16){let it=Tt.toD&&Tt.attr("d");for(Tt.toD&&Tt.attr({d:Tt.toD}),St=ot.getTotalLength(),tt=0;tt<St;tt+=16){let Mt=ot.getPointAtLength(tt),Vt=rt?Ii-Mt.y:Mt.x,Bt=rt?pt-Mt.x:Mt.y;oi({chartX:De+Vt,chartY:lt+Bt,plotX:Vt,plotY:Bt})}it&&Tt.attr({d:it});let Ct=ht[ht.length-1].pos();oi({chartX:De+(Ct?.[0]||0),chartY:lt+(Ct?.[1]||0)})}else{let it;for(tt=0,St=ht.length;tt<St;tt+=1){let Ct=ht[tt],[Mt,Vt]=Ct.pos()||[],{plotHigh:Bt}=Ct;if(Hi(Mt)&&Hi(Vt)){let wt={plotX:Mt,plotY:Vt,chartX:De+Mt,chartY:lt+Vt};if(ut&&(Bt&&(wt.plotY=Bt,wt.chartY=lt+Bt),rt?wt.chartCenterX=De+Ii-((Bt||Ct.plotY||0)+zt(Ct.yBottom,qe))/2:wt.chartCenterY=lt+((Bt||Vt)+zt(Ct.yBottom,qe))/2),it&&(dt=Math.max(Math.abs(wt.chartX-it.chartX),Math.abs(wt.chartY-it.chartY)))>16&&dt<999)for(_t=1,ct=Math.ceil(dt/16);_t<ct;_t+=1)oi({chartX:it.chartX+(wt.chartX-it.chartX)*(_t/ct),chartY:it.chartY+(wt.chartY-it.chartY)*(_t/ct),[Jt]:(it[Jt]||0)+((wt[Jt]||0)-(it[Jt]||0))*(_t/ct),plotX:(it.plotX||0)+(Mt-(it.plotX||0))*(_t/ct),plotY:(it.plotY||0)+(Vt-(it.plotY||0))*(_t/ct)});oi(wt),it=wt}}}return It})(ee),et.push(...Be.boxesToAvoid||[])}),te.series.forEach(function(ee){let Be=ee.options.label;if(!Be||!ee.xAxis&&!ee.yAxis)return;let ke="highcharts-color-"+zt(ee.colorIndex,"none"),tt=!ee.labelBySeries,dt=Be.minFontSize,St=Be.maxFontSize,ct=te.inverted,_t=ct?ee.yAxis.pos:ee.xAxis.pos,ht=ct?ee.xAxis.pos:ee.yAxis.pos,It=te.inverted?ee.yAxis.len:ee.xAxis.len,Tt=te.inverted?ee.xAxis.len:ee.yAxis.len,ot=ee.interpolatedPoints,rt=zt(Be.onArea,!!ee.area),Le=[],xt=ee.getColumn("x"),De,lt,pt,Ii,ut,qe,yt=ee.labelBySeries,Jt,oi,it;function Ct(Qt,Rt,jt){let Yi=Math.max(_t,zt(oi,-1/0)),si=Math.min(_t+It,zt(it,1/0));return Qt>Yi&&Qt<=si-jt.width&&Rt>=ht&&Rt<=ht+Tt-jt.height}function Mt(){yt&&(ee.labelBySeries=yt.destroy())}if(rt&&!ct&&(Jt=[ee.xAxis.toPixels(xt[0]),ee.xAxis.toPixels(xt[xt.length-1])],oi=Math.min.apply(Math,Jt),it=Math.max.apply(Math,Jt)),ee.visible&&!ee.boosted&&ot){if(!yt){var Vt,Bt,wt;let Qt=ee.name;if(typeof Be.format=="string"?Qt=ll(Be.format,ee,te):Be.formatter&&(Qt=Be.formatter.call(ee)),ee.labelBySeries=yt=te.renderer.label(Qt,0,0,"connector",0,0,Be.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+ke),!te.renderer.styledMode){let Rt=typeof ee.color=="string"?ee.color:"#666666";yt.css(fo({color:rt?te.renderer.getContrast(Rt):Rt},Be.style||{})),yt.attr({opacity:+!!te.renderer.forExport,stroke:ee.color,"stroke-width":1})}dt&&St&&yt.css({fontSize:(Vt=ee,Bt=dt,wt=St,Bt+(Vt.sum||0)/(Vt.chart.labelSeriesMaxSum||0)*(wt-Bt)+"px")}),yt.attr({padding:0,zIndex:3}).add()}for((De=yt.getBBox()).width=Math.round(De.width),ut=ot.length-1;ut>0;ut-=1)rt?Ct(lt=(ot[ut].chartCenterX??ot[ut].chartX)-De.width/2,pt=(ot[ut].chartCenterY??ot[ut].chartY)-De.height/2,De)&&(qe=mi(ee,lt,pt,De)):(Ct(lt=ot[ut].chartX+3,pt=ot[ut].chartY-De.height-3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX+3,pt=ot[ut].chartY+3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX-De.width-3,pt=ot[ut].chartY+3,De)&&(qe=mi(ee,lt,pt,De,!0)),qe&&Le.push(qe),Ct(lt=ot[ut].chartX-De.width-3,pt=ot[ut].chartY-De.height-3,De)&&(qe=mi(ee,lt,pt,De,!0))),qe&&Le.push(qe);if(Be.connectorAllowed&&!Le.length&&!rt)for(lt=_t+It-De.width;lt>=_t;lt-=16)for(pt=ht;pt<ht+Tt-De.height;pt+=16)(Ii=mi(ee,lt,pt,De,!0))&&Le.push(Ii);if(Le.length){Le.sort((Rt,jt)=>jt.weight-Rt.weight),qe=Le[0],(te.boxesToAvoid||[]).push({left:qe.x,right:qe.x+De.width,top:qe.y,bottom:qe.y+De.height});let Qt=Math.sqrt(Math.pow(Math.abs(qe.x-(yt.x||0)),2)+Math.pow(Math.abs(qe.y-(yt.y||0)),2));if(Qt&&ee.labelBySeries){let Rt,jt={opacity:+!!te.renderer.forExport,x:qe.x,y:qe.y},Yi={opacity:1};Qt<=10&&(Yi={x:jt.x,y:jt.y},jt={}),tt&&(Rt=to(ee.options.animation),Rt.duration*=.2),ee.labelBySeries.attr(fo(jt,{anchorX:qe.connectorPoint&&(qe.connectorPoint.plotX||0)+_t,anchorY:qe.connectorPoint&&(qe.connectorPoint.plotY||0)+ht})).animate(Yi,Rt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:qe.x,chartY:qe.y},!0);si&&(yt.closest=[si,qe.x-(si.plotX||0),qe.y-(si.plotY||0)])}}else Mt()}else Mt()}),dl(te,"afterDrawSeriesLabels"))},te.renderer.forExport||!Oe?0:Oe)}}function _l(he,te,Oe,Ie,et){let ee=et&&et.anchorX,Be=et&&et.anchorY,ke,tt,dt=Oe/2;return Hi(ee)&&Hi(Be)&&(ke=[["M",ee,Be]],(tt=te-Be)<0&&(tt=-Ie-tt),tt<Oe&&(dt=ee<he+Oe/2?tt:Oe-tt),Be>te+Ie?ke.push(["L",he+dt,te+Ie]):Be<te?ke.push(["L",he+dt,te]):ee<he?ke.push(["L",he,te+Ie/2]):ee>he+Oe&&ke.push(["L",he+Oe,te+Ie/2])),ke||[]}let ho=T();({compose:function(he,te){cl(ml,"SeriesLabel")&&(xo(he,"load",So),xo(he,"redraw",So),te.prototype.symbols.connector=_l,pl({plotOptions:{series:{label:ai}}}))}}).compose(ho.Chart,ho.SVGRenderer);let Cl=T();return l.default})())});var fl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Tr=i=>({ID:i});function Sl(i,s){if(i&1){let e=b();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function hl(i,s){if(i&1&&(n(0,"div",2),C(1,Sl,3,0,"button",3),a()),i&2){let e=m();o(),g(e.roleService.global.Export?1:-1)}}function yl(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),E(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Dl(i,s){i&1&&(n(0,"th",32),p(1,"@ Cost"),a())}function vl(i,s){i&1&&(n(0,"th",33),p(1,"@ Price"),a(),n(2,"th",30),p(3,"Disc."),a(),n(4,"th",33),p(5,"Total"),a())}function Tl(i,s){if(i&1&&(n(0,"small",40),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function wl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Pl(i,s){if(i&1&&(n(0,"span",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+x(2,1,e.Profit)," ")}}function Fl(i,s){if(i&1&&(n(0,"i",43),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function bl(i,s){if(i&1&&(n(0,"span",44),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function El(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function Il(i,s){if(i&1&&(E(0,"div",45),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",x(1,1,e.SONote),be)}}function Ml(i,s){if(i&1&&(n(0,"div")(1,"a",51),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",J(2,Tr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Vl(i,s){if(i&1&&(n(0,"div",46),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PaymentStateLabel," ")}}function Bl(i,s){if(i&1&&(n(0,"i",54),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Ll(i,s){if(i&1&&(n(0,"th",59),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e==null?null:e.UnitCost)," ")}}function Ol(i,s){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),a(),n(3,"th",61)(4,"div",62),p(5),a(),n(6,"div",63),p(7),d(8,"amountFraction"),a()(),n(9,"th",60),p(10),d(11,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,4,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":x(8,6,e==null?null:e.DiscountAmount)," "),o(3),D(" ",x(11,8,e==null?null:e.Total)," ")}}function Rl(i,s){if(i&1&&(n(0,"tr",49)(1,"th",28)(2,"div",52)(3,"span",53),p(4),a(),C(5,Bl,2,1,"i",54),E(6,"small",55),a()(),n(7,"th",56),p(8),a(),n(9,"th",57),p(10),d(11,"quantityFraction"),a(),n(12,"th",58),p(13),a(),C(14,Ll,3,3,"th",59),C(15,Ol,12,10),a()),i&2){let e=s.$implicit,r=m(4);o(4),F(e==null?null:e.Name),o(),g((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,be),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",x(11,8,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),g(r.roleService.product.Cost?14:-1),o(),g(r.roleService.report.Price?15:-1)}}function kl(i,s){if(i&1&&(n(0,"tr")(1,"th",64),p(2),a(),n(3,"th",65),p(4),a(),n(5,"th",66),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",x(7,3,e.Amount)," ")}}function Wl(i,s){if(i&1&&(n(0,"table",50),V(1,kl,8,5,"tr",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Aggregate)}}function Nl(i,s){if(i&1&&(n(0,"div")(1,"div",35)(2,"div",36)(3,"div")(4,"a",37)(5,"span",38),p(6),a()(),n(7,"span"),p(8),d(9,"date"),E(10,"small",39),d(11,"date"),C(12,Tl,3,4,"small",40),a()(),n(13,"div",41)(14,"strong",42),p(15),C(16,wl,3,4,"span"),a(),C(17,Pl,3,3,"span",40),C(18,Fl,2,1,"i",43),C(19,bl,2,1,"span",44),C(20,El,2,0,"span"),a(),C(21,Il,2,3,"div",45),C(22,Ml,3,4,"div"),a(),C(23,Vl,2,1,"div",46),a(),n(24,"table",47)(25,"tbody",48),V(26,Rl,16,10,"tr",49,R),a()(),C(28,Wl,3,0,"table",50),a()),i&2){let e=s.$implicit,r=m(3);o(4),c("routerLink",I(22,fl))("queryParams",J(23,Tr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,16,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,19,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",be),o(2),g(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),g(r.isNotEmpty(e.SalesName)?16:-1),o(),g(r.roleService.report.Profit&&r.roleService.report.Price&&r.roleService.product.Cost?17:-1),o(),g(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),g(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),g(e.SONote&&e.PromotionCoupon?20:-1),o(),g(r.isNotEmpty(e.SONote)?21:-1),o(),g(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(),g(r.roleService.report.Price?23:-1),o(3),B(e.Items),o(2),g(r.roleService.report.Price?28:-1)}}function Al(i,s){if(i&1&&(n(0,"tr")(1,"td",34),V(2,Nl,29,25,"div",null,R),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7),o(),B(e.infiniteList)}}function Gl(i,s){if(i&1&&(n(0,"tr")(1,"td"),E(2,"app-empty-state"),a()()),i&2){let e=m(2);o(),Vi("colspan",e.roleService.product.Cost?8:7)}}function Hl(i,s){if(i&1){let e=b();n(0,"span",73),P("click",function(){u(e);let t=m(3);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function Yl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),F(x(2,1,e.listTotal))}}function Ql(i,s){if(i&1){let e=b();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(3);return t.currentRowCount=100,_(t.NextPage(!0))}),E(2,"i",76),p(3," Next 100"),a()()}}function jl(i,s){if(i&1){let e=b();n(0,"div",67)(1,"button",68),P("click",function(){u(e);let t=m(2);return _(t.showSummaryReport())}),p(2," View Report Summary "),a()(),n(3,"div",69)(4,"div",70)(5,"div",71),p(6),d(7,"number"),C(8,Hl,3,0,"span",72),C(9,Yl,3,3,"span"),p(10),a()(),C(11,Ql,4,0,"div",2),a()}if(i&2){let e=m(2);o(6),D(" Showing 1 - ",x(7,5,e.infiniteList.length)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),g(e.nextPageDisabled?11:-1)}}function ql(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),C(14,Dl,2,0,"th",32),C(15,vl,6,0),a()(),n(16,"tbody"),C(17,Al,4,1,"tr")(18,Gl,3,1,"tr"),a()()(),C(19,jl,12,7),a()()),i&2){let e=m();o(14),g(e.roleService.product.Cost?14:-1),o(),g(e.roleService.report.Price?15:-1),o(2),g(e.infiniteList.length>0?17:18),o(2),g((e.infiniteList==null?null:e.infiniteList.length)>0?19:-1)}}var In=class i extends ve{constructor(e,r,t,l,y,T,je,vt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,y);this.csvConverter=t;this.datePipe=l;this.activatedRoute=y;this.matDialog=T;this.toaster=je;this.roleService=vt}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(y=>y):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(z,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Sr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(Ne),w(K),w(Ue),w(j))};static \u0275cmp=O({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[Y],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,hl,2,1,"div",2),a(),n(3,"filters"),L(4,yl,46,26,"ng-template",null,0,A),a(),C(6,ql,20,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,U,ze,vi,Jo,vn,re,oe,Z,ie],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media(max-width:992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Mn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new sn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(fi),w(Si))};static \u0275cmp=O({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return S(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return S(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Ye,k,W,Ke,Zt],encapsulation:2})};var zl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],wr=i=>({ID:i}),Jl=()=>["/menu/Contacts/Contact/Customers/Info"],Xl=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function Zl(i,s){if(i&1){let e=b();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",4),p(2," Export "),a()}}function $l(i,s){if(i&1){let e=b();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",10),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),Wt(18),n(19,"div",11)(20,"div",12)(21,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",14)(23,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",16)(25,"div",12)(26,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(27,"div",14)(28,"app-timepicker",15),h("timeChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),Nt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function ep(i,s){i&1&&(n(0,"th",36),p(1,"DATE"),a())}function tp(i,s){i&1&&(n(0,"th",37),p(1," CUSTOMER "),a())}function ip(i,s){i&1&&(n(0,"th",38),p(1,"JOIN DATE"),a())}function np(i,s){i&1&&(n(0,"th",39),p(1,"GROUPS"),a())}function ap(i,s){i&1&&(n(0,"th",40),p(1," SALES PERSON "),a())}function op(i,s){i&1&&(n(0,"th",41),p(1," COST "),a())}function rp(i,s){i&1&&(n(0,"th",44),p(1," GROSS "),a())}function lp(i,s){i&1&&(n(0,"th",45),p(1," SALES "),a())}function pp(i,s){i&1&&(n(0,"th",46),p(1," TAX "),a())}function mp(i,s){i&1&&(n(0,"th",47),p(1," SURCHARGE "),a())}function sp(i,s){i&1&&(n(0,"th",48),p(1," TOTAL "),a())}function dp(i,s){if(i&1&&(C(0,rp,2,0,"th",44),C(1,lp,2,0,"th",45),C(2,pp,2,0,"th",46),C(3,mp,2,0,"th",47),C(4,sp,2,0,"th",48)),i&2){let e=m(3);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function cp(i,s){i&1&&(n(0,"th",42),p(1," PAYMENT "),a())}function up(i,s){i&1&&E(0,"br")}function _p(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Cp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function gp(i,s){if(i&1&&(n(0,"td")(1,"a",52),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",I(3,Jl))("queryParams",J(4,wr,e.CustomerID)),o(),F(e.CustomerName)}}function xp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function fp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Sp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function hp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function yp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function Dp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function vp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Tp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SurchargeAmount)," ")}}function wp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",x(2,1,e.SalesNSurcharge)," ")}}function Pp(i,s){if(i&1&&(C(0,yp,3,3,"td",53),C(1,Dp,3,3,"td",53),C(2,vp,3,3,"td",54),C(3,Tp,3,3,"td",53),C(4,wp,3,3,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected?0:-1),o(),g(e.column.Sales.selected?1:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?2:-1),o(),g(e.data.SurchargeVisible?3:-1),o(),g(e.column.Total.selected?4:-1)}}function Fp(i,s){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=m().$implicit;c("ngClass",mt(2,Xl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function bp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",49),p(5),a(),C(6,up,1,0,"br"),C(7,_p,2,1,"i"),a(),C(8,Cp,7,8,"td"),C(9,gp,3,6,"td"),C(10,xp,3,4,"td"),C(11,fp,2,1,"td"),C(12,Sp,2,1,"td"),C(13,hp,3,3,"td",50),C(14,Pp,5,5),C(15,Fp,2,6,"td",51),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",I(14,zl))("queryParams",J(15,wr,e.ID)),o(),D(" ",e.Number," "),o(),g(e.Note?6:-1),o(),g(e.Note?7:-1),o(),g(r.column.Date.selected?8:-1),o(),g(r.column.Customer.selected?9:-1),o(),g(r.column.JoinDate.selected?10:-1),o(),g(r.column.Groups.selected?11:-1),o(),g(r.column.SalesPerson.selected?12:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.role&&r.column.Cost.selected?13:-1),o(),g(r.roleService.report.Price?14:-1),o(),g(r.column.Payment.selected?15:-1)}}function Ep(i,s){i&1&&E(0,"td",56)}function Ip(i,s){i&1&&E(0,"td",56)}function Mp(i,s){i&1&&E(0,"td",56)}function Vp(i,s){i&1&&(n(0,"td",57),p(1," Total: "),a())}function Bp(i,s){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Lp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Op(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Rp(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function kp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Wp(i,s){if(i&1&&(n(0,"td",53),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(5);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Np(i,s){if(i&1&&(C(0,Vp,2,0,"td",57),C(1,Bp,4,6,"td",50),C(2,Lp,4,6,"td",53),C(3,Op,4,6,"td",53),C(4,Rp,4,6,"td",54),C(5,kp,4,6,"td",53),C(6,Wp,4,6,"td",53)),i&2){let e=m(4);g(e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected?0:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?1:-1),o(),g(e.column.Gross.selected?2:-1),o(),g(e.column.Sales.selected?3:-1),o(),g(e.data.TaxVisible&&e.column.Tax.selected?4:-1),o(),g(e.data.SurchargeVisible?5:-1),o(),g(e.column.Total.selected?6:-1)}}function Ap(i,s){if(i&1&&(n(0,"tfoot",43)(1,"tr",55),E(2,"td",56),C(3,Ep,1,0,"td",56),C(4,Ip,1,0,"td",56),C(5,Mp,1,0,"td",56),C(6,Np,7,7),a()()),i&2){let e=m(3);o(3),g(e.column.Date.selected?3:-1),o(),g(e.column.Customer.selected?4:-1),o(),g(e.column.SalesPerson.selected?5:-1),o(),g(e.roleService.report.Price?6:-1)}}function Gp(i,s){if(i&1){let e=b();n(0,"div",24)(1,"table",32),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",33)(3,"tr")(4,"th",34),p(5,"OUTLET"),a(),n(6,"th",35),p(7,"NUMBER"),a(),C(8,ep,2,0,"th",36),C(9,tp,2,0,"th",37),C(10,ip,2,0,"th",38),C(11,np,2,0,"th",39),C(12,ap,2,0,"th",40),C(13,op,2,0,"th",41),C(14,dp,5,5),C(15,cp,2,0,"th",42),a()(),n(16,"tbody"),V(17,bp,16,17,"tr",null,R),a(),C(19,Ap,7,4,"tfoot",43),a()()}if(i&2){let e=m(2);o(8),g(e.column.Date.selected?8:-1),o(),g(e.column.Customer.selected?9:-1),o(),g(e.column.JoinDate.selected?10:-1),o(),g(e.column.Groups.selected?11:-1),o(),g(e.column.SalesPerson.selected?12:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.role&&e.column.Cost.selected?13:-1),o(),g(e.roleService.report.Price?14:-1),o(),g(e.column.Payment.selected?15:-1),o(2),B(e.infiniteList),o(2),g(e.data?19:-1)}}function Hp(i,s){if(i&1){let e=b();n(0,"span",58),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",59),p(2,"?"),a()()}}function Yp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Qp(i,s){if(i&1){let e=b();n(0,"a",60),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",61),p(2," Next"),a()}}function jp(i,s){if(i&1){let e=b();n(0,"a",62),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),E(1,"i",63),p(2," Show All"),a()}}function qp(i,s){if(i&1&&(n(0,"content")(1,"div",23),C(2,Gp,20,9,"div",24),n(3,"div",25)(4,"div",26)(5,"div",27),p(6),d(7,"number"),C(8,Hp,3,0,"span",28),C(9,Yp,3,3,"span"),p(10),a()(),n(11,"div",29),C(12,Qp,3,0,"a",30),C(13,jp,3,0,"a",31),a()()()()),i&2){let e=m();o(2),g(e.data?2:-1),o(4),D(" Showing 1 - ",x(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),g(e.pageData.HideStoreApiCount?-1:8),o(),g(e.pageData.HideStoreApiCount?9:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),g(!e.nextPageDisabled&&!e.goToLast?12:-1),o(),g(!e.nextPageDisabled&&!e.goToLast?13:-1)}}var Vn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=y}roleService=Me(j);columnService=Me(st);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},Total:{selected:!0,name:"Total",role:this.roleService.report.Price},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Mn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),y);case"number":return this.compare(t.Number,l.Number,y);case"date":return this.compare(t.Date,l.Date,y);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),y);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),y);case"cost":return this.compare(t.Cost,l.Cost,y);case"gross":return this.compare(t.Gross,l.Gross,y);case"sales":return this.compare(t.Sales,l.Sales,y);case"tax":return this.compare(t.Tax,l.Tax,y);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,y);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,y);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,y);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,y);case"groups":return this.compare(t.Groups,l.Groups,y);default:return 0}})}openExportModal(){this._matDialog.open(z,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ne),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[Y],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time","customStyle"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],[1,"border-top"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-start",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"table","table-borderless"],[1,"empty-column"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Zl,3,0,"button",2),a(),n(3,"filters"),L(4,$l,44,26,"ng-template",null,0,A),a(),C(6,qp,14,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(4),g(t.data?6:-1))},dependencies:[H,$e,Q,$,X,Ye,k,W,ae,le,ge,Ke,we,Ae,Di,U,ze,me,re,oe,Z],encapsulation:2})};var Up=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],zp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Jp=i=>({ID:i}),Xp=(i,s)=>({BrandID:i,Name:s});function Zp(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function $p(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"p-treeSelect",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectetOutletGroup,t)||(l.selectetOutletGroup=t),_(t)}),P("ngModelChange",function(t){u(e);let l=m();return _(l.onSelectOutletGroup(t))})("onClear",function(){u(e);let t=m();return _(t.onClearOutletGroup())}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",13),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(13,"div",15)(14,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("disabled",(e.pageData.Filter==null||e.pageData.Filter.ListIDs==null?null:e.pageData.Filter.ListIDs.length)>0)("options",e.pageData.Options==null?null:e.pageData.Options.OutletGroupsTree),f("ngModel",e.selectetOutletGroup),c("showClear",!0),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function em(i,s){i&1&&(n(0,"th",21),p(1," Cost "),a())}function tm(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Gross))}}function im(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",27),p(3),a()(),n(4,"td",28)(5,"a",29),p(6),d(7,"quantityFraction"),a()(),n(8,"td",28),p(9),d(10,"amountFraction"),a(),C(11,tm,3,3,"td",28),n(12,"td",28),p(13),d(14,"amountFraction"),a(),n(15,"td",28),p(16),d(17,"amountFraction"),a(),n(18,"td",28),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",I(20,zp))("queryParams",J(21,Jp,e.ID)),o(),D("",e.BrandName," "),o(2),c("queryParams",xe(23,Xp,e.ID,e.BrandName)),o(),F(x(7,10,e.Quantity)),o(3),F(x(10,12,e.Cost)),o(2),g(r.roleService.product.Cost?11:-1),o(2),F(x(14,14,e.NetSales)),o(3),F(x(17,16,e.Tax)),o(3),F(x(20,18,e.SalesTax))}}function nm(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(x(3,4,v(2,1,e.data.Data,"Cost")))}}function am(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Brand"),a(),n(6,"th",20),p(7," Quantity "),a(),C(8,em,2,0,"th",21),n(9,"th",22),p(10," Gross "),a(),n(11,"th",23),p(12," Sales "),a(),n(13,"th",24),p(14," Tax "),a(),n(15,"th",25),p(16," Sales + Tax "),a()()(),n(17,"tbody"),V(18,im,21,26,"tr",null,R),a(),n(20,"tfoot")(21,"tr",26)(22,"td"),p(23,"Total"),a(),n(24,"td"),p(25),d(26,"sum"),a(),C(27,nm,4,6,"td"),n(28,"td"),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td"),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td"),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td"),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()}if(i&2){let e=m();o(8),g(e.roleService.product.Cost?8:-1),o(10),B(e.data.Data),o(7),F(v(26,7,e.data.Data,"Quantity")),o(2),g(e.roleService.product.Cost?27:-1),o(2),F(x(31,13,v(30,10,e.data.Data,"Gross"))),o(4),F(x(35,18,v(34,15,e.data.Data,"NetSales"))),o(4),F(x(39,23,v(38,20,e.data.Data,"Tax"))),o(4),F(x(43,28,v(42,25,e.data.Data,"SalesTax")))}}var Bn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=y;this.matDialog=T}selectetOutletGroup;preInitList(){super.preInitList(),this.pageData.Options=Ze(Xe({},this.pageData.Options),{Categories:[]})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=JSON.parse(JSON.stringify(this.originalData));return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";return this.compare(t[e.active],l[e.active],y)})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e.key,this.selectetOutletGroup=e}onClearOutletGroup(){this.pageData.Filter.OutletGroupID=null}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ne),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[Y],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","placeholder","Choose Outlet",1,"tree-select-as-filter",3,"ngModelChange","onClear","disabled","options","ngModel","showClear"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","BrandName",2,"width","250px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before","matTooltip","Brand Cost Cost",1,"flex-right",2,"width","120px"],["mat-sort-header","Gross","arrowPosition","before","matTooltip","Brand Gross Gross",1,"flex-right",2,"width","120px"],["mat-sort-header","NetSales","arrowPosition","before","matTooltip","Brand Net Sales",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Brand Net Tax",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesTax","arrowPosition","before","matTooltip","Brand Net Sales + Tax",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,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," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),L(14,$p,15,14,"ng-template",null,0,A),a(),n(16,"content"),C(17,am,44,30,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(8,Up)),o(3),c("routerLink",I(9,Kp)),o(6),g(t.data?17:-1))},dependencies:[H,Q,X,k,W,ae,le,ge,ce,U,tr,me,Z,ie],encapsulation:2})};function om(i,s){if(i&1){let e=b();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),E(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var Ln=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(fi),w(Si))};static \u0275cmp=O({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),V(3,om,4,3,"label",null,R),a()()()),e&2&&(c("title","Edit Groups"),o(3),B(r.options))},dependencies:[Zt],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],dm=()=>["/menu/Contacts/Contact/Customers/Info"],cm=i=>({ID:i});function um(i,s){if(i&1){let e=b();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function _m(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Cm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function gm(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function xm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function fm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Sm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function hm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function ym(i,s){if(i&1){let e=b();n(0,"span")(1,"span"),p(2),a(),n(3,"a",42),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Dm(i,s){if(i&1&&(n(0,"span"),V(1,ym,5,2,"span",null,R),a()),i&2){let e=m().$implicit;o(),B(e.Groups)}}function vm(i,s){if(i&1){let e=b();n(0,"a",42),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Tm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Orders)," ")}}function wm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Quantity)," ")}}function Pm(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Cost)," ")}}function Fm(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales)," ")}}function bm(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function Em(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Sales+e.Tax)," ")}}function Im(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",35),p(3),a(),n(4,"div",36),C(5,Dm,3,0,"span"),C(6,vm,2,0,"a",37),a()(),n(7,"td")(8,"span",38),p(9),a()(),C(10,Tm,3,3,"td",39),C(11,wm,3,3,"td",39),C(12,Pm,3,3,"td",40),C(13,Fm,3,3,"td",39),C(14,bm,3,3,"td",41),C(15,Em,3,3,"td",39),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",I(13,dm))("queryParams",J(14,cm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),g(e.Groups.length>0?5:-1),o(),g(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),g(r.column.Orders.selected?10:-1),o(),g(r.column.QTY.selected?11:-1),o(),g(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),g(r.column.Sales.selected?13:-1),o(),g(r.column.Tax.selected?14:-1),o(),g(r.column.SalesNTax.selected?15:-1)}}function Mm(i,s){if(i&1&&(n(0,"tbody",28),V(1,Im,16,16,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.infiniteList)}}function Vm(i,s){if(i&1){let e=b();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))}),n(1,"i",44),p(2,"?"),a()()}}function Bm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(x(2,1,e.listTotal))}}function Lm(i,s){if(i&1){let e=b();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),E(1,"i",46),p(2," Next"),a()}}function Om(i,s){if(i&1){let e=b();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),C(9,Cm,2,0,"th",22),C(10,gm,2,0,"th",23),C(11,xm,2,0,"th",24),C(12,fm,2,0,"th",25),C(13,Sm,2,0,"th",26),C(14,hm,2,0,"th",27),a()(),C(15,Mm,3,0,"tbody",28),a()(),n(16,"div",29)(17,"div",30)(18,"div",31),p(19),d(20,"number"),L(21,Vm,3,0,"span",32)(22,Bm,3,3,"span",33),p(23),a()(),L(24,Lm,3,0,"a",34),a()()}if(i&2){let e=m();o(9),g(e.column.Orders.selected?9:-1),o(),g(e.column.QTY.selected?10:-1),o(),g(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),g(e.column.Sales.selected?12:-1),o(),g(e.column.Tax.selected?13:-1),o(),g(e.column.SalesNTax.selected?14:-1),o(),g(e.data.Data?15:-1),o(4),D(" Showing 1 - ",x(20,12,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var On=class i extends $t{constructor(e,r,t,l,y){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=wn.maskingField;postInit(e){super.postInit(e),this.maskingFields=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(qt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Orders":return this.compare(t.Orders,l.Orders,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Sales":return this.compare(t.Sales,l.Sales,y);case"Tax":return this.compare(t.Tax,l.Tax,y);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,y);case"Cost":return this.compare(t.Cost,l.Cost,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(Ln,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let y={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",y).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(z,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(oe),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[Y],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),E(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),L(24,_m,16,10,"ng-template",null,0,A),a(),n(26,"content"),C(27,Om,25,14,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,rm)),o(3),c("routerLink",I(13,lm)),o(3),c("routerLink",I(14,pm)),o(3),c("routerLink",I(15,mm)),o(4),c("routerLink",I(16,sm)),o(6),g(t.data?27:-1))},dependencies:[H,on,Q,$,X,Ye,k,W,ae,le,ge,Ke,U,re,Z,ie],encapsulation:2})};var Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Gm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Hm(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(x(5,4,e.TotalOrders)),o(3),F(x(8,6,e.TotalCost)),o(3),F(x(11,8,e.TotalAmount))}}function Qm(i,s){if(i&1&&(n(0,"tbody",22),V(1,Ym,12,10,"tr",null,R),a()),i&2){let e=m(2);o(),B(e.data.Data)}}function jm(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),C(12,Qm,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),g(e.data.Data?12:-1)}}var Rn=class i extends ve{constructor(e,r,t,l,y,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;this.datePipe=T}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(z,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[Y],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Gm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),L(23,Hm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,jm,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(11,Rm)),o(3),c("routerLink",I(12,km)),o(3),c("routerLink",I(13,Wm)),o(3),c("routerLink",I(14,Nm)),o(3),c("routerLink",I(15,Am)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z],encapsulation:2})};var qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Xm(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function Zm(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function $m(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function e0(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function t0(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function i0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalOrders))}}function n0(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.TotalQuantity)," ")}}function a0(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.TotalAmount))}}function o0(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),C(3,i0,3,3,"td",23),C(4,n0,3,3,"td",23),C(5,a0,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),g(r.column.Orders.selected?3:-1),o(),g(r.column.QTY.selected?4:-1),o(),g(r.column.Amount.selected?5:-1)}}function r0(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),C(6,$m,2,0,"th",19),C(7,e0,2,0,"th",20),C(8,t0,2,0,"th",21),a()(),n(9,"tbody",22),V(10,o0,6,4,"tr",null,R),a()()()}if(i&2){let e=m();o(6),g(e.column.Orders.selected?6:-1),o(),g(e.column.QTY.selected?7:-1),o(),g(e.column.Amount.selected?8:-1),o(2),B(e.data==null?null:e.data.Data)}}var kn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=y}roleService=Me(j);columnService=Me(st);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,y);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,y);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,y);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,y);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(qt(1))}openExportModal(){this.matDialog.open(z,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(K),w(oe))};static \u0275cmp=O({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[Y],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,Xm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),L(23,Zm,13,8,"ng-template",null,0,A),a(),n(25,"content"),C(26,r0,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,qm)),o(3),c("routerLink",I(13,Um)),o(3),c("routerLink",I(14,Km)),o(3),c("routerLink",I(15,zm)),o(3),c("routerLink",I(16,Jm)),o(6),g(t.data?26:-1))},dependencies:[H,Q,$,X,k,W,le,ge,U,re,Z,ie],encapsulation:2})};var Pr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],c0=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],u0=i=>({ID:i}),_0=(i,s,e)=>({From:i,SupplierID:s,To:e});function C0(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function g0(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function x0(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",I(19,c0))("queryParams",J(20,u0,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",x(10,9,e.Quantity)," "),o(3),c("routerLink",I(22,Pr))("queryParams",mt(23,_0,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",x(16,17,e.Total))}}function f0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),E(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),E(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function S0(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),V(15,x0,17,27,"tr",24,R),a(),C(17,f0,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),B(e.data.Data),o(2),g((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Wn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,y);case"Supplier":return this.compare(t.Name,l.Name,y);case"Code":return this.compare(t.Code,l.Code,y);case"Quantity":return this.compare(t.Quantity,l.Quantity,y);case"Total":return this.compare(t.Total,l.Total,y);default:return 0}})}openExportModal(){this.matDialog.open(z,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[Y],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,C0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,g0,16,10,"ng-template",null,0,A),a(),n(28,"content"),C(29,S0,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,Pr)),o(3),c("routerLink",I(13,l0)),o(3),c("routerLink",I(14,p0)),o(3),c("routerLink",I(15,m0)),o(3),c("routerLink",I(16,s0)),o(3),c("routerLink",I(17,d0)),o(6),g(t.data?29:-1))},dependencies:[H,Q,$,X,Ye,k,W,le,ge,Ke,U,oe,Z,ie],encapsulation:2})};var Fr=Gt(ti());var D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],b0=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),E0=i=>[i],I0=i=>({ID:i}),M0=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),br=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],V0=(i,s,e)=>({VariantID:i,From:s,To:e}),B0=(i,s,e)=>({ProductID:i,From:s,To:e});function L0(i,s){if(i&1&&(n(0,"a",9),E(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",tn(1,b0,(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 O0(i,s){if(i&1){let e=b();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",12),p(2," Export "),a()}}function R0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function k0(i,s){if(i&1&&(n(0,"div",33)(1,"span",34),p(2),a(),n(3,"span",35),p(4),a()()),i&2){let e=s.item;o(2),F(e.Symbol),o(2),F(e.Name)}}function W0(i,s){if(i&1){let e=b();n(0,"div",13)(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a()(),n(5,"div",14)(6,"h6"),p(7,"Category"),a(),n(8,"POS-product-category-select",16),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a()(),n(9,"div",14)(10,"h6"),p(11,"From Date"),a(),n(12,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(13,"div",14)(14,"h6"),p(15,"To Date"),a(),n(16,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"div",14)(18,"h6"),p(19,"Brand"),a(),n(20,"POS-brand-options",19),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.generateQueryParams())}),a()(),n(21,"div",14)(22,"h6"),p(23,"Product Tag"),a(),n(24,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a()(),n(25,"div",14)(26,"h6"),p(27,"Sales Order Tag"),a(),n(28,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()(),n(29,"div",14)(30,"h6"),p(31,"Customer Group"),a(),n(32,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a()(),n(33,"div",14)(34,"h6"),p(35,"Sales Person"),a(),n(36,"sales-person-selector",23),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()(),n(37,"div",14)(38,"h6"),p(39,"Scope"),a(),n(40,"radio-options",24),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),n(41,"div",14)(42,"h6"),p(43,"Customer"),a(),n(44,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()(),n(45,"div",14)(46,"h6"),p(47,"Supplier"),a(),n(48,"autocompleteV2",26),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()(),n(49,"div",14)(50,"h6"),p(51,"Cost Currency"),a(),n(52,"ng-select",27),h("ngModelChange",function(t){u(e);let l=m();return S(l.selectedCurrencyID,t)||(l.selectedCurrencyID=t),_(t)}),L(53,R0,5,2,"ng-template",28)(54,k0,5,2,"ng-template",29),a()(),n(55,"div",14)(56,"h6"),p(57,"Logistics Service"),a(),n(58,"ng-select",30),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a()(),n(59,"div",14)(60,"h6"),p(61,"Product Type"),a(),n(62,"radio-options",31),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()(),n(63,"div",14)(64,"h6"),p(65,"Multiply Unit Quantity"),a(),n(66,"radio-options",32),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(4),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(4),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(4),f("ngModel",e.pageData.Filter.BrandIDs),c("multiple",!0)("clearable",!0),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(4),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(4),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(4),f("ngModel",e.pageData.Filter.SalesID),o(4),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(4),f("ngModel",e.pageData.Filter.CustomerID),o(4),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(4),c("items",e.pageData.Options.Currencies),f("ngModel",e.selectedCurrencyID),o(6),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(4),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function N0(i,s){if(i&1){let e=b();n(0,"th",54)(1,"div",55)(2,"input",56),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function A0(i,s){if(i&1&&(n(0,"th",57),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function G0(i,s){i&1&&(n(0,"th",58),p(1," On Hand "),a())}function H0(i,s){i&1&&(n(0,"th",59),p(1," Cost "),a())}function Y0(i,s){i&1&&(n(0,"th",60),p(1," GROSS "),a())}function Q0(i,s){if(i&1&&(n(0,"th",61),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function j0(i,s){i&1&&(n(0,"th",62),p(1," Tax "),a())}function q0(i,s){if(i&1&&(n(0,"th",63),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function U0(i,s){i&1&&(n(0,"th",64),p(1," PROFIT "),a())}function K0(i,s){i&1&&(n(0,"th",65),p(1," % "),a())}function z0(i,s){if(i&1){let e=b();n(0,"td")(1,"div",55)(2,"input",77),h("ngModelChange",function(t){u(e);let l=m().$implicit;return S(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function J0(i,s){if(i&1){let e=b();Wt(0),n(1,"img",78),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l==null?null:l.ImageURL,t))}),a(),Nt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,Ki)}}function X0(i,s){if(i&1){let e=b();n(0,"a",79)(1,"img",80),P("click",function(t){u(e);let l=m().$implicit,y=m(2);return _(y.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function Z0(i,s){if(i&1&&(n(0,"td",81)(1,"a",82),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",bo(4,M0,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(x(3,2,r.Quantity))}}function $0(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.OnHand)," ")}}function es(i,s){if(i&1&&(p(0),d(1,"amountFraction")),i&2){let e=m(2).$implicit,r=m(2);At(" ",r.primaryCurrency().Symbol," ",x(1,2,e.UnitCost*e.CostCurrencyExchangeRate)," ")}}function ts(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"amountFraction"),E(3,"br"),C(4,es,2,4),a()),i&2){let e,r=m().$implicit,t=m(2);o(),At(" ",r.CostCurrencySymbol," ",x(2,3,r.UnitCost)," "),o(3),g(r.CostCurrencyID&&r.CostCurrencyID!==((e=t.primaryCurrency())==null?null:e.ID)?4:-1)}}function is(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Gross)," ")}}function ns(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,br))("queryParams",mt(12,V0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function as(i,s){if(i&1&&(n(0,"a",71),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",I(11,br))("queryParams",mt(12,B0,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(x(4,9,e.Sales))}}function os(i,s){if(i&1&&(n(0,"td",81),L(1,ns,5,16,"a",84)(2,as,5,16,"a",84),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function rs(i,s){if(i&1&&(n(0,"td",85),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.Tax)," ")}}function ls(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",x(2,1,e.SalesNTax)," ")}}function ps(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Profit)," ")}}function ms(i,s){if(i&1&&(n(0,"td",86),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",x(2,2,e.Margin)," ")}}function ss(i,s){if(i&1&&(n(0,"tr",66),L(1,z0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",67)(6,"div",68),L(7,J0,2,1,"ng-container",8)(8,X0,2,1,"a",69),a(),n(9,"div",70)(10,"a",71),p(11),a(),n(12,"small",72),p(13),a()()()(),L(14,Z0,4,11,"td",73)(15,$0,3,3,"td",73)(16,ts,5,5,"td",74)(17,is,3,3,"td",73)(18,os,3,2,"td",73)(19,rs,3,3,"td",75)(20,ls,3,3,"td",73)(21,ps,3,4,"td",76)(22,ms,3,4,"td",76),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",J(17,E0,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(19,I0,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function ds(i,s){i&1&&E(0,"td",81)}function cs(i,s){i&1&&(n(0,"td",81),p(1," Total : "),a())}function us(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function _s(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function Cs(i,s){if(i&1&&(n(0,"td",83),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function gs(i,s){if(i&1&&(n(0,"td",81),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function xs(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Sales")))}}function fs(i,s){if(i&1&&(n(0,"td",85)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"Tax")))}}function Ss(i,s){if(i&1&&(n(0,"td",89)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(x(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function hs(i,s){if(i&1&&(n(0,"td",86),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",x(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function ys(i,s){if(i&1&&(n(0,"td",86),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",x(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function Ds(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",87),E(2,"td",81),L(3,ds,1,0,"td",73)(4,cs,2,0,"td",73)(5,us,4,6,"td",73)(6,_s,4,6,"td",73)(7,Cs,4,6,"td",74)(8,gs,4,6,"td",73)(9,xs,5,6,"td",88)(10,fs,5,6,"td",75)(11,Ss,5,6,"td",88)(12,hs,5,10,"td",76)(13,ys,7,16,"td",76),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function vs(i,s){if(i&1){let e=b();n(0,"content")(1,"div",36)(2,"div",37)(3,"table",38),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",39)(5,"tr"),L(6,N0,3,1,"th",40),n(7,"th",41),p(8,"No"),a(),n(9,"th",42),p(10,"Name"),a(),L(11,A0,2,1,"th",43)(12,G0,2,0,"th",44)(13,H0,2,0,"th",45)(14,Y0,2,0,"th",46)(15,Q0,2,1,"th",47)(16,j0,2,0,"th",48)(17,q0,2,1,"th",49)(18,U0,2,0,"th",50)(19,K0,2,0,"th",51),a()(),n(20,"tbody"),L(21,ss,23,21,"tr",52),a(),L(22,Ds,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",53),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Nn=class i extends ve{constructor(e,r,t,l,y,T,je){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,y);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=y;this.matDialog=T;this.bigPicture=je}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Me(j);columnService=Me(st);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=at([]);queryParams=at(null);primaryCurrency=at(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=Ze(Xe({},this.data),{Data:e.Data.map(t=>Ze(Xe({},t),{checked:!1}))}),this.primaryCurrency.set(e.PrimaryCurrency);for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=Ze(Xe({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=Ze(Xe({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>Ze(Xe({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,ki.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=Ze(Xe({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),y);case"Quantity":return M.compare(t.Quantity,l.Quantity,y);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,y);case"Inventory":return M.compare(t.OnHand,l.OnHand,y);case"Total_Sales":return M.compare(t.Total,l.Total,y);case"Total_Tax":return M.compare(t.Tax,l.Tax,y);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,y);case"ReOrder":return M.compare(t.MinStock,l.MinStock,y);case"Gross":return M.compare(t.Gross,l.Gross,y);case"Margin":return M.compare(t.Margin,l.Margin,y);case"Profit":return M.compare(t.Profit,l.Profit,y);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(z,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Fr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}showCurrencyExchangeRate(e){return this.primaryCurrency().ID===e}get selectedCurrencyID(){return this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID:this.pageData.Filter.ProductCostCurrencyID}set selectedCurrencyID(e){this.pageData.Filter.GroupByVariant?this.pageData.Filter.VariantCostCurrencyID=e:this.pageData.Filter.ProductCostCurrencyID=e}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(Ue),w(Ne),w(K),w(En))};static \u0275cmp=O({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[Y],decls:30,vars:20,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["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"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindValue","ID","bindLabel","Name",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["ng-label-tmp",""],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"d-flex","align-items-center","gap-2"],[1,"fw-semibold"],[1,""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),L(2,L0,3,7,"a",2),C(3,O0,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),L(27,W0,67,37,"ng-template",null,0,A),a(),L(29,vs,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),g(t.roleService.global.Export?3:-1),o(6),c("routerLink",I(14,D0)),o(3),c("routerLink",I(15,v0)),o(3),c("routerLink",I(16,T0)),o(3),c("routerLink",I(17,w0)),o(3),c("routerLink",I(18,P0)),o(3),c("routerLink",I(19,F0)),o(5),c("ngIf",t.data))},dependencies:[H,$e,Mo,on,Q,$,X,Oo,k,W,ae,le,ge,we,Ae,ce,Lt,U,ze,wi,Ko,zo,me,oe,Z,ie],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var ws=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ms=i=>({ID:i}),Vs=(i,s)=>s.Name,Bs=(i,s)=>s.ID;function Ls(i,s){if(i&1){let e=b();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",17),p(2," Export "),a()}}function Os(i,s){if(i&1){let e=b();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"POS-brand-options",23),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(31,"h6"),p(32,"Hide Zero"),a(),n(33,"radio-options",30),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter),o(3),f("model",e.pageData.Filter.HideZero)}}function Rs(i,s){i&1&&(n(0,"th",31),p(1,"Code"),a()),i&2&&Ut("text-align","right")}function ks(i,s){i&1&&(n(0,"th",32),p(1," Cost "),a()),i&2&&Ut("text-align","right")}function Ws(i,s){i&1&&(n(0,"th",32),p(1," Sales "),a()),i&2&&Ut("text-align","right")}function Ns(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",ft(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function As(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function Gs(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),F(e.Code)}}function Hs(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",x(2,3,e.UnitCost)," ")}}function Ys(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",x(2,3,e.UnitPrice)," ")}}function Qs(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function js(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function qs(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",33),p(3),a()(),C(4,Gs,2,3,"td",34),C(5,Hs,3,5,"td",34),C(6,Ys,3,5,"td",34),V(7,Qs,2,1,"td",14,Bi),C(9,js,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",J(7,Ms,e.ID)),o(),D(" ",e.Name),o(),g(r.column.code.selected?4:-1),o(),g(r.column.cost&&r.column.cost.selected?5:-1),o(),g(r.column.sales&&r.column.sales.selected?6:-1),o(),B(e.Quantities),o(2),g(r.column.total.selected?9:-1)}}var Gn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(K),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[Y],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose...",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["name","HideZero",3,"modelChange","model"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.submit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Ls,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,Os,34,18,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),C(35,Rs,2,2,"th",11),C(36,ks,2,2,"th",12),C(37,Ws,2,2,"th",12),V(38,Ns,2,3,"th",13,Vs),C(40,As,2,0,"th",14),a()(),n(41,"tbody"),V(42,qs,10,9,"tr",15,Bs),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(16,ws)),o(3),c("routerLink",I(17,Ps)),o(3),c("routerLink",I(18,Fs)),o(3),c("routerLink",I(19,bs)),o(3),c("routerLink",I(20,Es)),o(3),c("routerLink",I(21,Is)),o(12),g(t.column.code.selected?35:-1),o(),g(t.column.cost&&t.column.cost.selected?36:-1),o(),g(t.column.sales&&t.column.sales.selected?37:-1),o(),B(t.data==null?null:t.data.Outlet),o(2),g(t.column.total.selected?40:-1),o(2),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,ce,Lt,U,ze,Ti,Z],encapsulation:2})};var ao=Gt(ti());var Us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Zs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Er=()=>({standalone:!0}),Ir=()=>({overflow:"visible"}),$s=i=>[i],ed=i=>({ID:i});function td(i,s){if(i&1){let e=b();n(0,"a",14),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",15),p(2," Export"),a()}}function id(i,s){if(i&1){let e=b();n(0,"div",16)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",18),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",19)(8,"div",20)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",22)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",21),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",I(18,Er))("contentStyle",I(19,Ir))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",I(20,Er))("contentStyle",I(21,Ir))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function nd(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function ad(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function od(i,s){i&1&&(n(0,"th",13)(1,"span",24),p(2," On Hand "),a()())}function rd(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function ld(i,s){i&1&&(n(0,"th",13)(1,"span",25),p(2," Total "),a()())}function pd(i,s){if(i&1&&(n(0,"td")(1,"a",27),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",J(3,$s,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",J(5,ed,e.ID)),o(),D(" ",e.Name," ")}}function md(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function sd(i,s){if(i&1&&(n(0,"td",26)(1,"span",24),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function dd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function cd(i,s){if(i&1&&(n(0,"td",26)(1,"span",25),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function ud(i,s){if(i&1&&(n(0,"tr"),C(1,pd,3,7,"td"),C(2,md,2,1,"td"),C(3,sd,4,4,"td",26),V(4,dd,3,4,"td",26,R),C(6,cd,5,7,"td",26),a()),i&2){let e=m();o(),g(e.column.name.selected?1:-1),o(),g(e.column.code.selected?2:-1),o(),g(e.column.OnHand.selected?3:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?6:-1)}}function _d(i,s){i&1&&E(0,"td")}function Cd(i,s){i&1&&(n(0,"td",26),p(1,"Total :"),a())}function gd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function xd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function fd(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Sd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",28),C(2,_d,1,0,"td"),C(3,Cd,2,0,"td",26),C(4,gd,3,4,"td",26),V(5,xd,3,4,"td",26,R),C(7,fd,4,7,"td",26),a()()),i&2){let e=m();o(2),g(e.column.name.selected?2:-1),o(),g(e.column.code.selected?3:-1),o(),g(e.column.OnHand.selected?4:-1),o(),B(e.data==null?null:e.data.MonthlySales),o(2),g(e.column.total.selected?7:-1)}}var Hn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y;let T=new Date().getFullYear(),je=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,je)}_toastrService=Me(Ue);columnService=Me(st);years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),y);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),y);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,ao.default)(this.pageData.Filter.MonthFrom),r=(0,ao.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",y=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(y),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[Y],decls:43,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.onSubmit()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return t.checkForAdvancedColumn()}),n(1,"actions"),C(2,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," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,id,19,22,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return t.sortData(T)}),n(31,"thead",9)(32,"tr",10),C(33,nd,2,0,"th",11),C(34,ad,2,0,"th",12),C(35,od,3,0,"th",13),V(36,rd,2,1,"th",13,R),C(38,ld,3,0,"th",13),a()(),n(39,"tbody"),V(40,ud,7,4,"tr",null,R),a(),C(42,Sd,8,4,"tfoot"),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(17,Us)),o(3),c("routerLink",I(18,Ks)),o(3),c("routerLink",I(19,zs)),o(3),c("routerLink",I(20,Js)),o(3),c("routerLink",I(21,Xs)),o(3),c("routerLink",I(22,Zs)),o(10),g(t.column.name.selected?33:-1),o(),g(t.column.code.selected?34:-1),o(),g(t.column.OnHand.selected?35:-1),o(),B(t.data==null?null:t.data.MonthlySales),o(2),g(t.column.total.selected?38:-1),o(2),B(t.data==null?null:t.data.Data),o(2),g((t.data==null||t.data.Data==null?null:t.data.Data.length)>0?42:-1))},dependencies:[H,Q,k,W,ae,le,ge,we,ce,U,nr,me,re],encapsulation:2})};var hd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],yd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],vd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Td=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],wd=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Pd=i=>[i],Fd=i=>({ID:i});function bd(i,s){if(i&1){let e=b();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",14),p(2," Export"),a()}}function Ed(i,s){if(i&1){let e=b();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Id(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Md(i,s){if(i&1&&(n(0,"tr"),E(1,"th")(2,"th"),V(3,Id,2,1,"th",22,R),a()),i&2){let e=m();o(3),B(e.data==null?null:e.data.Outlet)}}function Vd(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Bd(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",J(3,Pd,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",J(5,Fd,r[1])),o(),F(r[e])}}function Ld(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Od(i,s){if(i&1&&(n(0,"td",11),C(1,Bd,2,7,"a",23)(2,Ld,1,1),a()),i&2){let e=s.$index;o(),g(e===0?1:2)}}function Rd(i,s){if(i&1&&(n(0,"tr",11),V(1,Od,3,1,"td",11,R),a()),i&2){let e=s.$implicit,r=m();o(),B(r.getFilteredKeys(e))}}var Yn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(z,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[Y],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,bd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),L(26,Ed,16,10,"ng-template",null,0,A),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),C(32,Md,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),V(38,Vd,2,1,"th",12,R),a()(),n(40,"tbody"),V(41,Rd,3,0,"tr",11,R),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(12,hd)),o(3),c("routerLink",I(13,yd)),o(3),c("routerLink",I(14,Dd)),o(3),c("routerLink",I(15,vd)),o(3),c("routerLink",I(16,Td)),o(3),c("routerLink",I(17,wd)),o(9),g((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),B(t.data==null?null:t.data.Header),o(3),B(t.data==null?null:t.data.Data))},dependencies:[H,Q,X,k,W,we,ce,U],encapsulation:2})};var kd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Wd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Nd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Ad=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Gd=(i,s,e)=>({CategoryID:i,From:s,To:e}),Hd=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Mr=i=>({CategoryID:i});function Yd(i,s){if(i&1){let e=b();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",8),p(2," Export "),a()}}function Qd(i,s){if(i&1){let e=b();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"POS-brand-options",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",14)(15,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Sales Person"),a(),n(18,"sales-person-selector",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(19,"h6"),p(20,"Customer"),a(),n(21,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(22,"h6"),p(23,"Discount Calculation"),a(),n(24,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(25,"h6"),p(26,"Hide Zero & Negative"),a(),n(27,"radio-options",19),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(28,"h6"),p(29,"Product Type"),a(),n(30,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.BrandID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function jd(i,s){i&1&&(n(0,"th",31),p(1," Cost "),E(2,"p-treeTableSortIcon",32),a())}function qd(i,s){i&1&&(n(0,"th",33),p(1," Gross "),E(2,"p-treeTableSortIcon",34),a(),n(3,"th",35),p(4," Disc "),E(5,"p-treeTableSortIcon",36),a(),n(6,"th",37),p(7," Sales "),E(8,"p-treeTableSortIcon",38),a())}function Ud(i,s){i&1&&(n(0,"th",39),p(1," Profit "),E(2,"p-treeTableSortIcon",40),a(),n(3,"th",41),p(4," % "),E(5,"p-treeTableSortIcon",42),a())}function Kd(i,s){if(i&1&&(n(0,"tr",26)(1,"th",27),p(2," Category "),E(3,"p-treeTableSortIcon",28),a(),n(4,"th",29),p(5," Qty "),E(6,"p-treeTableSortIcon",30),a(),C(7,jd,3,0,"th",31),C(8,qd,9,0),C(9,Ud,6,0),a()),i&2){let e=m(2);o(7),g(e.roleService.product.Cost?7:-1),o(),g(e.roleService.report.Price?8:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?9:-1)}}function zd(i,s){if(i&1&&(n(0,"td",47)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",ft(e.CostInDirect&&e.Cost?"Direct ("+x(2,3,e.Cost)+") Indirect ("+x(3,5,e.CostInDirect)+")":"")),o(3),F(x(5,7,e.DisplayedCost))}}function Jd(i,s){if(i&1&&(n(0,"td",48)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td",49)(7,"a",50),d(8,"number"),d(9,"number"),p(10),d(11,"amountFraction"),a()(),n(12,"td",48)(13,"span",46),d(14,"number"),d(15,"number"),n(16,"a",45),p(17),d(18,"amountFraction"),a()()()),i&2){let e=m().rowData;o(),c("matTooltip",ft(e.GrossIndirect&&e.GrossSales?"Direct ("+x(2,13,e.GrossSales)+") Indirect ("+x(3,15,e.GrossIndirect)+")":"")),o(3),F(x(5,17,e.DisplayedGross)),o(3),c("matTooltip",ft(e.DiscountIndirect&&e.Discount?"Direct ("+x(8,19,e.Discount)+") Indirect ("+x(9,21,e.DiscountIndirect)+")":""))("routerLink",I(31,Hd))("queryParams",J(32,Mr,e.ID)),o(3),F(x(11,23,e.DisplayedTotalDiscount)),o(3),c("matTooltip",ft(e.NetSalesIndirect&&e.Sales?"Direct ("+x(14,25,e.Sales)+") Indirect ("+x(15,27,e.NetSalesIndirect)+")":"")),o(3),c("routerLink",I(34,Vr))("queryParams",J(35,Mr,e.ID)),o(),F(x(18,29,e.DisplayedNetSales))}}function Xd(i,s){if(i&1&&(n(0,"span",46),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",ft(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",x(4,9,e.DisplayedPercentage),"%")}}function Zd(i,s){if(i&1&&(n(0,"td",51)(1,"span",46),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()(),n(6,"td"),C(7,Xd,5,11,"span",46),a()),i&2){let e=m().rowData,r=m(2);o(),c("matTooltip",ft(e.ProfitInDirect&&e.Profit?"Direct ("+x(2,4,e.Profit)+") Indirect ("+x(3,6,e.ProfitInDirect)+")":"")),o(3),F(x(5,8,e.DisplayedProfit)),o(3),g(r.roleService.report.Profit?7:-1)}}function $d(i,s){if(i&1&&(n(0,"tr",43)(1,"td"),E(2,"p-treeTableToggler",44),n(3,"a",45),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",46),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),C(13,zd,6,9,"td",47),C(14,Jd,19,37),C(15,Zd,8,10),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",I(23,Vr))("queryParams",mt(24,Gd,r.ID,v(4,11,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,14,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",ft(r.QuantityIndirect&&r.Quantity?"Direct ("+x(9,17,r.Quantity)+") Indirect ("+x(10,19,r.QuantityIndirect)+")":"")),o(3),F(x(12,21,r.DisplayedQuantity)),o(2),g(t.roleService.product.Cost?13:-1),o(),g(t.roleService.report.Price?14:-1),o(),g(t.roleService.product.Cost&&t.roleService.report.Price&&t.roleService.report.Profit?15:-1)}}function ec(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",x(2,1,e.data.Aggregate.TotalCost)," ")}}function tc(i,s){if(i&1&&(n(0,"td",55)(1,"a"),p(2),d(3,"amountFraction"),a()(),n(4,"td",53),p(5),d(6,"amountFraction"),a(),n(7,"td",55),p(8),d(9,"amountFraction"),a()),i&2){let e=m(3);o(2),F(x(3,3,e.data.Aggregate.TotalGross)),o(3),D(" ",x(6,5,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",x(9,7,e.data.Aggregate.TotalNetSales)," ")}}function ic(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a(),n(3,"td",53),p(4),d(5,"number"),a()),i&2){let e=m(3);o(),D(" ",x(2,2,e.data.Aggregate.TotalProfit)," "),o(3),D(" ",x(5,4,e.data.Aggregate.TotalPercentage),"% ")}}function nc(i,s){if(i&1&&(n(0,"tr",52)(1,"td",53),p(2,"Total :"),a(),n(3,"td",53),p(4),d(5,"quantityFraction"),a(),C(6,ec,3,3,"td",54),C(7,tc,10,9),C(8,ic,6,6),a()),i&2){let e=m(2);o(4),D(" ",x(5,4,e.data.Aggregate.TotalQuantity)," "),o(2),g(e.roleService.product.Cost?6:-1),o(),g(e.roleService.report.Price?7:-1),o(),g(e.roleService.report.Price&&e.roleService.product.Cost&&e.roleService.report.Profit?8:-1)}}function ac(i,s){if(i&1&&(n(0,"content")(1,"div",21)(2,"p-treeTable",22),L(3,Kd,10,3,"ng-template",23)(4,$d,16,28,"ng-template",24)(5,nc,9,6,"ng-template",25),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",I(4,Ad))}}var Qn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(z,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[Y],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-danger",2,"width","120px"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[1,"text-success",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","150px"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Yd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),L(17,Qd,31,16,"ng-template",null,0,A),a(),C(19,ac,6,5,"content"),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,kd)),o(3),c("routerLink",I(11,Wd)),o(3),c("routerLink",I(12,Nd)),o(5),g(t.data?19:-1))},dependencies:[H,Q,$,X,k,W,ae,we,Ae,mr,No,ur,sr,dr,cr,ce,Lt,U,ze,re,oe,Z,ie],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var oc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],lc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function pc(i,s){if(i&1){let e=b();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",9),p(2," Export "),a()}}function mc(i,s){if(i&1){let e=b();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function sc(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function dc(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function cc(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Value))}}function uc(i,s){if(i&1&&(n(0,"td"),C(1,dc,2,1,"span"),C(2,cc,3,3,"span"),a()),i&2){let e=s.$implicit;o(),g(e.Key=="Category"?1:-1),o(),g(e.Key!="Category"?2:-1)}}function _c(i,s){if(i&1&&(n(0,"tr"),V(1,uc,3,2,"td",null,R),a()),i&2){let e=s.$implicit;o(),B(e)}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",x(2,1,e))}}function gc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),V(4,Cc,3,3,"td",null,R),a()()),i&2){let e=m(2);o(4),B(e.data.Sum)}}function xc(i,s){if(i&1){let e=b();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),V(4,sc,2,2,"th",19,R),a()(),n(6,"tbody"),V(7,_c,3,0,"tr",null,R),a(),C(9,gc,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),B(e.data.Dataheader),o(3),B(e.data.Data),o(2),g(e.data.Data.length>0?9:-1)}}var jn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}openExportModal(){this.matDialog.open(z,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let y=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let je=t.find(ai=>ai.Key===[this.data.Dataheader[T]].toString()).Value,vt=l.find(ai=>ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(je,vt,y)}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[Y],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),L(17,mc,16,9,"ng-template",null,0,A),a(),n(19,"content"),C(20,xc,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",I(10,oc)),o(3),c("routerLink",I(11,rc)),o(3),c("routerLink",I(12,lc)),o(6),g(t.data?20:-1))},dependencies:[H,Q,X,k,W,le,ge,Ae,ce,U,Z],encapsulation:2})};var fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function yc(i,s){if(i&1){let e=b();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Dc(i,s){if(i&1&&(n(0,"div",6),E(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var qn=class i extends pe{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(G),w(N))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[Y],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),S(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),L(16,yc,10,6,"ng-template",null,0,A),a(),n(18,"content"),C(19,Dc,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",I(8,fc)),o(3),c("routerLink",I(9,Sc)),o(3),c("routerLink",I(10,hc)),o(6),g(t.data?19:-1))},dependencies:[H,Q,$,k,W,ii],encapsulation:2})};var vc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Tc(i,s){if(i&1){let e=b();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function wc(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),E(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),E(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var Un=class i extends ve{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let y={name:l.Name+": "+l.Description,y:l.Transaction};t.push(y)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,y){return l+"<br/>"+y.series.name+": <b>"+y.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(j))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[Y],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),E(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),L(6,Tc,13,9,"ng-template",null,0,A),a(),C(8,wc,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",I(6,vc)),o(6),g(t.data?8:-1))},dependencies:[H,Q,$,X,k,W,ii,Ft,U],encapsulation:2})};function Pc(i,s){if(i&1){let e=b();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",5),p(2," Export "),a()}}function Fc(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function bc(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(x(3,5,e.Visitor)),o(3),F(x(6,7,e.Orders)),o(3),F(x(9,9,e.TotalVisitor)),o(3),F(x(12,11,e.Sales)),o(3),F(x(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Ec(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),V(15,bc,16,15,"tr",null,R),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),B(e.data.Data),o(7),F(x(24,7,v(23,4,e.data.Data,"Orders"))),o(4),F(x(28,12,v(27,9,e.data.Data,"TotalVisitor"))),o(4),F(x(32,17,v(31,14,e.data.Data,"Sales"))),o(4),F(x(35,19,e.getSpendingPerPersonSum(e.data.Data)))}}var Kn=class i extends pe{constructor(e,r,t,l,y){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(z,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[Y],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Pc,3,0,"a",2),a(),n(3,"filters"),L(4,Fc,10,6,"ng-template",null,0,A),a(),n(6,"content"),C(7,Ec,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),g(t.data?7:-1))},dependencies:[H,X,k,W,U,me,re,Z],encapsulation:2})};var Ic=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Mc(i,s){if(i&1){let e=b();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),E(1,"i",16),p(2," Export "),a()}}function Vc(i,s){if(i&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Bc(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Lc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(x(2,1,e.Revenue))}}function Oc(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),C(20,Lc,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(x(5,7,e.Count)),o(3),F(x(8,9,e.Quantity)),o(3),F(x(11,11,e.Sales)),o(3),F(x(15,15,x(14,13,e.Tax))),o(4),F(x(19,19,x(18,17,e.SalesWithTax))),o(3),g(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Rc(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(x(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var zn=class i extends ve{constructor(e,r,t,l,y){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=y}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(z,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(G),w(N),w(q),w(j),w(K))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[Y],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return t.searchFromPageOne()}),h("filterChange",function(T){return u(l),S(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),C(2,Mc,3,0,"a",2),n(3,"a",3),E(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),L(7,Vc,10,6,"ng-template",null,0,A),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),C(26,Bc,2,0,"th",10),a()(),n(27,"tbody"),V(28,Oc,21,21,"tr",null,R),a(),n(30,"tfoot")(31,"tr",11),E(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),C(55,Rc,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),g(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",I(42,Ic)),o(23),g(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),B(t.data==null?null:t.data.Data),o(6),F(x(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(x(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(x(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(x(49,33,x(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(x(54,40,x(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),g(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[H,Q,X,k,W,U,me,Xo,re,Z,ie],encapsulation:2})};var lo=Gt(ti());var kc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],ro=(i,s)=>({From:i,To:s}),Wc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Nc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Ac(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Gc(i,s){if(i&1&&(n(0,"content")(1,"div",11),E(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Jn=class i extends pe{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(s,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=(0,lo.default)(s.from).format("YYYY-MM-DD[T]00:00:00"),this.pageData.Filter.To=(0,lo.default)(s.to).format("YYYY-MM-DD[T]00:00:00")}static \u0275fac=function(e){return new(e||i)(w(G),w(N),w(Ne))};static \u0275cmp=O({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[Y],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=b();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return r.searchFromPageOne()}),h("filterChange",function(y){return u(t),S(r.pageData.Filter,y)||(r.pageData.Filter=y),_(y)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),L(16,Ac,13,11,"ng-template",null,0,A),a(),C(18,Gc,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",I(11,kc))("queryParams",xe(12,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(15,Wc))("queryParams",xe(16,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",I(19,Nc))("queryParams",xe(20,ro,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),g(r.data?18:-1))},dependencies:[H,Q,$,k,W,Ft,Ot,ce,U],encapsulation:2})};var Qc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Zn=(()=>{class i{constructor(){this.dateChange=nn(),this.width=Ci(),this.minDate=M.MinDate}ngOnInit(){}setMonthAndYear(e,r){let t=null;e&&(t=e.toDate(),t.setHours(0,0,0,0)),this.date=t,this.dateChange.emit(t),r.close()}onDateChange(e){let r=null;e&&(r=e.toDate()),this.date=r,this.dateChange.emit(r)}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var r=new bootstrap.Dropdown(e);r&&(r._config.autoClose="outside")}}chosenYearHandler(e,r){let t=new Date(e.getFullYear(),0,1);this.date=t.toISOString(),r.close()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=O({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:[1,"width"]},outputs:{dateChange:"dateChange"},features:[en([{provide:un,useClass:Fn,deps:[cn,pr]},{provide:_n,useValue:Qc}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(r,t){if(r&1){let l=b();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(T){return t.onDateChange(T.value)}),a(),E(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(T){u(l);let je=Xt(4);return _(t.chosenYearHandler(T,je))})("monthSelected",function(T){u(l);let je=Xt(4);return _(t.setMonthAndYear(T,je))})("opened",function(){return t.onOpenDatepicker()})("closed",function(){return t.onCloseDatepicker()}),a()()}if(r&2){let l=Xt(4);Ut("width",t.width()||100,"%"),o(),c("matDatepicker",l)("value",t.date==t.minDate?null:t.date),o(),c("for",l)}},dependencies:[Ht,hn,gi,xn,fn,Sn,xi,Dn,gn,Cn,yn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2})}}return i})();var qc=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function Uc(i,s){if(i&1){let e=b();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return S(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return S(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return S(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return S(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Kc(i,s){if(i&1&&(n(0,"div",5),E(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $n=class i extends pe{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e};let r=this.data.ProfitTaxCalculationConfig;this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let t,l="",y=Math.abs(this.total);if(r==0){let T=e.find(je=>je?.serieType==="Tax");T&&(y=y-T.data[this.x])}return y>999&&y<1e10?(l="K",t=(y/1e3).toFixed(0)):y>=1e10?(l="M",t=(y/1e6).toFixed(0)):y<999&&(t=y.toString()),this.total<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+l}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let t=this.series.chart.series,l=this.point?.stackTotal;if(r==0){let vt=t.find(ai=>ai.userOptions?.serieType==="Tax");vt&&(l=l-vt.points[this.point.index]?.y)}t=t.filter(vt=>this.series?.name==vt?.name);let y=[],T="",je=this.point.index;return t.forEach(vt=>{vt.options.stack===this.point.series.options.stack&&(y=vt.name.split(" "),T+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(l)}</br>${y[0]}: