dealpos 25.46.2 → 25.46.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 (98) hide show
  1. package/browser/{chunk-7QGORD2Z.js → chunk-2Q23XI4H.js} +1 -1
  2. package/browser/{chunk-ILIZ5NZH.js → chunk-2V22R5VQ.js} +2 -2
  3. package/browser/{chunk-FY2ZQK3Q.js → chunk-3ZL5OQ6Y.js} +1 -1
  4. package/browser/{chunk-IMST27WS.js → chunk-4SZSKHNM.js} +1 -1
  5. package/browser/{chunk-L424UWKA.js → chunk-5PM7FX2A.js} +1 -1
  6. package/browser/{chunk-OR7B4MQC.js → chunk-6LUP2QUS.js} +1 -1
  7. package/browser/{chunk-IGKZJP6R.js → chunk-7IKS62P4.js} +1 -1
  8. package/browser/{chunk-L5ZIS7CJ.js → chunk-A7SD2VFQ.js} +1 -1
  9. package/browser/{chunk-LK7UQBXO.js → chunk-AHH7WWRR.js} +1 -1
  10. package/browser/chunk-AUNBZC5X.js +1 -0
  11. package/browser/{chunk-MJIPNN7A.js → chunk-B6UUMCCL.js} +1 -1
  12. package/browser/chunk-BCUIYEEN.js +1 -0
  13. package/browser/{chunk-IRDKCXB2.js → chunk-BO3VS4P2.js} +3 -3
  14. package/browser/{chunk-UPV6MUOR.js → chunk-BSEMTXLF.js} +1 -1
  15. package/browser/{chunk-BR3Y2C2F.js → chunk-BUFSWKBD.js} +1 -1
  16. package/browser/{chunk-GM6P3WGI.js → chunk-CANKSLDR.js} +1 -1
  17. package/browser/chunk-CJAXFMGW.js +4 -0
  18. package/browser/{chunk-SFQX5FUP.js → chunk-CRV3LKD4.js} +1 -1
  19. package/browser/{chunk-WOAUMRNS.js → chunk-CVJVCQ6I.js} +2 -2
  20. package/browser/{chunk-HIOIFMAE.js → chunk-D4MDXIT7.js} +1 -1
  21. package/browser/{chunk-QAQYVKMI.js → chunk-DBO4OIFC.js} +1 -1
  22. package/browser/{chunk-JVFZL3LP.js → chunk-E4W726L4.js} +1 -1
  23. package/browser/{chunk-FNQCKGUC.js → chunk-EECCKE6U.js} +1 -1
  24. package/browser/{chunk-F53OD5V2.js → chunk-ETJRXLR3.js} +1 -1
  25. package/browser/{chunk-GSFXKVGZ.js → chunk-EXBHWA2P.js} +1 -1
  26. package/browser/{chunk-B3JWFPWO.js → chunk-EY4MKOFO.js} +1 -1
  27. package/browser/{chunk-CGISR53W.js → chunk-EYMK2IFW.js} +1 -1
  28. package/browser/{chunk-EMJ7V5XH.js → chunk-FSAJKQDB.js} +2 -2
  29. package/browser/{chunk-NFFC4KSY.js → chunk-GM32VXD2.js} +1 -1
  30. package/browser/{chunk-DJAISUEF.js → chunk-GTOAGTPM.js} +1 -1
  31. package/browser/{chunk-MIENCGCQ.js → chunk-H56LVVYJ.js} +1 -1
  32. package/browser/{chunk-PO6OVC5B.js → chunk-HDEJPWCD.js} +1 -1
  33. package/browser/{chunk-CM7Z6YFA.js → chunk-HDN67LOA.js} +1 -1
  34. package/browser/{chunk-NQ3LNNVL.js → chunk-HGPCQ4AQ.js} +1 -1
  35. package/browser/{chunk-HYCJCA6A.js → chunk-HJMIG2KP.js} +1 -1
  36. package/browser/{chunk-NMOQIXVY.js → chunk-HP7MYAS4.js} +1 -1
  37. package/browser/{chunk-C56YPV2G.js → chunk-HV2BHQH6.js} +1 -1
  38. package/browser/{chunk-ZVBZGOUU.js → chunk-HVYXUBCL.js} +1 -1
  39. package/browser/{chunk-KP7OGAMJ.js → chunk-IGT2Z63X.js} +1 -1
  40. package/browser/{chunk-YEV6AJC2.js → chunk-J2S3L4BK.js} +1 -1
  41. package/browser/{chunk-TVZ622KQ.js → chunk-J5QXJ7YA.js} +1 -1
  42. package/browser/{chunk-N6ZNENQU.js → chunk-JZZU2MLE.js} +1 -1
  43. package/browser/{chunk-JT3HOWQH.js → chunk-K3NVAA5T.js} +2 -2
  44. package/browser/{chunk-KA4G654J.js → chunk-L53F53XJ.js} +1 -1
  45. package/browser/{chunk-HYCSLDMX.js → chunk-M57SNMET.js} +1 -1
  46. package/browser/{chunk-ZK32OWP6.js → chunk-MSD7SYVM.js} +1 -1
  47. package/browser/{chunk-SVAXS2TA.js → chunk-N32L5P4T.js} +1 -1
  48. package/browser/{chunk-L5GSB3ZX.js → chunk-N6UWZZAO.js} +1 -1
  49. package/browser/chunk-NBMH5YL2.css +1 -0
  50. package/browser/{chunk-374PEHK3.js → chunk-NMVW3VVE.js} +1 -1
  51. package/browser/{chunk-3JKK7ROI.js → chunk-NMZ6GTP4.js} +1 -1
  52. package/browser/{chunk-GMPJ72LI.js → chunk-NQ5VXC3S.js} +1 -1
  53. package/browser/{chunk-VWOX66SZ.js → chunk-OYWLVATN.js} +2 -2
  54. package/browser/chunk-P3SYBLK4.js +21 -0
  55. package/browser/{chunk-56D7QEFP.js → chunk-PSTLUWM3.js} +1 -1
  56. package/browser/{chunk-LUWTRLMM.js → chunk-PYYZEHRP.js} +1 -1
  57. package/browser/{chunk-475JSTPA.js → chunk-R7ZUTEN5.js} +1 -1
  58. package/browser/{chunk-QZK5TM5O.js → chunk-RLEDN77K.js} +1 -1
  59. package/browser/{chunk-GDS3XQ5F.js → chunk-RRSZSQXZ.js} +1 -1
  60. package/browser/{chunk-WRVMZNGD.js → chunk-RYPGBCMP.js} +1 -1
  61. package/browser/{chunk-O4AM5O5P.js → chunk-RZFCIF5S.js} +12 -12
  62. package/browser/{chunk-KPVGNOMG.js → chunk-SUDJEYTS.js} +1 -1
  63. package/browser/{chunk-ED4WZKA6.js → chunk-T43EI6C4.js} +1 -1
  64. package/browser/{chunk-MD6WWBSZ.js → chunk-TZI7LFWS.js} +1 -1
  65. package/browser/{chunk-4ZWIQZYV.js → chunk-UIVVS2T6.js} +2 -2
  66. package/browser/{chunk-U3B2DTPX.js → chunk-UKIZOGIH.js} +1 -1
  67. package/browser/{chunk-IKA5TDNG.js → chunk-USWITQGA.js} +1 -1
  68. package/browser/{chunk-S7N22G4D.js → chunk-V6YX566Y.js} +1 -1
  69. package/browser/{chunk-6FM7DAHK.js → chunk-VHMJLWN2.js} +1 -1
  70. package/browser/{chunk-TH6BQXNM.js → chunk-VKOITLMF.js} +1 -1
  71. package/browser/{chunk-FX72NG5O.js → chunk-VLIFX6NB.js} +1 -1
  72. package/browser/{chunk-LBXJVRAT.js → chunk-VTZ4GDFL.js} +1 -1
  73. package/browser/{chunk-TVWGXKBN.js → chunk-VUFSO5QD.js} +1 -1
  74. package/browser/{chunk-5TOXPQJI.js → chunk-VXI35BGO.js} +4 -4
  75. package/browser/{chunk-OQI66KFN.js → chunk-WG52OV4Z.js} +1 -1
  76. package/browser/{chunk-TDZ2L7GX.js → chunk-WH6FJAKV.js} +1 -1
  77. package/browser/{chunk-UWWB4ON7.js → chunk-WUNSFROS.js} +1 -1
  78. package/browser/{chunk-KJLTTTEY.js → chunk-XQYDL5EE.js} +1 -1
  79. package/browser/{chunk-HOBU2OAG.js → chunk-XUA2KEJ4.js} +1 -1
  80. package/browser/{chunk-O2K56L4P.js → chunk-Y44UA7DO.js} +1 -1
  81. package/browser/{chunk-UDWVWF7E.js → chunk-YKC2FBNL.js} +1 -1
  82. package/browser/{chunk-HLNB2PE4.js → chunk-ZGXT57VK.js} +1 -1
  83. package/browser/{chunk-P5CBDXUP.js → chunk-ZJM7CEC4.js} +1 -1
  84. package/browser/{chunk-MFBHQLLO.js → chunk-ZOF2GBAH.js} +1 -1
  85. package/browser/{chunk-QPN54ILN.js → chunk-ZPBXRVNF.js} +1 -1
  86. package/browser/{chunk-BLG3XERH.js → chunk-ZRLQ45YW.js} +1 -1
  87. package/browser/{chunk-DGXQDOCM.js → chunk-ZZ4DKVU3.js} +1 -1
  88. package/browser/{chunk-3BRM3TED.js → chunk-ZZV5IAED.js} +1 -1
  89. package/browser/index.html +2 -2
  90. package/browser/{main-ICSDESMZ.js → main-22ZKBRZC.js} +2 -2
  91. package/browser/main-WPNH2WGQ.css +1 -0
  92. package/package.json +1 -1
  93. package/browser/chunk-5ZFCEP2C.css +0 -1
  94. package/browser/chunk-CLJWABT2.js +0 -4
  95. package/browser/chunk-G5QWJMKY.js +0 -1
  96. package/browser/chunk-GI7KMXBX.js +0 -21
  97. package/browser/chunk-PKIK7U7Z.js +0 -1
  98. package/browser/main-5IXVIJ7Z.css +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ri,b as Gr}from"./chunk-RNXOIUIO.js";import{a as Yr}from"./chunk-3BRM3TED.js";import{a as Mt,b as Hr}from"./chunk-AQQHMGYE.js";import{a as Ht,b as Qr}from"./chunk-7EQG6N5Y.js";import{a as Hn,b as Oi}from"./chunk-GDRHD33K.js";import{a as oi}from"./chunk-2MQDNPCG.js";import{a as De}from"./chunk-CM7Z6YFA.js";import{a as ze}from"./chunk-LBQRCFLJ.js";import{a as Gn}from"./chunk-3PC6CTVP.js";import{a as gt}from"./chunk-2LOWEWI4.js";import{a as cr}from"./chunk-ZEKZLSGA.js";import{b as gr}from"./chunk-KEAT6AT3.js";import"./chunk-WH2BY5K4.js";import{a as Bi}from"./chunk-QZK5TM5O.js";import"./chunk-6H5P35AP.js";import{a as Ar}from"./chunk-DLNZDHGS.js";import{a as Rr,b as kr,d as Wr,g as Nr}from"./chunk-RF5WGONA.js";import"./chunk-BYXBJQAS.js";import{a as Vi}from"./chunk-R4OHTTCT.js";import{a as Ir,b as br}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{e as _r}from"./chunk-INHUUGSI.js";import{a as Er,b as Mr,c as Vr,d as Br,e as Or,f as Lr}from"./chunk-KJLTTTEY.js";import"./chunk-KHR4NBM3.js";import"./chunk-O2K56L4P.js";import"./chunk-H7XFYY6V.js";import"./chunk-XACC6EMJ.js";import{a as te}from"./chunk-HL3ONSX6.js";import{a as Z}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{a as Ei,b as Fr,c as An,d as J,e as Mi}from"./chunk-SO4GMA3Y.js";import{a as Vn,b as Ti}from"./chunk-PECGNYTX.js";import"./chunk-3RK6DDJD.js";import{a as Mn}from"./chunk-SARJJ3AZ.js";import{a as Dn,b as vn,c as wn,f as Fn,g as In,h as bn,p as wi,q as En}from"./chunk-DC426G2P.js";import"./chunk-3KSZCJ6T.js";import"./chunk-BYO7FJ4O.js";import"./chunk-CBSYYTXQ.js";import{c as ur,d as Te,e as Nn}from"./chunk-6WEGHV7F.js";import"./chunk-G4IW5GPY.js";import{a as Pi}from"./chunk-TH6BQXNM.js";import{a as pe,b as Ce,c as sr}from"./chunk-APOV2ZYY.js";import{a as Et,b as Pr}from"./chunk-I3ABVEQL.js";import{d as vr,f as fe}from"./chunk-ZK32OWP6.js";import{a as wr,b as Tr,c as U}from"./chunk-WRVMZNGD.js";import{b as K}from"./chunk-KD7WBOUR.js";import{a as me}from"./chunk-LK7UQBXO.js";import{a as mr}from"./chunk-BR3Y2C2F.js";import"./chunk-QFON23YX.js";import"./chunk-FIUZN6JU.js";import{a as q}from"./chunk-4QM23MMO.js";import{e as A,f as bi}from"./chunk-CGISR53W.js";import"./chunk-U3B2DTPX.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as Cr}from"./chunk-YRGHPSPV.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import"./chunk-M43HNBJQ.js";import{a as fr,c as Ue}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{d as Dr}from"./chunk-6FM7DAHK.js";import{b as N}from"./chunk-DGXQDOCM.js";import"./chunk-CS6HBROS.js";import"./chunk-JUS6LLVX.js";import{C as kn,F as Ne,G as Wn,j as Tn,m as Pn,t as dr,u as Fi,v as ni,w as On}from"./chunk-QZMZBCE7.js";import{b as ae,c as yn}from"./chunk-C4WJKF7R.js";import{A as Rn,B as Sr,C as ai,K as Ii,N as yr,g as se,o as xr,s as Ln,z as hr}from"./chunk-NZYZO47Z.js";import{a as Bn,d as $}from"./chunk-7TBS7SPQ.js";import"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{b as xn,e as ti,f as ii,g as z}from"./chunk-A45GTZVV.js";import"./chunk-NWSIPELM.js";import{a as rr}from"./chunk-6SGN7MNX.js";import{c as or,j as lr,k as Xi,l as pr}from"./chunk-L76WVZW6.js";import{a as Ki}from"./chunk-2FWFPV5I.js";import{oa as hn,pa as Sn,xa as ar}from"./chunk-O5SLP4JK.js";import{F as Gt,G as fn,a as $o,b as er,c as Qe,h as L,l as tr,o as k,q as ir,s as nr}from"./chunk-RNLSEEMX.js";import"./chunk-JVFZL3LP.js";import"./chunk-TVZ622KQ.js";import{a as V,d as Y}from"./chunk-USJ6ILEE.js";import"./chunk-CLJWABT2.js";import{$b as Ut,$d as zi,Ab as G,Bb as H,Bc as d,Ca as dt,Cb as c,Cc as g,Db as n,Dc as v,E as mi,Eb as a,Ec as Si,Ed as Zo,Fb as b,Hc as O,I as Yi,Ia as fo,Ja as No,Jb as pt,Jc as jo,K as Lo,Kb as mt,Kc as yi,Lb as Ho,Lc as un,M as Ro,Ma as Ao,Mb as I,Ob as P,Oc as qo,Pc as Di,Q as an,Qa as Ee,Qb as m,Sa as ln,Tb as xo,Tc as _n,Ub as cn,Vb as fi,Vc as Uo,Wb as xi,Wd as We,Xa as o,Xc as ho,Y as Nt,Ya as pn,Yc as zo,Yd as Cn,Zc as Ko,Zd as Q,_b as Dt,aa as Co,ac as qi,bc as Qo,be as qe,cc as Ui,cd as Ze,db as w,dc as p,ec as F,ed as st,ee as R,fa as At,fc as D,fd as it,gc as ei,hb as B,ib as Ci,ic as f,jb as mn,jc as x,jd as Xo,ka as ko,kc as h,kd as gn,la as on,lb as W,ma as gi,mb as sn,md as re,na as $t,nb as E,o as _i,oc as Ct,od as ne,pa as Fe,rd as vi,sc as hi,t as qt,ta as u,tb as si,tc as M,td as Jo,u as go,ua as _,uc as X,vb as S,vc as ue,wb as Go,wc as _t,xa as rn,xb as y,xc as zt,yb as ji,yc as dn,za as Wo,zb as j,zc as Yo}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{a as tt,b as nt,f as Ql,h as Zt,k as Qi}from"./chunk-SNAKHGZS.js";var bo=Ql((Ji,Io)=>{(function(i,s){typeof Ji=="object"&&typeof Io=="object"?Io.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Ji=="object"?Ji["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Ji:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var oe=r[ye];if(oe!==void 0)return oe.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var oe=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(oe,{a:oe}),oe},t.d=(ye,oe)=>{for(var Ve in oe)t.o(oe,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:oe[Ve]})},t.o=(ye,oe)=>Object.prototype.hasOwnProperty.call(ye,oe);var l={};t.d(l,{default:()=>Hl});var C=t(944),T=t.n(C),$e=t(984),Ai=t.n($e);let Gi={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function $i(ye,oe,Ve,he,at,Ge){let ee=(Ge-oe)*(Ve-ye)-(he-oe)*(at-ye);return ee>0||!(ee<0)}function en(ye,oe,Ve,he,at,Ge,ee,Le){return $i(ye,oe,at,Ge,ee,Le)!==$i(Ve,he,at,Ge,ee,Le)&&$i(ye,oe,Ve,he,at,Ge)!==$i(ye,oe,Ve,he,ee,Le)}let{animObject:_o}=T(),{format:Ol}=Ai(),{setOptions:Ll}=T(),{composed:Rl}=T(),{boxIntersectLine:Eo,intersectRect:kl}={boxIntersectLine:function(ye,oe,Ve,he,at,Ge,ee,Le){return en(ye,oe,ye+Ve,oe,at,Ge,ee,Le)||en(ye+Ve,oe,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe+he,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe,ye,oe+he,at,Ge,ee,Le)},intersectRect:function(ye,oe){return!(oe.left>ye.right||oe.right<ye.left||oe.top>ye.bottom||oe.bottom<ye.top)}},{addEvent:Mo,extend:Vo,fireEvent:Wl,isNumber:tn,pick:Kt,pushUnique:Nl,syncTimeout:Al}=T();function di(ye,oe,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=Kt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Xt,It,et,Be;for(et=0;ct&&et<ct.length;et+=1)if(kl(ct[et],{left:oe,right:oe+he.width,top:Ve,bottom:Ve+he.height}))return!1;for(et=0;et<Ge.series.length;et+=1){let ut=Ge.series[et],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=oe-16&&Re[Be-1].chartX<=oe+he.width+16){if(Eo(oe,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Eo(oe-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Xt=oe+he.width/2-Re[Be].chartX)*Xt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(oe+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:oe,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Bo(ye){if(this.renderer){let oe=this,Ve=_o(oe.renderer.globalAnimation).duration;oe.labelSeries=[],oe.labelSeriesMaxSum=0,oe.seriesLabelTimer&&T().clearTimeout(oe.seriesLabelTimer),oe.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&oe.labelSeries&&(oe.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),oe.labelSeriesMaxSum=Math.max(oe.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,_o(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),oe.seriesLabelTimer=Al(function(){oe.series&&oe.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Xt=[],It=Ke.graph||Ke.area,et=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Hi=Be?Re.len:ut.len,ht=Kt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Jt=Be?"chartCenterX":"chartCenterY";function pi(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Xt.push(lt))}if(Ke.getPointSpline&&et&&et.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=et.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=et.getPointAtLength(ct),Rt=Be?Hi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;pi({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();pi({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(tn(Lt)&&tn(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Hi-((kt||yt.plotY||0)+Kt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+Kt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)pi({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Jt]:(lt[Jt]||0)+((bt[Jt]||0)-(lt[Jt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});pi(bt),lt=bt}}}return Xt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+Kt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Xt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,et=ee.interpolatedPoints,Be=Kt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Hi,ht,je,Tt=ee.labelBySeries,Jt,pi,lt;function yt(Yt,Wt,jt){let nn=Math.max(ft,Kt(pi,-1/0)),ui=Math.min(ft+Xt,Kt(lt,1/0));return Yt>nn&&Yt<=ui-jt.width&&Wt>=xt&&Wt<=xt+It-jt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Jt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],pi=Math.min.apply(Math,Jt),lt=Math.max.apply(Math,Jt)),ee.visible&&!ee.boosted&&et){if(!Tt){var Rt,kt,bt;let Yt=ee.name;if(typeof Le.format=="string"?Yt=Ol(Le.format,ee,he):Le.formatter&&(Yt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Yt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(Vo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=et.length-1;ht>0;ht-=1)Be?yt(ot=(et[ht].chartCenterX??et[ht].chartX)-Je.width/2,wt=(et[ht].chartCenterY??et[ht].chartY)-Je.height/2,Je)&&(je=di(ee,ot,wt,Je)):(yt(ot=et[ht].chartX+3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX+3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Xt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Hi=di(ee,ot,wt,Je,!0))&&ut.push(Hi);if(ut.length){ut.sort((Wt,jt)=>jt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Yt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Yt&&ee.labelBySeries){let Wt,jt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},nn={opacity:1};Yt<=10&&(nn={x:jt.x,y:jt.y},jt={}),ct&&(Wt=_o(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(Vo(jt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(nn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let ui=ee.searchPoint({chartX:je.x,chartY:je.y},!0);ui&&(Tt.closest=[ui,je.x-(ui.plotX||0),je.y-(ui.plotY||0)])}}else Lt()}else Lt()}),Wl(he,"afterDrawSeriesLabels")})(oe)},oe.renderer.forExport||!Ve?0:Ve)}}function Gl(ye,oe,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return tn(Ge)&&tn(ee)&&(Le=[["M",Ge,ee]],(Ke=oe-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>oe+he?Le.push(["L",ye+ct,oe+he]):ee<oe?Le.push(["L",ye+ct,oe]):Ge<ye?Le.push(["L",ye,oe+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,oe+he/2])),Le||[]}let Oo=T();({compose:function(ye,oe){Nl(Rl,"SeriesLabel")&&(Mo(ye,"load",Bo),Mo(ye,"redraw",Bo),oe.prototype.symbols.connector=Gl,Ll({plotOptions:{series:{label:Gi}}}))}}).compose(Oo.Chart,Oo.SVGRenderer);let Hl=T();return l.default})())});var jr=(i,s)=>({"text-success":i,"text-danger":s});function Yl(i,s){i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2&&(o(),D(" ",v(2,1,s.Quantity,"1.0-0")," "))}function jl(i,s){if(i&1){let e=I();n(0,"span",5),P("click",function(){u(e);let t=m(2);return _(t.loadComplementaryQuantity())}),b(1,"i",6),a()}}function ql(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Cost "),a()(),n(4,"td")(5,"span",4),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",4),p(10),d(11,"number"),a()()()),i&2){let e=m();o(6),D(" ",g(7,2,e.Cost)," "),o(4),D(" ",v(11,4,e.CostRatio,"1.0-2"),"% ")}}function Ul(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Profit "),a()(),n(4,"td")(5,"span",7),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",8),p(10),d(11,"number"),a()()()),i&2){let e=m();o(5),c("ngClass",ue(9,jr,e.Profit>0,e.Profit<0)),o(),D(" ",g(7,4,e.Profit)," "),o(3),c("ngClass",ue(12,jr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),D("",v(11,6,e.ProfitRatio,"1.0-2"),"%")}}function zl(i,s){if(i&1&&(n(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"span",3),p(5,"Orders"),a()(),n(6,"td"),p(7),d(8,"number"),a(),b(9,"td"),a(),n(10,"tr")(11,"td")(12,"span",3),p(13," Quantity "),a()(),n(14,"td"),p(15),d(16,"quantityFraction"),a(),b(17,"td"),a(),n(18,"tr")(19,"td")(20,"span",3),p(21," Complementary "),a()(),n(22,"td"),S(23,Yl,3,4,"span"),d(24,"async"),Go(25,jl,2,0,"span"),a(),b(26,"td"),a(),n(27,"tr")(28,"td")(29,"span",3),p(30," Gross Sales "),a()(),n(31,"td"),p(32),d(33,"amountFraction"),a(),b(34,"td"),a(),n(35,"tr")(36,"td")(37,"span",3),p(38," Discount "),a()(),n(39,"td")(40,"span",4),p(41),d(42,"amountFraction"),a()(),n(43,"td")(44,"span",4),p(45),d(46,"number"),a()()(),n(47,"tr")(48,"td")(49,"span",3),p(50," Sales "),a()(),n(51,"td"),p(52),d(53,"amountFraction"),a(),b(54,"td"),a(),n(55,"tr")(56,"td")(57,"span",3),p(58," Tax "),a()(),n(59,"td"),p(60),d(61,"amountFraction"),a(),b(62,"td"),a(),n(63,"tr")(64,"td")(65,"span",3),p(66," Sales + Tax "),a()(),n(67,"td"),p(68),d(69,"amountFraction"),a(),b(70,"td"),a(),S(71,ql,12,7,"tr"),S(72,Ul,12,15,"tr"),a()()),i&2){let e,r=s,t=m();o(7),F(g(8,11,r.Orders)),o(8),F(g(16,13,r.Quantity)),o(8),y((e=g(24,15,t.complementaryQuantity$))?23:25,e),o(9),F(g(33,17,r.GrossSales)),o(9),D(" ",g(42,19,r.Discount)," "),o(4),D(" ",v(46,21,r.DiscountRatio,"1.0-2"),"% "),o(7),F(g(53,24,r.Sales)),o(8),F(g(61,26,r.Tax)),o(8),F(g(69,28,r.SalesWithTax)),o(3),y(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?71:-1),o(),y(t.roleService.report.Profit?72:-1)}}var Qn=class i{constructor(s,e,r,t){this.httpService=s;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(qt(s=>(s.ProfitRatio=this.profitRatioCalculation(s.Profit,s.Sales,s.Tax),s.CostRatio=this.costRatioCalculation(s.Cost,s.Sales,s.Tax),s.DiscountRatio=this.discountPercentageCalc(s.Discount,s.GrossSales,s.Tax),s))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Fi,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}profitRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}discountPercentageCalc(s=0,e=0,r=0){return s/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Nt())}static \u0275fac=function(e){return new(e||i)(w(R),w(Y),w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[[3,"onClose","config"],[1,"p-3"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){if(e&1&&(n(0,"modal-material",0),P("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),S(3,zl,73,30,"table",2),d(4,"async"),a()()()),e&2){let t;c("config",r.modalConfig),o(3),y((t=g(4,2,r.reportSummary$))?3:-1,t)}},dependencies:[Ze,ni,gn,ne,Z,te],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var Kl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],qr=i=>({ID:i});function Xl(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Jl(i,s){if(i&1&&(n(0,"div",2),S(1,Xl,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function Zl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function $l(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function ep(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function tp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function ip(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function np(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function ap(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function op(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function rp(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function lp(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function pp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function mp(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function sp(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,pp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,mp,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function cp(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function dp(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,ep,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,tp,3,4,"span"),a(),S(17,ip,3,3,"span",46),S(18,np,2,1,"i",49),S(19,ap,2,1,"span",50),S(20,op,2,0,"span"),a(),S(21,rp,2,3,"div",51),S(22,lp,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,sp,27,19,"tr",55,j),a()(),n(29,"table",56),G(30,cp,8,5,"tr",null,j),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Kl))("queryParams",X(22,qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function up(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function _p(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function gp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function Cp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,$l,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,dp,32,24,"div",null,j),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,up,3,0,"span",40),S(35,_p,3,3,"span"),p(36),a()(),S(37,gp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),si("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Yn=class i extends De{constructor(e,r,t,l,C,T,$e,Ai){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=$e;this.roleService=Ai}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Qn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(We),w(z),w(qe),w(Y))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Jl,2,1,"div",2),a(),n(3,"filters"),E(4,Zl,46,26,"ng-template",null,0,O),a(),S(6,Cp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,U,ze,xr,Ln,ne,re,Z,te],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var jn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Fi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,k,Ue,ni],encapsulation:2})};var xp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ur=i=>({ID:i}),hp=()=>["/menu/Contacts/Contact/Customers/Info"],Sp=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function yp(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Dp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function vp(i,s){if(i&1){let e=I();n(0,"datepicker",26),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);f("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),f("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function wp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,Dp,11,4,"ng-container",13)(19,vp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),f("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),f("ngModel",r.pageData.Filter.SalesID),o(3),f("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),f("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),f("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),f("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),f("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),f("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",r.pageData.Filter.RowCount)}}function Tp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Pp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Fp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function Ip(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function bp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Ep(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function Mp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Vp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Bp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Op(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Lp(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function Rp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function kp(i,s){i&1&&b(0,"br")}function Wp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Np(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Ap(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,hp))("queryParams",X(4,Ur,e.CustomerID)),o(),F(e.CustomerName)}}function Gp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Hp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Qp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Yp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function qp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Up(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function zp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Kp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Xp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,Sp,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Jp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,kp,1,0,"br",4)(7,Wp,2,1,"i",4),a(),E(8,Np,7,8,"td",4)(9,Ap,3,6,"td",4),S(10,Gp,3,4,"td"),S(11,Hp,2,1,"td"),E(12,Qp,2,1,"td",4)(13,Yp,3,3,"td",68)(14,jp,3,3,"td",69)(15,qp,3,3,"td",69)(16,Up,3,3,"td",70)(17,zp,3,3,"td",69)(18,Kp,3,3,"td",69)(19,Xp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,xp))("queryParams",X(19,Ur,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Zp(i,s){i&1&&b(0,"td",79)}function $p(i,s){i&1&&b(0,"td",79)}function em(i,s){i&1&&b(0,"td",79)}function tm(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function im(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function nm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function am(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function om(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function rm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function lm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function pm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,Zp,1,0,"td",80)(4,$p,1,0,"td",80)(5,em,1,0,"td",80)(6,tm,2,0,"td",81)(7,im,4,6,"td",68)(8,nm,4,6,"td",69)(9,am,4,6,"td",69)(10,om,4,6,"td",70)(11,rm,4,6,"td",69)(12,lm,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function mm(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),E(8,Tp,2,0,"th",43)(9,Pp,2,0,"th",44),S(10,Fp,2,0,"th",45),S(11,Ip,2,0,"th",46),E(12,bp,2,0,"th",47)(13,Ep,2,0,"th",48)(14,Mp,2,0,"th",49)(15,Vp,2,0,"th",50)(16,Bp,2,0,"th",51)(17,Op,2,0,"th",52)(18,Lp,2,0,"th",53)(19,Rp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Jp,20,21,"tr",55),a(),E(22,pm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function sm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function cm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dm(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function um(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function _m(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,mm,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,sm,3,0,"span",34)(9,cm,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,dm,3,0,"a",36)(13,um,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var qn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(jn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,yp,3,0,"button",3),a(),n(3,"filters"),E(4,wp,36,22,"ng-template",null,0,O),a(),E(6,_m,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,Te,Ne,Vi,U,ze,se,ne,re,Z],encapsulation:2})};var gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],fm=()=>["/menu/Products/Setup/Brand/Brand_Form"],xm=i=>({ID:i}),hm=(i,s)=>({BrandID:i,Name:s});function Sm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function ym(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Dm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function vm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,vm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,fm))("queryParams",X(12,xm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",ue(14,hm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Tm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,Dm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,wm,12,17,"tr",null,j),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var Un=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Sm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,ym,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Tm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,gm)),o(3),c("routerLink",M(9,Cm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,k,ae,pe,Ce,U,se,Z,te],encapsulation:2})};function Pm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var zn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,Pm,4,3,"label",null,j),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[ni],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Vm=()=>["/menu/Contacts/Contact/Customers/Info"],Bm=i=>({ID:i});function Om(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Lm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Rm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function km(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Wm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Nm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Am(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Gm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Hm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Qm(i,s){if(i&1&&(n(0,"span"),G(1,Hm,5,2,"span",null,j),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Ym(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function jm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Um(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Km(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Xm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Jm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Qm,3,0,"span"),S(6,Ym,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,jm,3,3,"td",34),S(11,qm,3,3,"td",34),S(12,Um,3,3,"td",35),S(13,zm,3,3,"td",34),S(14,Km,3,3,"td",36),S(15,Xm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Vm))("queryParams",X(14,Bm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function Zm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Jm,16,16,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function $m(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,Rm,2,0,"th",22),S(10,km,2,0,"th",23),S(11,Wm,2,0,"th",24),S(12,Nm,2,0,"th",25),S(13,Am,2,0,"th",26),S(14,Gm,2,0,"th",27),a()(),S(15,Zm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=kn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Nt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(zn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Om,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Lm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,$m,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fm)),o(3),c("routerLink",M(13,Im)),o(3),c("routerLink",M(14,bm)),o(3),c("routerLink",M(15,Em)),o(4),c("routerLink",M(16,Mm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,U,oi,ne,Z,te],encapsulation:2})};var es=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function os(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function rs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function ls(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ps(i,s){if(i&1&&(n(0,"tbody",22),G(1,ls,12,10,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function ms(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ps,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,os,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,rs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ms,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,es)),o(3),c("routerLink",M(12,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z],encapsulation:2})};var ss=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],cs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ds=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],us=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],_s=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function gs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Cs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function fs(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function xs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function hs(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function Ss(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function ys(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function Ds(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function vs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,Ss,3,3,"td",23),S(4,ys,3,3,"td",23),S(5,Ds,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function ws(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,fs,2,0,"th",19),S(7,xs,2,0,"th",20),S(8,hs,2,0,"th",21),a()(),n(9,"tbody",22),G(10,vs,6,4,"tr",null,j),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Jn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Nt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,gs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,Cs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ws,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ss)),o(3),c("routerLink",M(13,cs)),o(3),c("routerLink",M(14,ds)),o(3),c("routerLink",M(15,us)),o(3),c("routerLink",M(16,_s)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z,te],encapsulation:2})};var Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Es=()=>["/menu/Contacts/Contact/Suppliers/Info"],Ms=i=>({ID:i}),Vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function Bs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Os(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Ls(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,Es))("queryParams",X(20,Ms,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Kr))("queryParams",_t(23,Vs,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function Rs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function ks(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Ls,17,27,"tr",24,j),a(),S(17,Rs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Os,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,ks,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Kr)),o(3),c("routerLink",M(13,Ts)),o(3),c("routerLink",M(14,Ps)),o(3),c("routerLink",M(15,Fs)),o(3),c("routerLink",M(16,Is)),o(3),c("routerLink",M(17,bs)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,k,pe,Ce,Ue,U,re,Z,te],encapsulation:2})};var Xr=Zt(Ei());var Ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],As=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],js=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),qs=i=>[i],Us=i=>({ID:i}),zs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Jr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Ks=(i,s,e)=>({VariantID:i,From:s,To:e}),Xs=(i,s,e)=>({ProductID:i,From:s,To:e});function Js(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",dn(1,js,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function Zs(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function $s(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function e0(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function t0(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function i0(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function n0(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function a0(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function o0(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function r0(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function l0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function p0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function m0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function s0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),h("ngModelChange",function(t){u(e);let l=m().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function c0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,ln)}}function d0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function u0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Yo(4,zs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function g0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function C0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function f0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Ks,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function x0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Xs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function h0(i,s){if(i&1&&(n(0,"td",75),E(1,f0,5,16,"a",78)(2,x0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function S0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function D0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function v0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function w0(i,s){if(i&1&&(n(0,"tr",60),E(1,s0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,c0,2,1,"ng-container",8)(8,d0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,u0,4,11,"td",67)(15,_0,3,3,"td",67)(16,g0,3,3,"td",68)(17,C0,3,3,"td",67)(18,h0,3,2,"td",67)(19,S0,3,3,"td",69)(20,y0,3,3,"td",67)(21,D0,3,4,"td",70)(22,v0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,qs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Us,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function T0(i,s){i&1&&b(0,"td",75)}function P0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function F0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function b0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function E0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function M0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function V0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function B0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function O0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function L0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function R0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,T0,1,0,"td",67)(4,P0,2,0,"td",67)(5,F0,4,6,"td",67)(6,I0,4,6,"td",67)(7,b0,4,6,"td",68)(8,E0,4,6,"td",67)(9,M0,5,6,"td",82)(10,V0,5,6,"td",69)(11,B0,5,6,"td",82)(12,O0,5,10,"td",70)(13,L0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function k0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,e0,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,t0,2,1,"th",37)(12,i0,2,0,"th",38)(13,n0,2,0,"th",39)(14,a0,2,0,"th",40)(15,o0,2,1,"th",41)(16,r0,2,0,"th",42)(17,l0,2,1,"th",43)(18,p0,2,0,"th",44)(19,m0,2,0,"th",45),a()(),n(20,"tbody"),E(21,w0,23,21,"tr",46),a(),E(22,R0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var $n=class i extends De{constructor(e,r,t,l,C,T,$e){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=$e}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Fe(Y);columnService=Fe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(tt({},this.data),{Data:e.Data.map(t=>nt(tt({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(tt({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(tt({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(tt({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Ki.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(tt({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Xr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(qe),w(We),w(z),w(Gn))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Js,3,7,"a",2),S(3,Zs,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,$s,45,36,"ng-template",null,0,O),a(),E(29,k0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Ns)),o(3),c("routerLink",M(15,As)),o(3),c("routerLink",M(16,Gs)),o(3),c("routerLink",M(17,Hs)),o(3),c("routerLink",M(18,Qs)),o(3),c("routerLink",M(19,Ys)),o(5),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,er,L,k,ae,pe,Ce,Te,Ne,fe,U,ze,oi,se,re,Z,te],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var N0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],A0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],G0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],H0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Q0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],j0=i=>({ID:i}),q0=(i,s)=>s.Name,U0=(i,s)=>s.ID;function z0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function K0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function X0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&Ut("text-align","right")}function J0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&Ut("text-align","right")}function Z0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&Ut("text-align","right")}function $0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function ec(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function tc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),F(e.Code)}}function ic(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function nc(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function ac(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function oc(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function rc(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,tc,2,3,"td",33),S(5,ic,3,5,"td",33),S(6,nc,3,5,"td",33),G(7,ac,2,1,"td",14,ji),S(9,oc,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,j0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,z0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,K0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,X0,2,2,"th",11),S(36,J0,2,2,"th",12),S(37,Z0,2,2,"th",12),G(38,$0,2,3,"th",13,q0),S(40,ec,2,0,"th",14),a()(),n(41,"tbody"),G(42,rc,10,9,"tr",15,U0),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,N0)),o(3),c("routerLink",M(17,A0)),o(3),c("routerLink",M(18,G0)),o(3),c("routerLink",M(19,H0)),o(3),c("routerLink",M(20,Q0)),o(3),c("routerLink",M(21,Y0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,fe,U,ze,Bi,Z],encapsulation:2})};var yo=Zt(Ei());var lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],sc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],cc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],dc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Zr=()=>({standalone:!0}),$r=()=>({overflow:"visible"}),uc=i=>[i],_c=i=>({ID:i});function gc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function Cc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Zr))("contentStyle",M(19,$r))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Zr))("contentStyle",M(21,$r))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function fc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function xc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function hc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function Sc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function yc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function Dc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,uc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,_c,e.ID)),o(),D(" ",e.Name," ")}}function vc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function Pc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Fc(i,s){if(i&1&&(n(0,"tr"),S(1,Dc,3,7,"td"),S(2,vc,2,1,"td"),S(3,wc,4,4,"td",29),E(4,Tc,3,4,"td",30),S(5,Pc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function Ic(i,s){i&1&&b(0,"td")}function bc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function Ec(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Mc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Bc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,Ic,1,0,"td"),S(3,bc,2,0,"td",29),S(4,Ec,3,4,"td",29),E(5,Mc,3,4,"td",30),S(6,Vc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),$e=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,$e)}_toastrService=Fe(qe);columnService=Fe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,yo.default)(this.pageData.Filter.MonthFrom),r=(0,yo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,gc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Cc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,fc,2,0,"th",11),S(34,xc,2,0,"th",12),S(35,hc,3,0,"th",13),E(36,Sc,2,1,"th",14),S(37,yc,3,0,"th",13),a()(),n(38,"tbody"),E(39,Fc,6,5,"tr",15),a(),E(40,Bc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,lc)),o(3),c("routerLink",M(20,pc)),o(3),c("routerLink",M(21,mc)),o(3),c("routerLink",M(22,sc)),o(3),c("routerLink",M(23,cc)),o(3),c("routerLink",M(24,dc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,k,ae,pe,Ce,Te,fe,U,Ir,se,ne],encapsulation:2})};var Oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],kc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Wc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ac=i=>[i],Gc=i=>({ID:i});function Hc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Qc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Yc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function jc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Yc,2,1,"th",22,j),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function qc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Uc(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Ac,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Gc,r[1])),o(),F(r[e])}}function zc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Kc(i,s){if(i&1&&(n(0,"td",11),S(1,Uc,2,7,"a",23)(2,zc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Xc(i,s){if(i&1&&(n(0,"tr",11),G(1,Kc,3,1,"td",11,j),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Hc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Qc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,jc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,qc,2,1,"th",12,j),a()(),n(40,"tbody"),G(41,Xc,3,0,"tr",11,j),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Oc)),o(3),c("routerLink",M(13,Lc)),o(3),c("routerLink",M(14,Rc)),o(3),c("routerLink",M(15,kc)),o(3),c("routerLink",M(16,Wc)),o(3),c("routerLink",M(17,Nc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,k,Te,fe,U],encapsulation:2})};var Jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Zc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],$c=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],ed=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),el=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],td=(i,s,e)=>({CategoryID:i,From:s,To:e}),id=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],tl=i=>({CategoryID:i});function nd(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ad(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function od(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,ad,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function rd(i,s){i&1&&(n(0,"th",42),p(1," Cost "),b(2,"p-treeTableSortIcon",43),a())}function ld(i,s){i&1&&(n(0,"th",44),p(1," Profit "),b(2,"p-treeTableSortIcon",45),a())}function pd(i,s){i&1&&(n(0,"th",46),p(1," % "),b(2,"p-treeTableSortIcon",47),a())}function md(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),b(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),b(6,"p-treeTableSortIcon",32),a(),E(7,rd,3,0,"th",33),n(8,"th",34),p(9," Gross "),b(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),b(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),b(16,"p-treeTableSortIcon",39),a(),E(17,ld,3,0,"th",40)(18,pd,3,0,"th",41),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function sd(i,s){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function cd(i,s){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function dd(i,s){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function ud(i,s){if(i&1&&(n(0,"td"),E(1,dd,5,11,"span",58),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function _d(i,s){if(i&1&&(n(0,"tr",48)(1,"td"),b(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,sd,6,9,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),E(33,cd,6,9,"td",55)(34,ud,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,el))("queryParams",_t(55,td,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,id))("queryParams",X(60,tl,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,el))("queryParams",X(63,tl,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function gd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Cd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function fd(i,s){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function xd(i,s){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),E(6,gd,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),E(17,Cd,3,3,"td",61)(18,fd,3,3,"td",63),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function hd(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),E(3,md,19,3,"ng-template",25)(4,_d,35,65,"ng-template",26)(5,xd,19,15,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,ed))}}var na=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,nd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,od,29,15,"ng-template",null,0,O),a(),E(19,hd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Jc)),o(3),c("routerLink",M(11,Zc)),o(3),c("routerLink",M(12,$c)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,k,ae,Te,Ne,Er,hn,Or,Mr,Vr,Br,fe,U,ze,Bn,ne,re,Z,te],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var Sd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],yd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function vd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function Td(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function Pd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Fd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function Id(i,s){if(i&1&&(n(0,"td"),S(1,Pd,2,1,"span"),S(2,Fd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function bd(i,s){if(i&1&&(n(0,"tr"),G(1,Id,3,2,"td",null,j),a()),i&2){let e=s.$implicit;o(),H(e)}}function Ed(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function Md(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,Ed,3,3,"td",null,j),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Vd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,Td,2,2,"th",19,j),a()(),n(6,"tbody"),G(7,bd,3,0,"tr",null,j),a(),S(9,Md,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var aa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let $e=t.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value,Ai=l.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare($e,Ai,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,wd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Vd,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,Sd)),o(3),c("routerLink",M(11,yd)),o(3),c("routerLink",M(12,Dd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,k,pe,Ce,Ne,fe,U,Z],encapsulation:2})};var Bd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Od=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Ld=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Rd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function kd(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var oa=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(R))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Rd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,kd,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Bd)),o(3),c("routerLink",M(9,Od)),o(3),c("routerLink",M(10,Ld)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,k,ri],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Ad(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var ra=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Nd,13,9,"ng-template",null,0,O),a(),S(8,Ad,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Wd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,k,ri,Mt,U],encapsulation:2})};function Gd(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Hd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Yd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Qd,16,15,"tr",null,j),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var la=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gd,3,0,"a",2),a(),n(3,"filters"),E(4,Hd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Yd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,k,U,se,ne,Z],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function qd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ud(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function zd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Kd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Xd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Kd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Jd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var pa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,qd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ud,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,zd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Xd,21,21,"tr",null,j),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Jd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,jd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,k,U,se,hr,ne,Z,te],encapsulation:2})};var Zd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],vo=(i,s)=>({From:i,To:s}),$d=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],eu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function tu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function iu(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ma=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(R),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),h("filterChange",function(C){return u(t),x(r.pageData.Filter,C)||(r.pageData.Filter=C),_(C)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,tu,13,11,"ng-template",null,0,O),a(),S(18,iu,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",M(11,Zd))("queryParams",ue(12,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,$d))("queryParams",ue(16,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,eu))("queryParams",ue(20,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,k,Mt,Ht,fe,U],encapsulation:2})};var ru={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ci=class i{date;dateChange=new pn;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[hi([{provide:vn,useClass:An,deps:[Dn,Fr]},{provide:wn,useValue:ru}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(C){return u(t),_(r.onDateChange(C.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Dt(4);return _(r.setMonthAndYear(C,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);Ut("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[Gt,En,wi,Fn,In,bn,Ti,Vn,Pn,Tn,Mn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{a as ri,b as Gr}from"./chunk-RNXOIUIO.js";import{a as Yr}from"./chunk-ZZV5IAED.js";import{a as Mt,b as Hr}from"./chunk-AQQHMGYE.js";import{a as Ht,b as Qr}from"./chunk-7EQG6N5Y.js";import{a as Hn,b as Oi}from"./chunk-GDRHD33K.js";import{a as oi}from"./chunk-2MQDNPCG.js";import{a as De}from"./chunk-HDN67LOA.js";import{a as ze}from"./chunk-LBQRCFLJ.js";import{a as Gn}from"./chunk-3PC6CTVP.js";import{a as gt}from"./chunk-2LOWEWI4.js";import{a as cr}from"./chunk-ZEKZLSGA.js";import{b as gr}from"./chunk-KEAT6AT3.js";import"./chunk-WH2BY5K4.js";import{a as Bi}from"./chunk-RLEDN77K.js";import"./chunk-6H5P35AP.js";import{a as Ar}from"./chunk-DLNZDHGS.js";import{a as Rr,b as kr,d as Wr,g as Nr}from"./chunk-RF5WGONA.js";import"./chunk-BYXBJQAS.js";import{a as Vi}from"./chunk-R4OHTTCT.js";import{a as Ir,b as br}from"./chunk-QIJEAKQK.js";import"./chunk-QEOGHVXA.js";import"./chunk-4HCSE44G.js";import{e as _r}from"./chunk-INHUUGSI.js";import{a as Er,b as Mr,c as Vr,d as Br,e as Or,f as Lr}from"./chunk-XQYDL5EE.js";import"./chunk-KHR4NBM3.js";import"./chunk-Y44UA7DO.js";import"./chunk-H7XFYY6V.js";import"./chunk-XACC6EMJ.js";import{a as te}from"./chunk-HL3ONSX6.js";import{a as Z}from"./chunk-XA4TVPAS.js";import"./chunk-Q2A4MYK3.js";import{a as Ei,b as Fr,c as An,d as J,e as Mi}from"./chunk-SO4GMA3Y.js";import{a as Vn,b as Ti}from"./chunk-PECGNYTX.js";import"./chunk-3RK6DDJD.js";import{a as Mn}from"./chunk-SARJJ3AZ.js";import{a as Dn,b as vn,c as wn,f as Fn,g as In,h as bn,p as wi,q as En}from"./chunk-DC426G2P.js";import"./chunk-3KSZCJ6T.js";import"./chunk-BYO7FJ4O.js";import"./chunk-CBSYYTXQ.js";import{c as ur,d as Te,e as Nn}from"./chunk-6WEGHV7F.js";import"./chunk-G4IW5GPY.js";import{a as Pi}from"./chunk-VKOITLMF.js";import{a as pe,b as Ce,c as sr}from"./chunk-APOV2ZYY.js";import{a as Et,b as Pr}from"./chunk-I3ABVEQL.js";import{d as vr,f as fe}from"./chunk-MSD7SYVM.js";import{a as wr,b as Tr,c as U}from"./chunk-RYPGBCMP.js";import{b as K}from"./chunk-KD7WBOUR.js";import{a as me}from"./chunk-AHH7WWRR.js";import{a as mr}from"./chunk-BUFSWKBD.js";import"./chunk-QFON23YX.js";import"./chunk-FIUZN6JU.js";import{a as q}from"./chunk-4QM23MMO.js";import{e as A,f as bi}from"./chunk-EYMK2IFW.js";import"./chunk-UKIZOGIH.js";import"./chunk-JEL3OND6.js";import"./chunk-IDQUQBKL.js";import{c as Cr}from"./chunk-YRGHPSPV.js";import"./chunk-VYQEM4T2.js";import"./chunk-UTAQ3FRE.js";import"./chunk-M43HNBJQ.js";import{a as fr,c as Ue}from"./chunk-KKLNFVVN.js";import"./chunk-X57HWGVJ.js";import"./chunk-5SFUSWFY.js";import"./chunk-534MIVWD.js";import"./chunk-TGEQUV6Z.js";import{d as Dr}from"./chunk-VHMJLWN2.js";import{b as N}from"./chunk-ZZ4DKVU3.js";import"./chunk-CS6HBROS.js";import"./chunk-JUS6LLVX.js";import{C as kn,F as Ne,G as Wn,j as Tn,m as Pn,t as dr,u as Fi,v as ni,w as On}from"./chunk-QZMZBCE7.js";import{b as ae,c as yn}from"./chunk-C4WJKF7R.js";import{A as Rn,B as Sr,C as ai,K as Ii,N as yr,g as se,o as xr,s as Ln,z as hr}from"./chunk-NZYZO47Z.js";import{a as Bn,d as $}from"./chunk-7TBS7SPQ.js";import"./chunk-RLQLFW36.js";import"./chunk-EQLHPWVB.js";import{b as xn,e as ti,f as ii,g as z}from"./chunk-A45GTZVV.js";import"./chunk-NWSIPELM.js";import{a as rr}from"./chunk-6SGN7MNX.js";import{c as or,j as lr,k as Xi,l as pr}from"./chunk-L76WVZW6.js";import{a as Ki}from"./chunk-2FWFPV5I.js";import{oa as hn,pa as Sn,xa as ar}from"./chunk-O5SLP4JK.js";import{F as Gt,G as fn,a as $o,b as er,c as Qe,h as L,l as tr,o as k,q as ir,s as nr}from"./chunk-RNLSEEMX.js";import"./chunk-E4W726L4.js";import"./chunk-J5QXJ7YA.js";import{a as V,d as Y}from"./chunk-USJ6ILEE.js";import"./chunk-CJAXFMGW.js";import{$b as Ut,$d as zi,Ab as G,Bb as H,Bc as d,Ca as dt,Cb as c,Cc as g,Db as n,Dc as v,E as mi,Eb as a,Ec as Si,Ed as Zo,Fb as b,Hc as O,I as Yi,Ia as fo,Ja as No,Jb as pt,Jc as jo,K as Lo,Kb as mt,Kc as yi,Lb as Ho,Lc as un,M as Ro,Ma as Ao,Mb as I,Ob as P,Oc as qo,Pc as Di,Q as an,Qa as Ee,Qb as m,Sa as ln,Tb as xo,Tc as _n,Ub as cn,Vb as fi,Vc as Uo,Wb as xi,Wd as We,Xa as o,Xc as ho,Y as Nt,Ya as pn,Yc as zo,Yd as Cn,Zc as Ko,Zd as Q,_b as Dt,aa as Co,ac as qi,bc as Qo,be as qe,cc as Ui,cd as Ze,db as w,dc as p,ec as F,ed as st,ee as R,fa as At,fc as D,fd as it,gc as ei,hb as B,ib as Ci,ic as f,jb as mn,jc as x,jd as Xo,ka as ko,kc as h,kd as gn,la as on,lb as W,ma as gi,mb as sn,md as re,na as $t,nb as E,o as _i,oc as Ct,od as ne,pa as Fe,rd as vi,sc as hi,t as qt,ta as u,tb as si,tc as M,td as Jo,u as go,ua as _,uc as X,vb as S,vc as ue,wb as Go,wc as _t,xa as rn,xb as y,xc as zt,yb as ji,yc as dn,za as Wo,zb as j,zc as Yo}from"./chunk-JYZTRN6N.js";import"./chunk-WFMAM73Y.js";import{a as tt,b as nt,f as Ql,h as Zt,k as Qi}from"./chunk-SNAKHGZS.js";var bo=Ql((Ji,Io)=>{(function(i,s){typeof Ji=="object"&&typeof Io=="object"?Io.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Ji=="object"?Ji["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Ji:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var oe=r[ye];if(oe!==void 0)return oe.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var oe=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(oe,{a:oe}),oe},t.d=(ye,oe)=>{for(var Ve in oe)t.o(oe,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:oe[Ve]})},t.o=(ye,oe)=>Object.prototype.hasOwnProperty.call(ye,oe);var l={};t.d(l,{default:()=>Hl});var C=t(944),T=t.n(C),$e=t(984),Ai=t.n($e);let Gi={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function $i(ye,oe,Ve,he,at,Ge){let ee=(Ge-oe)*(Ve-ye)-(he-oe)*(at-ye);return ee>0||!(ee<0)}function en(ye,oe,Ve,he,at,Ge,ee,Le){return $i(ye,oe,at,Ge,ee,Le)!==$i(Ve,he,at,Ge,ee,Le)&&$i(ye,oe,Ve,he,at,Ge)!==$i(ye,oe,Ve,he,ee,Le)}let{animObject:_o}=T(),{format:Ol}=Ai(),{setOptions:Ll}=T(),{composed:Rl}=T(),{boxIntersectLine:Eo,intersectRect:kl}={boxIntersectLine:function(ye,oe,Ve,he,at,Ge,ee,Le){return en(ye,oe,ye+Ve,oe,at,Ge,ee,Le)||en(ye+Ve,oe,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe+he,ye+Ve,oe+he,at,Ge,ee,Le)||en(ye,oe,ye,oe+he,at,Ge,ee,Le)},intersectRect:function(ye,oe){return!(oe.left>ye.right||oe.right<ye.left||oe.top>ye.bottom||oe.bottom<ye.top)}},{addEvent:Mo,extend:Vo,fireEvent:Wl,isNumber:tn,pick:Kt,pushUnique:Nl,syncTimeout:Al}=T();function di(ye,oe,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=Kt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Xt,It,et,Be;for(et=0;ct&&et<ct.length;et+=1)if(kl(ct[et],{left:oe,right:oe+he.width,top:Ve,bottom:Ve+he.height}))return!1;for(et=0;et<Ge.series.length;et+=1){let ut=Ge.series[et],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=oe-16&&Re[Be-1].chartX<=oe+he.width+16){if(Eo(oe,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Eo(oe-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Xt=oe+he.width/2-Re[Be].chartX)*Xt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(oe+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(oe+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(oe-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:oe,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Bo(ye){if(this.renderer){let oe=this,Ve=_o(oe.renderer.globalAnimation).duration;oe.labelSeries=[],oe.labelSeriesMaxSum=0,oe.seriesLabelTimer&&T().clearTimeout(oe.seriesLabelTimer),oe.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&oe.labelSeries&&(oe.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),oe.labelSeriesMaxSum=Math.max(oe.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,_o(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),oe.seriesLabelTimer=Al(function(){oe.series&&oe.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Xt=[],It=Ke.graph||Ke.area,et=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Hi=Be?Re.len:ut.len,ht=Kt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Jt=Be?"chartCenterX":"chartCenterY";function pi(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Xt.push(lt))}if(Ke.getPointSpline&&et&&et.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=et.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=et.getPointAtLength(ct),Rt=Be?Hi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;pi({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();pi({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(tn(Lt)&&tn(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Hi-((kt||yt.plotY||0)+Kt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+Kt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)pi({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Jt]:(lt[Jt]||0)+((bt[Jt]||0)-(lt[Jt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});pi(bt),lt=bt}}}return Xt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+Kt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Xt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,et=ee.interpolatedPoints,Be=Kt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Hi,ht,je,Tt=ee.labelBySeries,Jt,pi,lt;function yt(Yt,Wt,jt){let nn=Math.max(ft,Kt(pi,-1/0)),ui=Math.min(ft+Xt,Kt(lt,1/0));return Yt>nn&&Yt<=ui-jt.width&&Wt>=xt&&Wt<=xt+It-jt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Jt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],pi=Math.min.apply(Math,Jt),lt=Math.max.apply(Math,Jt)),ee.visible&&!ee.boosted&&et){if(!Tt){var Rt,kt,bt;let Yt=ee.name;if(typeof Le.format=="string"?Yt=Ol(Le.format,ee,he):Le.formatter&&(Yt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Yt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(Vo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=et.length-1;ht>0;ht-=1)Be?yt(ot=(et[ht].chartCenterX??et[ht].chartX)-Je.width/2,wt=(et[ht].chartCenterY??et[ht].chartY)-Je.height/2,Je)&&(je=di(ee,ot,wt,Je)):(yt(ot=et[ht].chartX+3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX+3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY+3,Je)&&(je=di(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=et[ht].chartX-Je.width-3,wt=et[ht].chartY-Je.height-3,Je)&&(je=di(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Xt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Hi=di(ee,ot,wt,Je,!0))&&ut.push(Hi);if(ut.length){ut.sort((Wt,jt)=>jt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Yt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Yt&&ee.labelBySeries){let Wt,jt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},nn={opacity:1};Yt<=10&&(nn={x:jt.x,y:jt.y},jt={}),ct&&(Wt=_o(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(Vo(jt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(nn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let ui=ee.searchPoint({chartX:je.x,chartY:je.y},!0);ui&&(Tt.closest=[ui,je.x-(ui.plotX||0),je.y-(ui.plotY||0)])}}else Lt()}else Lt()}),Wl(he,"afterDrawSeriesLabels")})(oe)},oe.renderer.forExport||!Ve?0:Ve)}}function Gl(ye,oe,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return tn(Ge)&&tn(ee)&&(Le=[["M",Ge,ee]],(Ke=oe-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>oe+he?Le.push(["L",ye+ct,oe+he]):ee<oe?Le.push(["L",ye+ct,oe]):Ge<ye?Le.push(["L",ye,oe+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,oe+he/2])),Le||[]}let Oo=T();({compose:function(ye,oe){Nl(Rl,"SeriesLabel")&&(Mo(ye,"load",Bo),Mo(ye,"redraw",Bo),oe.prototype.symbols.connector=Gl,Ll({plotOptions:{series:{label:Gi}}}))}}).compose(Oo.Chart,Oo.SVGRenderer);let Hl=T();return l.default})())});var jr=(i,s)=>({"text-success":i,"text-danger":s});function Yl(i,s){i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2&&(o(),D(" ",v(2,1,s.Quantity,"1.0-0")," "))}function jl(i,s){if(i&1){let e=I();n(0,"span",5),P("click",function(){u(e);let t=m(2);return _(t.loadComplementaryQuantity())}),b(1,"i",6),a()}}function ql(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Cost "),a()(),n(4,"td")(5,"span",4),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",4),p(10),d(11,"number"),a()()()),i&2){let e=m();o(6),D(" ",g(7,2,e.Cost)," "),o(4),D(" ",v(11,4,e.CostRatio,"1.0-2"),"% ")}}function Ul(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"span",3),p(3," Profit "),a()(),n(4,"td")(5,"span",7),p(6),d(7,"amountFraction"),a()(),n(8,"td")(9,"span",8),p(10),d(11,"number"),a()()()),i&2){let e=m();o(5),c("ngClass",ue(9,jr,e.Profit>0,e.Profit<0)),o(),D(" ",g(7,4,e.Profit)," "),o(3),c("ngClass",ue(12,jr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),D("",v(11,6,e.ProfitRatio,"1.0-2"),"%")}}function zl(i,s){if(i&1&&(n(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"span",3),p(5,"Orders"),a()(),n(6,"td"),p(7),d(8,"number"),a(),b(9,"td"),a(),n(10,"tr")(11,"td")(12,"span",3),p(13," Quantity "),a()(),n(14,"td"),p(15),d(16,"quantityFraction"),a(),b(17,"td"),a(),n(18,"tr")(19,"td")(20,"span",3),p(21," Complementary "),a()(),n(22,"td"),S(23,Yl,3,4,"span"),d(24,"async"),Go(25,jl,2,0,"span"),a(),b(26,"td"),a(),n(27,"tr")(28,"td")(29,"span",3),p(30," Gross Sales "),a()(),n(31,"td"),p(32),d(33,"amountFraction"),a(),b(34,"td"),a(),n(35,"tr")(36,"td")(37,"span",3),p(38," Discount "),a()(),n(39,"td")(40,"span",4),p(41),d(42,"amountFraction"),a()(),n(43,"td")(44,"span",4),p(45),d(46,"number"),a()()(),n(47,"tr")(48,"td")(49,"span",3),p(50," Sales "),a()(),n(51,"td"),p(52),d(53,"amountFraction"),a(),b(54,"td"),a(),n(55,"tr")(56,"td")(57,"span",3),p(58," Tax "),a()(),n(59,"td"),p(60),d(61,"amountFraction"),a(),b(62,"td"),a(),n(63,"tr")(64,"td")(65,"span",3),p(66," Sales + Tax "),a()(),n(67,"td"),p(68),d(69,"amountFraction"),a(),b(70,"td"),a(),S(71,ql,12,7,"tr"),S(72,Ul,12,15,"tr"),a()()),i&2){let e,r=s,t=m();o(7),F(g(8,11,r.Orders)),o(8),F(g(16,13,r.Quantity)),o(8),y((e=g(24,15,t.complementaryQuantity$))?23:25,e),o(9),F(g(33,17,r.GrossSales)),o(9),D(" ",g(42,19,r.Discount)," "),o(4),D(" ",v(46,21,r.DiscountRatio,"1.0-2"),"% "),o(7),F(g(53,24,r.Sales)),o(8),F(g(61,26,r.Tax)),o(8),F(g(69,28,r.SalesWithTax)),o(3),y(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?71:-1),o(),y(t.roleService.report.Profit?72:-1)}}var Qn=class i{constructor(s,e,r,t){this.httpService=s;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(qt(s=>(s.ProfitRatio=this.profitRatioCalculation(s.Profit,s.Sales,s.Tax),s.CostRatio=this.costRatioCalculation(s.Cost,s.Sales,s.Tax),s.DiscountRatio=this.discountPercentageCalc(s.Discount,s.GrossSales,s.Tax),s))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Fi,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}profitRatioCalculation(s,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=s/e*100),t}discountPercentageCalc(s=0,e=0,r=0){return s/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Nt())}static \u0275fac=function(e){return new(e||i)(w(R),w(Y),w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[[3,"onClose","config"],[1,"p-3"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){if(e&1&&(n(0,"modal-material",0),P("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),S(3,zl,73,30,"table",2),d(4,"async"),a()()()),e&2){let t;c("config",r.modalConfig),o(3),y((t=g(4,2,r.reportSummary$))?3:-1,t)}},dependencies:[Ze,ni,gn,ne,Z,te],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var Kl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],qr=i=>({ID:i});function Xl(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Jl(i,s){if(i&1&&(n(0,"div",2),S(1,Xl,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function Zl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function $l(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function ep(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function tp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function ip(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function np(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function ap(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function op(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function rp(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function lp(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function pp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function mp(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function sp(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,pp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,mp,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function cp(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function dp(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,ep,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,tp,3,4,"span"),a(),S(17,ip,3,3,"span",46),S(18,np,2,1,"i",49),S(19,ap,2,1,"span",50),S(20,op,2,0,"span"),a(),S(21,rp,2,3,"div",51),S(22,lp,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,sp,27,19,"tr",55,j),a()(),n(29,"table",56),G(30,cp,8,5,"tr",null,j),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Kl))("queryParams",X(22,qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function up(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function _p(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function gp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function Cp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,$l,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,dp,32,24,"div",null,j),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,up,3,0,"span",40),S(35,_p,3,3,"span"),p(36),a()(),S(37,gp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),si("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Yn=class i extends De{constructor(e,r,t,l,C,T,$e,Ai){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=$e;this.roleService=Ai}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Qn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(We),w(z),w(qe),w(Y))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Jl,2,1,"div",2),a(),n(3,"filters"),E(4,Zl,46,26,"ng-template",null,0,O),a(),S(6,Cp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,U,ze,xr,Ln,ne,re,Z,te],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var jn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Fi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,k,Ue,ni],encapsulation:2})};var xp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ur=i=>({ID:i}),hp=()=>["/menu/Contacts/Contact/Customers/Info"],Sp=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function yp(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Dp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),h("timeChange",function(t){u(e);let l=m(2);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),f("date",e.pageData.Filter.From),o(2),f("time",e.timeFrom),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.timeTo)}}function vp(i,s){if(i&1){let e=I();n(0,"datepicker",26),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),h("dateChange",function(t){u(e);let l=m(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);f("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),f("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function wp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,Dp,11,4,"ng-container",13)(19,vp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),f("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),f("ngModel",r.pageData.Filter.SalesID),o(3),f("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),f("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),f("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),f("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),f("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),f("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",r.pageData.Filter.RowCount)}}function Tp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Pp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Fp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function Ip(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function bp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Ep(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function Mp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Vp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Bp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Op(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Lp(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function Rp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function kp(i,s){i&1&&b(0,"br")}function Wp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Np(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Ap(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,hp))("queryParams",X(4,Ur,e.CustomerID)),o(),F(e.CustomerName)}}function Gp(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Hp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Qp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Yp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function qp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Up(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function zp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Kp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Xp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,Sp,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Jp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,kp,1,0,"br",4)(7,Wp,2,1,"i",4),a(),E(8,Np,7,8,"td",4)(9,Ap,3,6,"td",4),S(10,Gp,3,4,"td"),S(11,Hp,2,1,"td"),E(12,Qp,2,1,"td",4)(13,Yp,3,3,"td",68)(14,jp,3,3,"td",69)(15,qp,3,3,"td",69)(16,Up,3,3,"td",70)(17,zp,3,3,"td",69)(18,Kp,3,3,"td",69)(19,Xp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,xp))("queryParams",X(19,Ur,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Zp(i,s){i&1&&b(0,"td",79)}function $p(i,s){i&1&&b(0,"td",79)}function em(i,s){i&1&&b(0,"td",79)}function tm(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function im(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function nm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function am(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function om(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function rm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function lm(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function pm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,Zp,1,0,"td",80)(4,$p,1,0,"td",80)(5,em,1,0,"td",80)(6,tm,2,0,"td",81)(7,im,4,6,"td",68)(8,nm,4,6,"td",69)(9,am,4,6,"td",69)(10,om,4,6,"td",70)(11,rm,4,6,"td",69)(12,lm,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function mm(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),E(8,Tp,2,0,"th",43)(9,Pp,2,0,"th",44),S(10,Fp,2,0,"th",45),S(11,Ip,2,0,"th",46),E(12,bp,2,0,"th",47)(13,Ep,2,0,"th",48)(14,Mp,2,0,"th",49)(15,Vp,2,0,"th",50)(16,Bp,2,0,"th",51)(17,Op,2,0,"th",52)(18,Lp,2,0,"th",53)(19,Rp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Jp,20,21,"tr",55),a(),E(22,pm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function sm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function cm(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dm(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function um(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function _m(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,mm,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,sm,3,0,"span",34)(9,cm,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,dm,3,0,"a",36)(13,um,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var qn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(jn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,yp,3,0,"button",3),a(),n(3,"filters"),E(4,wp,36,22,"ng-template",null,0,O),a(),E(6,_m,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,Te,Ne,Vi,U,ze,se,ne,re,Z],encapsulation:2})};var gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],fm=()=>["/menu/Products/Setup/Brand/Brand_Form"],xm=i=>({ID:i}),hm=(i,s)=>({BrandID:i,Name:s});function Sm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function ym(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Dm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function vm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,vm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,fm))("queryParams",X(12,xm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",ue(14,hm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Tm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,Dm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,wm,12,17,"tr",null,j),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var Un=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(We),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Sm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,ym,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Tm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,gm)),o(3),c("routerLink",M(9,Cm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,k,ae,pe,Ce,U,se,Z,te],encapsulation:2})};function Pm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var zn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(ti),w(ii))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,Pm,4,3,"label",null,j),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[ni],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Vm=()=>["/menu/Contacts/Contact/Customers/Info"],Bm=i=>({ID:i});function Om(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Lm(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Rm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function km(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Wm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Nm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Am(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Gm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Hm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Qm(i,s){if(i&1&&(n(0,"span"),G(1,Hm,5,2,"span",null,j),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Ym(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function jm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Um(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Km(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Xm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Jm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Qm,3,0,"span"),S(6,Ym,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,jm,3,3,"td",34),S(11,qm,3,3,"td",34),S(12,Um,3,3,"td",35),S(13,zm,3,3,"td",34),S(14,Km,3,3,"td",36),S(15,Xm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Vm))("queryParams",X(14,Bm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function Zm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Jm,16,16,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function $m(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,Rm,2,0,"th",22),S(10,km,2,0,"th",23),S(11,Wm,2,0,"th",24),S(12,Nm,2,0,"th",25),S(13,Am,2,0,"th",26),S(14,Gm,2,0,"th",27),a()(),S(15,Zm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=kn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Nt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(zn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(re),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Om,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Lm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,$m,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fm)),o(3),c("routerLink",M(13,Im)),o(3),c("routerLink",M(14,bm)),o(3),c("routerLink",M(15,Em)),o(4),c("routerLink",M(16,Mm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,k,ae,pe,Ce,Ue,U,oi,ne,Z,te],encapsulation:2})};var es=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function os(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function rs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function ls(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ps(i,s){if(i&1&&(n(0,"tbody",22),G(1,ls,12,10,"tr",null,j),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function ms(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ps,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,os,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,rs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ms,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,es)),o(3),c("routerLink",M(12,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z],encapsulation:2})};var ss=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],cs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ds=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],us=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],_s=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function gs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Cs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function fs(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function xs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function hs(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function Ss(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function ys(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function Ds(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function vs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,Ss,3,3,"td",23),S(4,ys,3,3,"td",23),S(5,Ds,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function ws(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,fs,2,0,"th",19),S(7,xs,2,0,"th",20),S(8,hs,2,0,"th",21),a()(),n(9,"tbody",22),G(10,vs,6,4,"tr",null,j),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Jn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Fe(Y);columnService=Fe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Nt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(re))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,gs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,Cs,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,ws,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ss)),o(3),c("routerLink",M(13,cs)),o(3),c("routerLink",M(14,ds)),o(3),c("routerLink",M(15,us)),o(3),c("routerLink",M(16,_s)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,k,pe,Ce,U,ne,Z,te],encapsulation:2})};var Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Es=()=>["/menu/Contacts/Contact/Suppliers/Info"],Ms=i=>({ID:i}),Vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function Bs(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Os(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Ls(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,Es))("queryParams",X(20,Ms,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Kr))("queryParams",_t(23,Vs,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function Rs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function ks(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Ls,17,27,"tr",24,j),a(),S(17,Rs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Os,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,ks,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Kr)),o(3),c("routerLink",M(13,Ts)),o(3),c("routerLink",M(14,Ps)),o(3),c("routerLink",M(15,Fs)),o(3),c("routerLink",M(16,Is)),o(3),c("routerLink",M(17,bs)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,k,pe,Ce,Ue,U,re,Z,te],encapsulation:2})};var Xr=Zt(Ei());var Ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],As=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],js=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),qs=i=>[i],Us=i=>({ID:i}),zs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Jr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Ks=(i,s,e)=>({VariantID:i,From:s,To:e}),Xs=(i,s,e)=>({ProductID:i,From:s,To:e});function Js(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",dn(1,js,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function Zs(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function $s(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),f("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),f("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),f("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),f("ngModel",e.pageData.Filter.TagID),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),f("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),f("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),f("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),f("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function e0(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function t0(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function i0(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function n0(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function a0(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function o0(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function r0(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function l0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function p0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function m0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function s0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),h("ngModelChange",function(t){u(e);let l=m().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),f("ngModel",e.checked)}}function c0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,ln)}}function d0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function u0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Yo(4,zs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),F(g(3,2,r.Quantity))}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function g0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function C0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function f0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Ks,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function x0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Jr))("queryParams",_t(12,Xs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function h0(i,s){if(i&1&&(n(0,"td",75),E(1,f0,5,16,"a",78)(2,x0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function S0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function D0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function v0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function w0(i,s){if(i&1&&(n(0,"tr",60),E(1,s0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,c0,2,1,"ng-container",8)(8,d0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,u0,4,11,"td",67)(15,_0,3,3,"td",67)(16,g0,3,3,"td",68)(17,C0,3,3,"td",67)(18,h0,3,2,"td",67)(19,S0,3,3,"td",69)(20,y0,3,3,"td",67)(21,D0,3,4,"td",70)(22,v0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,qs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Us,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function T0(i,s){i&1&&b(0,"td",75)}function P0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function F0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function b0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function E0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function M0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function V0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function B0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function O0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function L0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function R0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,T0,1,0,"td",67)(4,P0,2,0,"td",67)(5,F0,4,6,"td",67)(6,I0,4,6,"td",67)(7,b0,4,6,"td",68)(8,E0,4,6,"td",67)(9,M0,5,6,"td",82)(10,V0,5,6,"td",69)(11,B0,5,6,"td",82)(12,O0,5,10,"td",70)(13,L0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function k0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,e0,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,t0,2,1,"th",37)(12,i0,2,0,"th",38)(13,n0,2,0,"th",39)(14,a0,2,0,"th",40)(15,o0,2,1,"th",41)(16,r0,2,0,"th",42)(17,l0,2,1,"th",43)(18,p0,2,0,"th",44)(19,m0,2,0,"th",45),a()(),n(20,"tbody"),E(21,w0,23,21,"tr",46),a(),E(22,R0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var $n=class i extends De{constructor(e,r,t,l,C,T,$e){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=$e}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Fe(Y);columnService=Fe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(tt({},this.data),{Data:e.Data.map(t=>nt(tt({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(tt({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(tt({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(tt({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Ki.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(tt({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Xr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(qe),w(We),w(z),w(Gn))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Js,3,7,"a",2),S(3,Zs,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,$s,45,36,"ng-template",null,0,O),a(),E(29,k0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Ns)),o(3),c("routerLink",M(15,As)),o(3),c("routerLink",M(16,Gs)),o(3),c("routerLink",M(17,Hs)),o(3),c("routerLink",M(18,Qs)),o(3),c("routerLink",M(19,Ys)),o(5),c("ngIf",t.data))},dependencies:[A,Ze,st,it,Q,$,J,er,L,k,ae,pe,Ce,Te,Ne,fe,U,ze,oi,se,re,Z,te],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var N0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],A0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],G0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],H0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Q0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],j0=i=>({ID:i}),q0=(i,s)=>s.Name,U0=(i,s)=>s.ID;function z0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function K0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),h("selectedOutletGroupIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),f("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(3),f("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),f("ngModel",e.pageData.Filter.ProductTagID),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function X0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&Ut("text-align","right")}function J0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&Ut("text-align","right")}function Z0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&Ut("text-align","right")}function $0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function ec(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function tc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),F(e.Code)}}function ic(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function nc(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;Ut("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function ac(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function oc(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function rc(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,tc,2,3,"td",33),S(5,ic,3,5,"td",33),S(6,nc,3,5,"td",33),G(7,ac,2,1,"td",14,ji),S(9,oc,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,j0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(z),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,z0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,K0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,X0,2,2,"th",11),S(36,J0,2,2,"th",12),S(37,Z0,2,2,"th",12),G(38,$0,2,3,"th",13,q0),S(40,ec,2,0,"th",14),a()(),n(41,"tbody"),G(42,rc,10,9,"tr",15,U0),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,N0)),o(3),c("routerLink",M(17,A0)),o(3),c("routerLink",M(18,G0)),o(3),c("routerLink",M(19,H0)),o(3),c("routerLink",M(20,Q0)),o(3),c("routerLink",M(21,Y0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,k,ae,Te,Ne,fe,U,ze,Bi,Z],encapsulation:2})};var yo=Zt(Ei());var lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],sc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],cc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],dc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Zr=()=>({standalone:!0}),$r=()=>({overflow:"visible"}),uc=i=>[i],_c=i=>({ID:i});function gc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function Cc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Zr))("contentStyle",M(19,$r))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Zr))("contentStyle",M(21,$r))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function fc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function xc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function hc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function Sc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function yc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function Dc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,uc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,_c,e.ID)),o(),D(" ",e.Name," ")}}function vc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function wc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function Pc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Fc(i,s){if(i&1&&(n(0,"tr"),S(1,Dc,3,7,"td"),S(2,vc,2,1,"td"),S(3,wc,4,4,"td",29),E(4,Tc,3,4,"td",30),S(5,Pc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function Ic(i,s){i&1&&b(0,"td")}function bc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function Ec(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function Mc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Bc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,Ic,1,0,"td"),S(3,bc,2,0,"td",29),S(4,Ec,3,4,"td",29),E(5,Mc,3,4,"td",30),S(6,Vc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),$e=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,$e)}_toastrService=Fe(qe);columnService=Fe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,yo.default)(this.pageData.Filter.MonthFrom),r=(0,yo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,gc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Cc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,fc,2,0,"th",11),S(34,xc,2,0,"th",12),S(35,hc,3,0,"th",13),E(36,Sc,2,1,"th",14),S(37,yc,3,0,"th",13),a()(),n(38,"tbody"),E(39,Fc,6,5,"tr",15),a(),E(40,Bc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,lc)),o(3),c("routerLink",M(20,pc)),o(3),c("routerLink",M(21,mc)),o(3),c("routerLink",M(22,sc)),o(3),c("routerLink",M(23,cc)),o(3),c("routerLink",M(24,dc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,k,ae,pe,Ce,Te,fe,U,Ir,se,ne],encapsulation:2})};var Oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Lc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],kc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Wc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ac=i=>[i],Gc=i=>({ID:i});function Hc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Qc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Yc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function jc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Yc,2,1,"th",22,j),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function qc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Uc(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Ac,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Gc,r[1])),o(),F(r[e])}}function zc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Kc(i,s){if(i&1&&(n(0,"td",11),S(1,Uc,2,7,"a",23)(2,zc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Xc(i,s){if(i&1&&(n(0,"tr",11),G(1,Kc,3,1,"td",11,j),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Hc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Qc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,jc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,qc,2,1,"th",12,j),a()(),n(40,"tbody"),G(41,Xc,3,0,"tr",11,j),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Oc)),o(3),c("routerLink",M(13,Lc)),o(3),c("routerLink",M(14,Rc)),o(3),c("routerLink",M(15,kc)),o(3),c("routerLink",M(16,Wc)),o(3),c("routerLink",M(17,Nc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,k,Te,fe,U],encapsulation:2})};var Jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Zc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],$c=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],ed=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),el=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],td=(i,s,e)=>({CategoryID:i,From:s,To:e}),id=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],tl=i=>({CategoryID:i});function nd(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ad(i,s){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function od(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,ad,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero)}}function rd(i,s){i&1&&(n(0,"th",42),p(1," Cost "),b(2,"p-treeTableSortIcon",43),a())}function ld(i,s){i&1&&(n(0,"th",44),p(1," Profit "),b(2,"p-treeTableSortIcon",45),a())}function pd(i,s){i&1&&(n(0,"th",46),p(1," % "),b(2,"p-treeTableSortIcon",47),a())}function md(i,s){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),b(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),b(6,"p-treeTableSortIcon",32),a(),E(7,rd,3,0,"th",33),n(8,"th",34),p(9," Gross "),b(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),b(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),b(16,"p-treeTableSortIcon",39),a(),E(17,ld,3,0,"th",40)(18,pd,3,0,"th",41),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function sd(i,s){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function cd(i,s){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function dd(i,s){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function ud(i,s){if(i&1&&(n(0,"td"),E(1,dd,5,11,"span",58),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function _d(i,s){if(i&1&&(n(0,"tr",48)(1,"td"),b(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,sd,6,9,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),E(33,cd,6,9,"td",55)(34,ud,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,el))("queryParams",_t(55,td,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,id))("queryParams",X(60,tl,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,el))("queryParams",X(63,tl,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function gd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Cd(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function fd(i,s){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function xd(i,s){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),E(6,gd,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),E(17,Cd,3,3,"td",61)(18,fd,3,3,"td",63),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function hd(i,s){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),E(3,md,19,3,"ng-template",25)(4,_d,35,65,"ng-template",26)(5,xd,19,15,"ng-template",27),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,ed))}}var na=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,nd,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,od,29,15,"ng-template",null,0,O),a(),E(19,hd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Jc)),o(3),c("routerLink",M(11,Zc)),o(3),c("routerLink",M(12,$c)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,k,ae,Te,Ne,Er,hn,Or,Mr,Vr,Br,fe,U,ze,Bn,ne,re,Z,te],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var Sd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],yd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function vd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.CustomerID)}}function Td(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function Pd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Fd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function Id(i,s){if(i&1&&(n(0,"td"),S(1,Pd,2,1,"span"),S(2,Fd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function bd(i,s){if(i&1&&(n(0,"tr"),G(1,Id,3,2,"td",null,j),a()),i&2){let e=s.$implicit;o(),H(e)}}function Ed(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function Md(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,Ed,3,3,"td",null,j),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Vd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,Td,2,2,"th",19,j),a()(),n(6,"tbody"),G(7,bd,3,0,"tr",null,j),a(),S(9,Md,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var aa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let $e=t.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value,Ai=l.find(Gi=>Gi.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare($e,Ai,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,wd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Vd,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,Sd)),o(3),c("routerLink",M(11,yd)),o(3),c("routerLink",M(12,Dd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,k,pe,Ce,Ne,fe,U,Z],encapsulation:2})};var Bd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Od=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Ld=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Rd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),f("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),f("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function kd(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var oa=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(R))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Rd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,kd,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Bd)),o(3),c("routerLink",M(9,Od)),o(3),c("routerLink",M(10,Ld)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,k,ri],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),f("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Ad(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var ra=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(Y))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Nd,13,9,"ng-template",null,0,O),a(),S(8,Ad,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Wd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,k,ri,Mt,U],encapsulation:2})};function Gd(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Hd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Yd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Qd,16,15,"tr",null,j),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var la=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gd,3,0,"a",2),a(),n(3,"filters"),E(4,Hd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Yd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,k,U,se,ne,Z],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function qd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ud(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To)}}function zd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Kd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Xd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Kd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Jd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var pa=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(R),w(q),w(Y),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,qd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ud,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,zd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Xd,21,21,"tr",null,j),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Jd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,jd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,k,U,se,hr,ne,Z,te],encapsulation:2})};var Zd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],vo=(i,s)=>({From:i,To:s}),$d=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],eu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function tu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function iu(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ma=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(R),w(We))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),h("filterChange",function(C){return u(t),x(r.pageData.Filter,C)||(r.pageData.Filter=C),_(C)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,tu,13,11,"ng-template",null,0,O),a(),S(18,iu,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",r.pageData.Filter),o(7),c("routerLink",M(11,Zd))("queryParams",ue(12,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,$d))("queryParams",ue(16,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,eu))("queryParams",ue(20,vo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,k,Mt,Ht,fe,U],encapsulation:2})};var ru={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ci=class i{date;dateChange=new pn;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[hi([{provide:vn,useClass:An,deps:[Dn,Fr]},{provide:wn,useValue:ru}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(C){return u(t),_(r.onDateChange(C.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(C){u(t);let T=Dt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Dt(4);return _(r.setMonthAndYear(C,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);Ut("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[Gt,En,wi,Fn,In,bn,Ti,Vn,Pn,Tn,Mn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2})};var pu=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function mu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(4),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),f("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),f("model",e.pageData.Filter.MultiplyUnitQuantity)}}function su(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ca=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter($e=>this.series?.name==$e?.name);let l=[],C="",T=this.point.index;return r.forEach($e=>{$e.options.stack===this.point.series.options.stack&&(l=$e.name.split(" "),C+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}: