dealpos 25.51.0 → 25.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/browser/{chunk-OURNAI65.js → chunk-243EB36Y.js} +2 -2
  2. package/browser/{chunk-5HIJCKLY.js → chunk-3K2A4Z67.js} +1 -1
  3. package/browser/{chunk-43G72GH2.js → chunk-4OP4E5Q4.js} +1 -1
  4. package/browser/{chunk-V6NXOOJA.js → chunk-4PDGY62B.js} +1 -1
  5. package/browser/{chunk-WR54IKY6.js → chunk-54SK3PVO.js} +1 -1
  6. package/browser/{chunk-VQKO557Q.js → chunk-55Z32OLJ.js} +1 -1
  7. package/browser/{chunk-SVUFU2AS.js → chunk-5XTMPVSF.js} +1 -1
  8. package/browser/{chunk-67UFIJ2O.js → chunk-6OULAYGH.js} +1 -1
  9. package/browser/{chunk-HIA4J5DB.js → chunk-6VYP636I.js} +1 -1
  10. package/browser/{chunk-PV27CMZ2.js → chunk-7264OPXA.js} +1 -1
  11. package/browser/{chunk-XWV7AI2C.js → chunk-7OQXKVTC.js} +1 -1
  12. package/browser/{chunk-6UY42XOC.js → chunk-AB7O2ERM.js} +1 -1
  13. package/browser/{chunk-T5IJP474.js → chunk-ABOSNV75.js} +1 -1
  14. package/browser/{chunk-HHCNN3XR.js → chunk-BCGNQKO5.js} +1 -1
  15. package/browser/{chunk-RU3GD3GY.js → chunk-BRQVQGLJ.js} +1 -1
  16. package/browser/{chunk-2EHLYOAD.js → chunk-BWVEZ3MZ.js} +1 -1
  17. package/browser/{chunk-RHDU4PR2.js → chunk-CAGFIP4G.js} +1 -1
  18. package/browser/{chunk-4MWVPOV6.js → chunk-CJ4ET4PG.js} +1 -1
  19. package/browser/{chunk-CRKJEU3Z.js → chunk-CR5CHTI7.js} +1 -1
  20. package/browser/{chunk-4CYACZL5.js → chunk-DAH4EEQV.js} +1 -1
  21. package/browser/{chunk-SCHTN7VQ.js → chunk-DBRZ7F2Z.js} +1 -1
  22. package/browser/{chunk-VA6MHJ5E.js → chunk-DNY4JYTC.js} +1 -1
  23. package/browser/{chunk-IM3B5EF2.js → chunk-E5TUY2II.js} +1 -1
  24. package/browser/chunk-EFDMYOLZ.js +4 -0
  25. package/browser/{chunk-NRTKHF45.js → chunk-EMHEIQNS.js} +1 -1
  26. package/browser/{chunk-QS2AUXB7.js → chunk-FEHMPX43.js} +1 -1
  27. package/browser/{chunk-WQMYMJLR.js → chunk-FVFTYYCC.js} +1 -1
  28. package/browser/{chunk-BVOUQJCA.js → chunk-GE5I6JYL.js} +1 -1
  29. package/browser/{chunk-ZNPC63ZV.js → chunk-GZ6OVEDL.js} +1 -1
  30. package/browser/{chunk-NQQB5U5S.js → chunk-H6RHVRGW.js} +1 -1
  31. package/browser/{chunk-6LZENMYE.js → chunk-HLCZLXPS.js} +1 -1
  32. package/browser/{chunk-N6EBK52R.js → chunk-IF6EZMOM.js} +2 -2
  33. package/browser/{chunk-OTLU2WY3.js → chunk-ISZRZRCT.js} +2 -2
  34. package/browser/{chunk-I7AQHKKG.js → chunk-JHBK7LOJ.js} +1 -1
  35. package/browser/{chunk-PQSGJR4P.js → chunk-KDISSQKT.js} +1 -1
  36. package/browser/{chunk-5ZPO7V26.js → chunk-KFC3V2GW.js} +1 -1
  37. package/browser/{chunk-KEILLJ6G.js → chunk-KHB5Q7IN.js} +1 -1
  38. package/browser/{chunk-P5XKSQ34.js → chunk-KIYO2YC2.js} +1 -1
  39. package/browser/{chunk-HVFYCXLX.js → chunk-KKM7I2BT.js} +1 -1
  40. package/browser/{chunk-DX56EYRS.js → chunk-LHTHIOAY.js} +1 -1
  41. package/browser/{chunk-A5LIALQE.js → chunk-M4FNFZNJ.js} +1 -1
  42. package/browser/{chunk-TOJPS7BJ.js → chunk-MEL6Z4NI.js} +1 -1
  43. package/browser/{chunk-XVTXHAKW.js → chunk-MHPLYS7O.js} +1 -1
  44. package/browser/{chunk-ZO3XZXWW.js → chunk-MJCLLJBB.js} +1 -1
  45. package/browser/{chunk-2GIDUMXS.js → chunk-MZDVGN2B.js} +1 -1
  46. package/browser/{chunk-SUCJCOST.js → chunk-NYMHQHNP.js} +1 -1
  47. package/browser/{chunk-6AHKVKAZ.js → chunk-O7SYLGUB.js} +2 -2
  48. package/browser/{chunk-OZ2R2K2V.js → chunk-OF3BZHBQ.js} +1 -1
  49. package/browser/{chunk-H2RXYP7A.js → chunk-OFWJY5WB.js} +1 -1
  50. package/browser/{chunk-3HDEMBWS.js → chunk-ORTAUDOX.js} +1 -1
  51. package/browser/{chunk-4OTZNFYS.js → chunk-PSLGWGNP.js} +1 -1
  52. package/browser/{chunk-MUWJSYXR.js → chunk-Q22HR52N.js} +1 -1
  53. package/browser/{chunk-ZNJ4JTTS.js → chunk-QEL7CGCP.js} +1 -1
  54. package/browser/{chunk-57WKDIDF.js → chunk-QHGZQ2IG.js} +1 -1
  55. package/browser/{chunk-6F45DEGR.js → chunk-R6DRKF4V.js} +8 -8
  56. package/browser/{chunk-HHM4L75O.js → chunk-RDASAJA5.js} +1 -1
  57. package/browser/{chunk-HSLDD424.js → chunk-RPBIQ4ME.js} +1 -1
  58. package/browser/{chunk-DJUOMCAV.js → chunk-RT7OZJYZ.js} +1 -1
  59. package/browser/{chunk-3PKJLXTC.js → chunk-RWW55Z7V.js} +1 -1
  60. package/browser/{chunk-V36Z6WRV.js → chunk-RWZGTR3S.js} +1 -1
  61. package/browser/{chunk-YXRJV3RQ.js → chunk-SQAFHZEO.js} +1 -1
  62. package/browser/{chunk-RF5FWMSR.js → chunk-T43ISYOP.js} +1 -1
  63. package/browser/{chunk-6O6OE4KQ.js → chunk-TKHSLAZH.js} +13 -13
  64. package/browser/{chunk-OAVGNXY4.js → chunk-TYVVSM36.js} +1 -1
  65. package/browser/{chunk-D7YMUC3H.js → chunk-U6FO6TSU.js} +1 -1
  66. package/browser/{chunk-XPN6EISF.js → chunk-UFVN6MTY.js} +1 -1
  67. package/browser/{chunk-VOY3BJZP.js → chunk-UI6U53UY.js} +1 -1
  68. package/browser/{chunk-B6TCVVAN.js → chunk-UPV6ZIB5.js} +1 -1
  69. package/browser/{chunk-6GCAXVFO.js → chunk-VG3B7TDX.js} +1 -1
  70. package/browser/{chunk-OR4H5IKL.js → chunk-VS6CGXUJ.js} +1 -1
  71. package/browser/{chunk-T6GXIGYG.js → chunk-WDUPZI6X.js} +1 -1
  72. package/browser/{chunk-TCW7SVU5.js → chunk-WTIIZBRC.js} +1 -1
  73. package/browser/{chunk-HQGZC4Y3.js → chunk-XCSDEGWL.js} +1 -1
  74. package/browser/{chunk-WFTIOB7Q.js → chunk-XDFUPYND.js} +1 -1
  75. package/browser/{chunk-3XDE3GJ3.js → chunk-XFU3EMCG.js} +1 -1
  76. package/browser/{chunk-7JBFR3T4.js → chunk-XGXXFTMA.js} +1 -1
  77. package/browser/{chunk-DCONKX6G.js → chunk-XMPWQ5UV.js} +1 -1
  78. package/browser/{chunk-ECW7GAZQ.js → chunk-XPM7J5AN.js} +1 -1
  79. package/browser/{chunk-HZP6OUOI.js → chunk-XW7VJLDW.js} +1 -1
  80. package/browser/{chunk-MTUBVUM5.js → chunk-Y6SAXN2J.js} +1 -1
  81. package/browser/{chunk-A2EDYIYP.js → chunk-YLXBICIW.js} +1 -1
  82. package/browser/{chunk-IHIJW73V.js → chunk-Z5HEFUTD.js} +1 -1
  83. package/browser/{chunk-YC2LQSY3.js → chunk-ZRJU5XBX.js} +1 -1
  84. package/browser/index.html +2 -2
  85. package/browser/{main-PHIUFC5R.js → main-6NLSRECT.js} +2 -2
  86. package/package.json +1 -1
  87. package/browser/chunk-QERITLZK.js +0 -4
@@ -1,4 +1,4 @@
1
- import{a as ii,b as Nr}from"./chunk-JEZMYDZR.js";import{a as Wr}from"./chunk-BHQZXJKQ.js";import{a as Mt,b as Ar}from"./chunk-C22G4JGX.js";import{a as Gt,b as Gr}from"./chunk-LMUFX64W.js";import{a as ti}from"./chunk-4467AQLM.js";import{a as De}from"./chunk-DX56EYRS.js";import{a as An}from"./chunk-DSXOFWO7.js";import{a as Hr}from"./chunk-5ZPO7V26.js";import{a as ze}from"./chunk-VEQJR5VL.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-AXCTEREY.js";import{a as pr}from"./chunk-SWVQK6HM.js";import{b as dr}from"./chunk-P7KMHPVN.js";import"./chunk-U4MC22BG.js";import{a as Vi}from"./chunk-QS2AUXB7.js";import"./chunk-PSFQWURP.js";import{a as kr}from"./chunk-3XH2STFE.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-P3TFDLWR.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-V4V55JMO.js";import{a as Tr,b as Pr}from"./chunk-IDJEXQ5I.js";import"./chunk-DODZXMH2.js";import"./chunk-EZNBK62W.js";import{e as cr}from"./chunk-3MAZIRSX.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-HHCNN3XR.js";import"./chunk-3Q5WV3VF.js";import"./chunk-HIA4J5DB.js";import"./chunk-GFSJZHCB.js";import"./chunk-VGHEGWAM.js";import{a as ne}from"./chunk-Y7ZKGM5U.js";import{a as Z}from"./chunk-75FYOZH7.js";import"./chunk-CVN6ZXXJ.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-AHTR7XKG.js";import{a as En,b as Di}from"./chunk-NS6IC2PT.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-SMEVWRVE.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-JQDS4BXR.js";import"./chunk-F3HDP5CA.js";import"./chunk-AJAUI7BA.js";import"./chunk-MWGICBEB.js";import{c as sr,d as Te,e as Wn}from"./chunk-ODYEJFNJ.js";import"./chunk-WSWTWRKJ.js";import{a as vi}from"./chunk-BVOUQJCA.js";import{a as pe,b as ge,c as lr}from"./chunk-ACXQ2FOW.js";import{a as Et,b as vr}from"./chunk-XWYCNPUZ.js";import{d as Sr,f as Ce}from"./chunk-ZNPC63ZV.js";import{a as yr,b as Dr,c as U}from"./chunk-6UY42XOC.js";import{b as K}from"./chunk-YQ5PAXUW.js";import{a as me}from"./chunk-HQGZC4Y3.js";import{a as rr}from"./chunk-VQKO557Q.js";import"./chunk-TRK4LJDS.js";import"./chunk-B4TZQBTN.js";import{a as q}from"./chunk-JT4M6AIA.js";import{e as A,f as Ii}from"./chunk-2GIDUMXS.js";import"./chunk-ZO3XZXWW.js";import"./chunk-OB6KFXD6.js";import"./chunk-QJ3CWKQT.js";import"./chunk-ZOYWCF3Q.js";import{c as ur}from"./chunk-SWF6XISV.js";import"./chunk-GXAF3JUO.js";import"./chunk-LB5UXGDG.js";import"./chunk-YDL2MTWE.js";import"./chunk-7YYWBCWJ.js";import"./chunk-CCIHCGP5.js";import{a as _r,c as Ue}from"./chunk-FM7BHGBW.js";import"./chunk-TP6ZUC53.js";import{d as hr}from"./chunk-3PKJLXTC.js";import{b as N}from"./chunk-ECW7GAZQ.js";import"./chunk-E634BI4W.js";import"./chunk-BAXZ74LK.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-3ZH3XK5V.js";import{b as ie,c as hn}from"./chunk-V6D6TV7B.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-QWLNF7VL.js";import"./chunk-UIVJ2JQT.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-SCGKVOSE.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-N5RDRDT7.js";import"./chunk-N7OS7SFI.js";import{a as nr}from"./chunk-4HLKKTIV.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-RIZ4YVMH.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-Z76C52NM.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-7MRUPBXU.js";import"./chunk-T5IJP474.js";import"./chunk-DJUOMCAV.js";import"./chunk-5RYL4EJ2.js";import{b as j}from"./chunk-KBLVOO4J.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-NQQB5U5S.js";import{p as qe,s as k}from"./chunk-TANYEHMZ.js";import{$b as _i,$c as Qo,Ab as S,Ac as X,Bc as fe,Ca as dt,Cb as y,Cc as _t,Db as Yi,Dc as Ut,E as ri,Eb as Y,Ec as cn,Fb as G,Fc as Ao,Gb as H,Hb as c,Hc as d,I as Qi,Ia as go,Ib as n,Ic as g,Ja as Ro,Jb as a,Jc as v,K as Vo,Kb as b,Kc as fi,Ld as Ko,M as Bo,Ma as ko,Nc as O,Ob as pt,Pb as mt,Pc as Go,Pd as Ne,Q as nn,Qa as Ee,Qb as Wo,Qc as xi,Rb as I,Rc as dn,Rd as _n,Sa as rn,Sd as Q,Ub as P,Uc as Ho,Ud as Ui,Vc as hi,Wb as m,Xa as o,Y as jt,Ya as ln,Zb as Co,Zc as un,_b as sn,aa as _o,ac as gi,bd as fo,cd as Yo,dd as jo,eb as w,ec as Tt,fa as Nt,fc as qt,gc as ji,hc as No,ib as B,ic as qi,id as tt,jb as ui,jc as p,ka as Oo,kb as pn,kc as F,kd as st,la as an,lc as D,ld as it,ma as di,mb as W,mc as $t,na as Zt,nb as mn,o as ci,ob as E,oc as f,pa as Pe,pc as x,pd as qo,qc as h,qd as Uo,sd as oe,t as oi,ta as u,u as uo,ua as _,uc as Ct,ud as re,wb as li,xa as on,xd as Si,yc as Ci,za as Lo,zc as M,zd as zo}from"./chunk-L3U6V3BF.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var C=t(944),T=t.n(C),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,vt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),wt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);wt[yt]||(wt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?vt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,vt,Gi,ht,je,wt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){wt&&(ee.labelBySeries=wt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!wt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=wt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";wt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),wt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),wt.attr({padding:0,zIndex:3}).add()}for((Je=wt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,vt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,vt,Je)):(yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(vt=xt;vt<xt+It-Je.height;vt+=16)(Gi=mi(ee,ot,vt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(wt.x||0)),2)+Math.pow(Math.abs(je.y-(wt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(wt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,C,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function gp(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,"Sales Person"),a(),n(9,"sales-person-selector",9),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",10),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",11),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(),pt(18),n(19,"div",12)(20,"div",13)(21,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",15)(23,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",17)(25,"div",13)(26,"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.onFilterFromDate())}),a()(),n(27,"div",15)(28,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),mt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",23),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.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Cp(i,s){i&1&&(n(0,"th",52),p(1,"DATE"),a())}function fp(i,s){i&1&&(n(0,"th",53),p(1," CUSTOMER "),a())}function xp(i,s){i&1&&(n(0,"th",40),p(1,"JOIN DATE"),a())}function hp(i,s){i&1&&(n(0,"th",41),p(1,"GROUPS"),a())}function Sp(i,s){i&1&&(n(0,"th",54),p(1," SALES PERSON "),a())}function yp(i,s){i&1&&(n(0,"th",55),p(1," COST "),a())}function Dp(i,s){i&1&&(n(0,"th",56),p(1," GROSS "),a())}function vp(i,s){i&1&&(n(0,"th",57),p(1," SALES "),a())}function wp(i,s){i&1&&(n(0,"th",58),p(1," TAX "),a())}function Tp(i,s){i&1&&(n(0,"th",59),p(1," SURCHARGE "),a())}function Pp(i,s){i&1&&(n(0,"th",60),p(1," TOTAL "),a())}function Fp(i,s){i&1&&(n(0,"th",61),p(1," PAYMENT "),a())}function Ip(i,s){i&1&&b(0,"br")}function bp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Ep(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 Mp(i,s){if(i&1&&(n(0,"td")(1,"a",67),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Vp(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 Bp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Lp(i,s){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Rp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function kp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Np(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",71),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Hp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",62),p(5),a(),E(6,Ip,1,0,"br",3)(7,bp,2,1,"i",3),a(),E(8,Ep,7,8,"td",3)(9,Mp,3,6,"td",3),S(10,Vp,3,4,"td"),S(11,Bp,2,1,"td"),E(12,Op,2,1,"td",3)(13,Lp,3,3,"td",63)(14,Rp,3,3,"td",64)(15,kp,3,3,"td",64)(16,Wp,3,3,"td",65)(17,Np,3,3,"td",64)(18,Ap,3,3,"td",64)(19,Gp,2,6,"td",66),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Qp(i,s){i&1&&b(0,"td",74)}function Yp(i,s){i&1&&b(0,"td",74)}function jp(i,s){i&1&&b(0,"td",74)}function qp(i,s){i&1&&(n(0,"td",77),p(1," Total: "),a())}function Up(i,s){if(i&1&&(n(0,"td",68),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 zp(i,s){if(i&1&&(n(0,"td",69),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 Kp(i,s){if(i&1&&(n(0,"td",69),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 Xp(i,s){if(i&1&&(n(0,"td",70),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 Jp(i,s){if(i&1&&(n(0,"td",69),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 Zp(i,s){if(i&1&&(n(0,"td",69),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 $p(i,s){if(i&1&&(n(0,"tfoot",72)(1,"tr",73),b(2,"td",74),E(3,Qp,1,0,"td",75)(4,Yp,1,0,"td",75)(5,jp,1,0,"td",75)(6,qp,2,0,"td",76)(7,Up,4,6,"td",63)(8,zp,4,6,"td",64)(9,Kp,4,6,"td",64)(10,Xp,4,6,"td",65)(11,Jp,4,6,"td",64)(12,Zp,4,6,"td",64),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 em(i,s){if(i&1){let e=I();n(0,"div",33)(1,"table",34),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",35)(3,"tr")(4,"th",36),p(5,"OUTLET"),a(),n(6,"th",37),p(7,"NUMBER"),a(),E(8,Cp,2,0,"th",38)(9,fp,2,0,"th",39),S(10,xp,2,0,"th",40),S(11,hp,2,0,"th",41),E(12,Sp,2,0,"th",42)(13,yp,2,0,"th",43)(14,Dp,2,0,"th",44)(15,vp,2,0,"th",45)(16,wp,2,0,"th",46)(17,Tp,2,0,"th",47)(18,Pp,2,0,"th",48)(19,Fp,2,0,"th",49),a()(),n(20,"tbody"),E(21,Hp,20,21,"tr",50),a(),E(22,$p,13,10,"tfoot",51),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 tm(i,s){if(i&1){let e=I();n(0,"span",78),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",79),p(2,"?"),a()()}}function im(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 nm(i,s){if(i&1){let e=I();n(0,"a",80),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",81),p(2," Next"),a()}}function am(i,s){if(i&1){let e=I();n(0,"a",82),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",83),p(2," Show All"),a()}}function om(i,s){if(i&1&&(n(0,"content")(1,"div",24),E(2,em,23,14,"div",25),n(3,"div",26)(4,"div",27)(5,"div",28),p(6),d(7,"number"),E(8,tm,3,0,"span",29)(9,im,3,3,"span",3),p(10),a()(),n(11,"div",30),E(12,nm,3,0,"a",31)(13,am,3,0,"a",32),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[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"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time","customStyle"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["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",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",2),a(),n(3,"filters"),E(4,gp,44,26,"ng-template",null,0,O),a(),E(6,om,14,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],pm=()=>["/menu/Products/Setup/Brand/Brand_Form"],mm=i=>({ID:i}),sm=(i,s)=>({BrandID:i,Name:s});function cm(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 dm(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 um(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function _m(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,_m,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,pm))("queryParams",X(12,mm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,sm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Cm(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,um,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,gm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cm,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,dm,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Cm,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,rm)),o(3),c("routerLink",M(9,lm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function fm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,fm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],vm=()=>["/menu/Contacts/Contact/Customers/Info"],wm=i=>({ID:i});function Tm(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 Pm(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 Fm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Im(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function bm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Em(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Mm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Vm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Bm(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 Om(i,s){if(i&1&&(n(0,"span"),G(1,Bm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Lm(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 Rm(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 km(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 Wm(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 Nm(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 Am(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 Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Hm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Om,3,0,"span"),S(6,Lm,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Rm,3,3,"td",34),S(11,km,3,3,"td",34),S(12,Wm,3,3,"td",35),S(13,Nm,3,3,"td",34),S(14,Am,3,3,"td",36),S(15,Gm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,vm))("queryParams",X(14,wm,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 Qm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Hm,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function Ym(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,Fm,2,0,"th",22),S(10,Im,2,0,"th",23),S(11,bm,2,0,"th",24),S(12,Em,2,0,"th",25),S(13,Mm,2,0,"th",26),S(14,Vm,2,0,"th",27),a()(),S(15,Qm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Tm,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,Pm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,Ym,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,xm)),o(3),c("routerLink",M(13,hm)),o(3),c("routerLink",M(14,Sm)),o(3),c("routerLink",M(15,ym)),o(4),c("routerLink",M(16,Dm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Xm(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 Jm(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 Zm(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 $m(i,s){if(i&1&&(n(0,"tbody",22),G(1,Zm,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function es(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,$m,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Xm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By 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,Jm,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,es,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,jm)),o(3),c("routerLink",M(12,qm)),o(3),c("routerLink",M(13,Um)),o(3),c("routerLink",M(14,zm)),o(3),c("routerLink",M(15,Km)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function rs(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 ls(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 ps(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function ms(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ss(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function cs(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 ds(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 us(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 _s(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,cs,3,3,"td",23),S(4,ds,3,3,"td",23),S(5,us,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 gs(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,ps,2,0,"th",19),S(7,ms,2,0,"th",20),S(8,ss,2,0,"th",21),a()(),n(9,"tbody",22),G(10,_s,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,rs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By 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,ls,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,gs,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,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(3),c("routerLink",M(16,os)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ys=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Ds=i=>({ID:i}),vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function ws(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 Ts(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 Ps(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,ys))("queryParams",X(20,Ds,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,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 Fs(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 Is(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,Ps,17,27,"tr",24,Y),a(),S(17,Fs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ws,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,Ts,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Is,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,Cs)),o(3),c("routerLink",M(14,fs)),o(3),c("routerLink",M(15,xs)),o(3),c("routerLink",M(16,hs)),o(3),c("routerLink",M(17,Ss)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ms=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Rs=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),ks=i=>[i],Ws=i=>({ID:i}),Ns=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],As=(i,s,e)=>({VariantID:i,From:s,To:e}),Gs=(i,s,e)=>({ProductID:i,From:s,To:e});function Hs(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Rs,(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 Qs(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 Ys(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 js(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 qs(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 Us(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function zs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ks(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Xs(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 Js(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Zs(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 $s(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function e0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function t0(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 i0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function n0(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 a0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,Ns,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 o0(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 r0(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 l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function p0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,As,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 m0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Gs,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 s0(i,s){if(i&1&&(n(0,"td",75),E(1,p0,5,16,"a",78)(2,m0,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 c0(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 d0(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 u0(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 _0(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 g0(i,s){if(i&1&&(n(0,"tr",60),E(1,t0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,i0,2,1,"ng-container",8)(8,n0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,a0,4,11,"td",67)(15,o0,3,3,"td",67)(16,r0,3,3,"td",68)(17,l0,3,3,"td",67)(18,s0,3,2,"td",67)(19,c0,3,3,"td",69)(20,d0,3,3,"td",67)(21,u0,3,4,"td",70)(22,_0,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,ks,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Ws,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 C0(i,s){i&1&&b(0,"td",75)}function f0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function x0(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 h0(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 S0(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 y0(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 D0(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 w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function T0(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 P0(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 F0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,C0,1,0,"td",67)(4,f0,2,0,"td",67)(5,x0,4,6,"td",67)(6,h0,4,6,"td",67)(7,S0,4,6,"td",68)(8,y0,4,6,"td",67)(9,D0,5,6,"td",82)(10,v0,5,6,"td",69)(11,w0,5,6,"td",82)(12,T0,5,10,"td",70)(13,P0,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 I0(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,js,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,qs,2,1,"th",37)(12,Us,2,0,"th",38)(13,zs,2,0,"th",39)(14,Ks,2,0,"th",40)(15,Xs,2,1,"th",41)(16,Js,2,0,"th",42)(17,Zs,2,1,"th",43)(18,$s,2,0,"th",44)(19,e0,2,0,"th",45),a()(),n(20,"tbody"),E(21,g0,23,21,"tr",46),a(),E(22,F0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,C,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Hs,3,7,"a",2),S(3,Qs,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,Ys,45,36,"ng-template",null,0,O),a(),E(29,I0,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,Es)),o(3),c("routerLink",M(15,Ms)),o(3),c("routerLink",M(16,Vs)),o(3),c("routerLink",M(17,Bs)),o(3),c("routerLink",M(18,Os)),o(3),c("routerLink",M(19,Ls)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],M0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],R0=i=>({ID:i}),k0=(i,s)=>s.Name,W0=(i,s)=>s.ID;function N0(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 A0(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 G0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function H0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function Q0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function Y0(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 j0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function q0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function U0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function z0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function K0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function X0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function J0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,q0,2,3,"td",33),S(5,U0,3,5,"td",33),S(6,z0,3,5,"td",33),G(7,K0,2,1,"td",14,Yi),S(9,X0,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,R0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,N0,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,A0,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,G0,2,2,"th",11),S(36,H0,2,2,"th",12),S(37,Q0,2,2,"th",12),G(38,Y0,2,3,"th",13,k0),S(40,j0,2,0,"th",14),a()(),n(41,"tbody"),G(42,J0,10,9,"tr",15,W0),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,E0)),o(3),c("routerLink",M(17,M0)),o(3),c("routerLink",M(18,V0)),o(3),c("routerLink",M(19,B0)),o(3),c("routerLink",M(20,O0)),o(3),c("routerLink",M(21,L0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var Z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),ac=i=>[i],oc=i=>({ID:i});function rc(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 lc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function pc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function mc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function sc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function cc(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 dc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function uc(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,ac,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,oc,e.ID)),o(),D(" ",e.Name," ")}}function _c(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gc(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 Cc(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 fc(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 xc(i,s){if(i&1&&(n(0,"tr"),S(1,uc,3,7,"td"),S(2,_c,2,1,"td"),S(3,gc,4,4,"td",29),E(4,Cc,3,4,"td",30),S(5,fc,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 hc(i,s){i&1&&b(0,"td")}function Sc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function yc(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 Dc(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 wc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,hc,1,0,"td"),S(3,Sc,2,0,"td",29),S(4,yc,3,4,"td",29),E(5,Dc,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 $n=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,rc,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,lc,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,pc,2,0,"th",11),S(34,mc,2,0,"th",12),S(35,sc,3,0,"th",13),E(36,cc,2,1,"th",14),S(37,dc,3,0,"th",13),a()(),n(38,"tbody"),E(39,xc,6,5,"tr",15),a(),E(40,wc,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,Z0)),o(3),c("routerLink",M(20,$0)),o(3),c("routerLink",M(21,ec)),o(3),c("routerLink",M(22,tc)),o(3),c("routerLink",M(23,ic)),o(3),c("routerLink",M(24,nc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Mc=i=>[i],Vc=i=>({ID:i});function Bc(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 Oc(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 Lc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Rc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Lc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function kc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Wc(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,Mc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Vc,r[1])),o(),F(r[e])}}function Nc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Ac(i,s){if(i&1&&(n(0,"td",11),S(1,Wc,2,7,"a",23)(2,Nc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Gc(i,s){if(i&1&&(n(0,"tr",11),G(1,Ac,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bc,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,Oc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Rc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,kc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Gc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Tc)),o(3),c("routerLink",M(13,Pc)),o(3),c("routerLink",M(14,Fc)),o(3),c("routerLink",M(15,Ic)),o(3),c("routerLink",M(16,bc)),o(3),c("routerLink",M(17,Ec)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],jc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Uc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function zc(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 Kc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Xc(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,Kc,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(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Jc(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function Zc(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function $c(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function ed(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,Jc,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,Zc,3,0,"th",41)(18,$c,3,0,"th",42),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 td(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),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 id(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),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 nd(i,s){if(i&1&&(n(0,"span",23),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 ad(i,s){if(i&1&&(n(0,"td"),E(1,nd,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function od(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,td,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,id,6,9,"td",56)(34,ad,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,qc,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,Uc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function rd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function ld(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function pd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function md(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,rd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,ld,3,3,"td",62)(18,pd,3,3,"td",64),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 sd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,ed,19,3,"ng-template",26)(4,od,35,65,"ng-template",27)(5,md,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,jc))}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["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,zc,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,Xc,32,17,"ng-template",null,0,O),a(),E(19,sd,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,Hc)),o(3),c("routerLink",M(11,Qc)),o(3),c("routerLink",M(12,Yc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var cd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function _d(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 gd(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 Cd(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 fd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function xd(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 hd(i,s){if(i&1&&(n(0,"td"),S(1,fd,2,1,"span"),S(2,xd,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 Sd(i,s){if(i&1&&(n(0,"tr"),G(1,hd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function yd(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 Dd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,yd,3,3,"td",null,Y),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,Cd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Sd,3,0,"tr",null,Y),a(),S(9,Dd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,_d,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," 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,gd,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,cd)),o(3),c("routerLink",M(11,dd)),o(3),c("routerLink",M(12,ud)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var wd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Td=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Fd(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 Id(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Fd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Id,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,wd)),o(3),c("routerLink",M(9,Td)),o(3),c("routerLink",M(10,Pd)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var bd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Ed(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 Md(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Ed,13,9,"ng-template",null,0,O),a(),S(8,Md,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,bd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Vd(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 Bd(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 Od(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 Ld(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,Od,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Vd,3,0,"a",2),a(),n(3,"filters"),E(4,Bd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Ld,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Rd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function kd(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 Wd(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 Nd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Ad(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 Gd(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,Ad,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 Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,kd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Wd,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,Nd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Gd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Hd,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,Rd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var Qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),Yd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function qd(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 Ud(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};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,qd,13,11,"ng-template",null,0,O),a(),S(18,Ud,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,Qd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,Yd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,jd))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var Jd={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:Jd}])],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=Tt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Tt(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=Tt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{a as ii,b as Nr}from"./chunk-JEZMYDZR.js";import{a as Wr}from"./chunk-BHQZXJKQ.js";import{a as Mt,b as Ar}from"./chunk-C22G4JGX.js";import{a as Gt,b as Gr}from"./chunk-LMUFX64W.js";import{a as ti}from"./chunk-4467AQLM.js";import{a as De}from"./chunk-LHTHIOAY.js";import{a as An}from"./chunk-DSXOFWO7.js";import{a as Hr}from"./chunk-KFC3V2GW.js";import{a as ze}from"./chunk-VEQJR5VL.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-AXCTEREY.js";import{a as pr}from"./chunk-SWVQK6HM.js";import{b as dr}from"./chunk-P7KMHPVN.js";import"./chunk-U4MC22BG.js";import{a as Vi}from"./chunk-FEHMPX43.js";import"./chunk-PSFQWURP.js";import{a as kr}from"./chunk-3XH2STFE.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-P3TFDLWR.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-V4V55JMO.js";import{a as Tr,b as Pr}from"./chunk-IDJEXQ5I.js";import"./chunk-DODZXMH2.js";import"./chunk-EZNBK62W.js";import{e as cr}from"./chunk-3MAZIRSX.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-BCGNQKO5.js";import"./chunk-3Q5WV3VF.js";import"./chunk-6VYP636I.js";import"./chunk-GFSJZHCB.js";import"./chunk-VGHEGWAM.js";import{a as ne}from"./chunk-Y7ZKGM5U.js";import{a as Z}from"./chunk-75FYOZH7.js";import"./chunk-CVN6ZXXJ.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-AHTR7XKG.js";import{a as En,b as Di}from"./chunk-NS6IC2PT.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-SMEVWRVE.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-JQDS4BXR.js";import"./chunk-F3HDP5CA.js";import"./chunk-AJAUI7BA.js";import"./chunk-MWGICBEB.js";import{c as sr,d as Te,e as Wn}from"./chunk-ODYEJFNJ.js";import"./chunk-WSWTWRKJ.js";import{a as vi}from"./chunk-GE5I6JYL.js";import{a as pe,b as ge,c as lr}from"./chunk-ACXQ2FOW.js";import{a as Et,b as vr}from"./chunk-XWYCNPUZ.js";import{d as Sr,f as Ce}from"./chunk-GZ6OVEDL.js";import{a as yr,b as Dr,c as U}from"./chunk-AB7O2ERM.js";import{b as K}from"./chunk-YQ5PAXUW.js";import{a as me}from"./chunk-XCSDEGWL.js";import{a as rr}from"./chunk-55Z32OLJ.js";import"./chunk-TRK4LJDS.js";import"./chunk-B4TZQBTN.js";import{a as q}from"./chunk-JT4M6AIA.js";import{e as A,f as Ii}from"./chunk-MZDVGN2B.js";import"./chunk-MJCLLJBB.js";import"./chunk-OB6KFXD6.js";import"./chunk-QJ3CWKQT.js";import"./chunk-ZOYWCF3Q.js";import{c as ur}from"./chunk-SWF6XISV.js";import"./chunk-GXAF3JUO.js";import"./chunk-LB5UXGDG.js";import"./chunk-YDL2MTWE.js";import"./chunk-7YYWBCWJ.js";import"./chunk-CCIHCGP5.js";import{a as _r,c as Ue}from"./chunk-FM7BHGBW.js";import"./chunk-TP6ZUC53.js";import{d as hr}from"./chunk-RWW55Z7V.js";import{b as N}from"./chunk-XPM7J5AN.js";import"./chunk-E634BI4W.js";import"./chunk-BAXZ74LK.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-3ZH3XK5V.js";import{b as ie,c as hn}from"./chunk-V6D6TV7B.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-QWLNF7VL.js";import"./chunk-UIVJ2JQT.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-SCGKVOSE.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-N5RDRDT7.js";import"./chunk-N7OS7SFI.js";import{a as nr}from"./chunk-4HLKKTIV.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-RIZ4YVMH.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-Z76C52NM.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-7MRUPBXU.js";import"./chunk-ABOSNV75.js";import"./chunk-RT7OZJYZ.js";import"./chunk-5RYL4EJ2.js";import{b as j}from"./chunk-KBLVOO4J.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-H6RHVRGW.js";import{p as qe,s as k}from"./chunk-TANYEHMZ.js";import{$b as _i,$c as Qo,Ab as S,Ac as X,Bc as fe,Ca as dt,Cb as y,Cc as _t,Db as Yi,Dc as Ut,E as ri,Eb as Y,Ec as cn,Fb as G,Fc as Ao,Gb as H,Hb as c,Hc as d,I as Qi,Ia as go,Ib as n,Ic as g,Ja as Ro,Jb as a,Jc as v,K as Vo,Kb as b,Kc as fi,Ld as Ko,M as Bo,Ma as ko,Nc as O,Ob as pt,Pb as mt,Pc as Go,Pd as Ne,Q as nn,Qa as Ee,Qb as Wo,Qc as xi,Rb as I,Rc as dn,Rd as _n,Sa as rn,Sd as Q,Ub as P,Uc as Ho,Ud as Ui,Vc as hi,Wb as m,Xa as o,Y as jt,Ya as ln,Zb as Co,Zc as un,_b as sn,aa as _o,ac as gi,bd as fo,cd as Yo,dd as jo,eb as w,ec as Tt,fa as Nt,fc as qt,gc as ji,hc as No,ib as B,ic as qi,id as tt,jb as ui,jc as p,ka as Oo,kb as pn,kc as F,kd as st,la as an,lc as D,ld as it,ma as di,mb as W,mc as $t,na as Zt,nb as mn,o as ci,ob as E,oc as f,pa as Pe,pc as x,pd as qo,qc as h,qd as Uo,sd as oe,t as oi,ta as u,u as uo,ua as _,uc as Ct,ud as re,wb as li,xa as on,xd as Si,yc as Ci,za as Lo,zc as M,zd as zo}from"./chunk-L3U6V3BF.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var C=t(944),T=t.n(C),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,vt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),wt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);wt[yt]||(wt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?vt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,vt,Gi,ht,je,wt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){wt&&(ee.labelBySeries=wt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!wt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=wt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";wt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),wt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),wt.attr({padding:0,zIndex:3}).add()}for((Je=wt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,vt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,vt,Je)):(yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,vt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,vt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,vt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(vt=xt;vt<xt+It-Je.height;vt+=16)(Gi=mi(ee,ot,vt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(wt.x||0)),2)+Math.pow(Math.abs(je.y-(wt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(wt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),f("ngModel",e.pageData.Filter.ContactGroupID),o(3),f("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),f("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),f("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),f("ngModel",e.pageData.Filter.DeliveryStateID),o(3),f("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),f("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),f("ngModel",e.pageData.Filter.QueryOption),o(3),f("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,C,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,C);this.csvConverter=t;this.datePipe=l;this.activatedRoute=C;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(C=>C):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),f("ngModel",r.ExportPageNumber),o(4),f("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function gp(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,"Sales Person"),a(),n(9,"sales-person-selector",9),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",10),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",11),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(),pt(18),n(19,"div",12)(20,"div",13)(21,"datepicker",14),h("dateChange",function(t){u(e);let l=m();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(22,"div",15)(23,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.FromTime,t)||(l.pageData.Filter.FromTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeFromChange(t))}),a()()(),n(24,"div",17)(25,"div",13)(26,"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.onFilterFromDate())}),a()(),n(27,"div",15)(28,"app-timepicker",16),h("timeChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ToTime,t)||(l.pageData.Filter.ToTime=t),_(t)}),P("timeChange",function(t){u(e);let l=m();return _(l.timeToChange(t))}),a()()(),mt(),n(29,"h6"),p(30,"Register"),a(),n(31,"ng-select",19),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(32,"h6"),p(33,"Customer Groups"),a(),n(34,"ng-select",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(35,"h6"),p(36,"Payment"),a(),n(37,"ng-select",21),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(38,"h6"),p(39,"Creator"),a(),n(40,"autocompleteV2",22),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(41,"h6"),p(42,"RowCount"),a(),n(43,"input",23),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.CustomerID),c("inputTextValue",e.pageData.CustomerName),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.SalesOrderTagID),c("items",e.pageData.Options.SalesOrderTags),o(3),c("options",e.pageData.Options.DefaultFilterColumnOptions),f("model",e.pageData.Filter.DefaultFilterColumn),o(6),f("date",e.pageData.Filter.From),o(2),f("time",e.pageData.Filter.FromTime),c("customStyle","height: 50px"),o(3),f("date",e.pageData.Filter.To),o(2),f("time",e.pageData.Filter.ToTime),c("customStyle","height: 50px"),o(3),f("ngModel",e.pageData.Filter.RegisterID),c("items",e.pageData.Options.Registers),o(3),f("ngModel",e.pageData.Filter.CustomerGroupID),c("items",e.pageData.Options.Groups),o(3),f("ngModel",e.pageData.Filter.PaymentState),c("items",e.pageData.Options.States),o(3),f("ngModel",e.pageData.Filter.CreatorID),o(3),c("max",1e4),f("ngModel",e.pageData.Filter.RowCount)}}function Cp(i,s){i&1&&(n(0,"th",52),p(1,"DATE"),a())}function fp(i,s){i&1&&(n(0,"th",53),p(1," CUSTOMER "),a())}function xp(i,s){i&1&&(n(0,"th",40),p(1,"JOIN DATE"),a())}function hp(i,s){i&1&&(n(0,"th",41),p(1,"GROUPS"),a())}function Sp(i,s){i&1&&(n(0,"th",54),p(1," SALES PERSON "),a())}function yp(i,s){i&1&&(n(0,"th",55),p(1," COST "),a())}function Dp(i,s){i&1&&(n(0,"th",56),p(1," GROSS "),a())}function vp(i,s){i&1&&(n(0,"th",57),p(1," SALES "),a())}function wp(i,s){i&1&&(n(0,"th",58),p(1," TAX "),a())}function Tp(i,s){i&1&&(n(0,"th",59),p(1," SURCHARGE "),a())}function Pp(i,s){i&1&&(n(0,"th",60),p(1," TOTAL "),a())}function Fp(i,s){i&1&&(n(0,"th",61),p(1," PAYMENT "),a())}function Ip(i,s){i&1&&b(0,"br")}function bp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Ep(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 Mp(i,s){if(i&1&&(n(0,"td")(1,"a",67),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Vp(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 Bp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function Lp(i,s){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Rp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function kp(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Np(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",69),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",71),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Hp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",62),p(5),a(),E(6,Ip,1,0,"br",3)(7,bp,2,1,"i",3),a(),E(8,Ep,7,8,"td",3)(9,Mp,3,6,"td",3),S(10,Vp,3,4,"td"),S(11,Bp,2,1,"td"),E(12,Op,2,1,"td",3)(13,Lp,3,3,"td",63)(14,Rp,3,3,"td",64)(15,kp,3,3,"td",64)(16,Wp,3,3,"td",65)(17,Np,3,3,"td",64)(18,Ap,3,3,"td",64)(19,Gp,2,6,"td",66),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function Qp(i,s){i&1&&b(0,"td",74)}function Yp(i,s){i&1&&b(0,"td",74)}function jp(i,s){i&1&&b(0,"td",74)}function qp(i,s){i&1&&(n(0,"td",77),p(1," Total: "),a())}function Up(i,s){if(i&1&&(n(0,"td",68),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 zp(i,s){if(i&1&&(n(0,"td",69),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 Kp(i,s){if(i&1&&(n(0,"td",69),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 Xp(i,s){if(i&1&&(n(0,"td",70),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 Jp(i,s){if(i&1&&(n(0,"td",69),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 Zp(i,s){if(i&1&&(n(0,"td",69),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 $p(i,s){if(i&1&&(n(0,"tfoot",72)(1,"tr",73),b(2,"td",74),E(3,Qp,1,0,"td",75)(4,Yp,1,0,"td",75)(5,jp,1,0,"td",75)(6,qp,2,0,"td",76)(7,Up,4,6,"td",63)(8,zp,4,6,"td",64)(9,Kp,4,6,"td",64)(10,Xp,4,6,"td",65)(11,Jp,4,6,"td",64)(12,Zp,4,6,"td",64),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 em(i,s){if(i&1){let e=I();n(0,"div",33)(1,"table",34),P("matSortChange",function(t){u(e);let l=m(2);return _(l.sortData(t))}),n(2,"thead",35)(3,"tr")(4,"th",36),p(5,"OUTLET"),a(),n(6,"th",37),p(7,"NUMBER"),a(),E(8,Cp,2,0,"th",38)(9,fp,2,0,"th",39),S(10,xp,2,0,"th",40),S(11,hp,2,0,"th",41),E(12,Sp,2,0,"th",42)(13,yp,2,0,"th",43)(14,Dp,2,0,"th",44)(15,vp,2,0,"th",45)(16,wp,2,0,"th",46)(17,Tp,2,0,"th",47)(18,Pp,2,0,"th",48)(19,Fp,2,0,"th",49),a()(),n(20,"tbody"),E(21,Hp,20,21,"tr",50),a(),E(22,$p,13,10,"tfoot",51),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 tm(i,s){if(i&1){let e=I();n(0,"span",78),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",79),p(2,"?"),a()()}}function im(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 nm(i,s){if(i&1){let e=I();n(0,"a",80),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",81),p(2," Next"),a()}}function am(i,s){if(i&1){let e=I();n(0,"a",82),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",83),p(2," Show All"),a()}}function om(i,s){if(i&1&&(n(0,"content")(1,"div",24),E(2,em,23,14,"div",25),n(3,"div",26)(4,"div",27)(5,"div",28),p(6),d(7,"number"),E(8,tm,3,0,"span",29)(9,im,3,3,"span",3),p(10),a()(),n(11,"div",30),E(12,nm,3,0,"a",31)(13,am,3,0,"a",32),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),C);case"number":return this.compare(t.Number,l.Number,C);case"date":return this.compare(t.Date,l.Date,C);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),C);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),C);case"cost":return this.compare(t.Cost,l.Cost,C);case"gross":return this.compare(t.Gross,l.Gross,C);case"sales":return this.compare(t.Sales,l.Sales,C);case"tax":return this.compare(t.Tax,l.Tax,C);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,C);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,C);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,C);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,C);case"groups":return this.compare(t.Groups,l.Groups,C);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[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"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time","customStyle"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["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",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",2),a(),n(3,"filters"),E(4,gp,44,26,"ng-template",null,0,O),a(),E(6,om,14,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],pm=()=>["/menu/Products/Setup/Brand/Brand_Form"],mm=i=>({ID:i}),sm=(i,s)=>({BrandID:i,Name:s});function cm(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 dm(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 um(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function _m(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,_m,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,pm))("queryParams",X(12,mm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,sm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function Cm(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,um,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,gm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=C;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cm,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,dm,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,Cm,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,rm)),o(3),c("routerLink",M(9,lm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function fm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,fm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],vm=()=>["/menu/Contacts/Contact/Customers/Info"],wm=i=>({ID:i});function Tm(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 Pm(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 Fm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Im(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function bm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Em(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Mm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Vm(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Bm(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 Om(i,s){if(i&1&&(n(0,"span"),G(1,Bm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function Lm(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 Rm(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 km(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 Wm(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 Nm(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 Am(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 Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Hm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Om,3,0,"span"),S(6,Lm,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Rm,3,3,"td",34),S(11,km,3,3,"td",34),S(12,Wm,3,3,"td",35),S(13,Nm,3,3,"td",34),S(14,Am,3,3,"td",36),S(15,Gm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,vm))("queryParams",X(14,wm,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 Qm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Hm,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function Ym(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,Fm,2,0,"th",22),S(10,Im,2,0,"th",23),S(11,bm,2,0,"th",24),S(12,Em,2,0,"th",25),S(13,Mm,2,0,"th",26),S(14,Vm,2,0,"th",27),a()(),S(15,Qm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Orders":return this.compare(t.Orders,l.Orders,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Sales":return this.compare(t.Sales,l.Sales,C);case"Tax":return this.compare(t.Tax,l.Tax,C);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,C);case"Cost":return this.compare(t.Cost,l.Cost,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let C={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",C).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Tm,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,Pm,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,Ym,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,xm)),o(3),c("routerLink",M(13,hm)),o(3),c("routerLink",M(14,Sm)),o(3),c("routerLink",M(15,ym)),o(4),c("routerLink",M(16,Dm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],qm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Xm(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 Jm(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 Zm(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 $m(i,s){if(i&1&&(n(0,"tbody",22),G(1,Zm,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function es(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,$m,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,C,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Xm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By 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,Jm,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,es,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,jm)),o(3),c("routerLink",M(12,qm)),o(3),c("routerLink",M(13,Um)),o(3),c("routerLink",M(14,zm)),o(3),c("routerLink",M(15,Km)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ts=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],is=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function rs(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 ls(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 ps(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function ms(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ss(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function cs(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 ds(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 us(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 _s(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,cs,3,3,"td",23),S(4,ds,3,3,"td",23),S(5,us,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 gs(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,ps,2,0,"th",19),S(7,ms,2,0,"th",20),S(8,ss,2,0,"th",21),a()(),n(9,"tbody",22),G(10,_s,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=C}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,C);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,C);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,C);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,C);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,rs,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By 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,ls,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,gs,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,ts)),o(3),c("routerLink",M(13,is)),o(3),c("routerLink",M(14,ns)),o(3),c("routerLink",M(15,as)),o(3),c("routerLink",M(16,os)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ys=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Ds=i=>({ID:i}),vs=(i,s,e)=>({From:i,SupplierID:s,To:e});function ws(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 Ts(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 Ps(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,ys))("queryParams",X(20,Ds,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,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 Fs(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 Is(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,Ps,17,27,"tr",24,Y),a(),S(17,Fs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,C);case"Supplier":return this.compare(t.Name,l.Name,C);case"Code":return this.compare(t.Code,l.Code,C);case"Quantity":return this.compare(t.Quantity,l.Quantity,C);case"Total":return this.compare(t.Total,l.Total,C);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ws,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,Ts,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Is,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,Cs)),o(3),c("routerLink",M(14,fs)),o(3),c("routerLink",M(15,xs)),o(3),c("routerLink",M(16,hs)),o(3),c("routerLink",M(17,Ss)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ms=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Rs=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),ks=i=>[i],Ws=i=>({ID:i}),Ns=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],As=(i,s,e)=>({VariantID:i,From:s,To:e}),Gs=(i,s,e)=>({ProductID:i,From:s,To:e});function Hs(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Rs,(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 Qs(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 Ys(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 js(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 qs(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 Us(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function zs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ks(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Xs(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 Js(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Zs(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 $s(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function e0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function t0(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 i0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,C=m(2);return _(C.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function n0(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 a0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,Ns,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 o0(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 r0(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 l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function p0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,As,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 m0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Gs,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 s0(i,s){if(i&1&&(n(0,"td",75),E(1,p0,5,16,"a",78)(2,m0,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 c0(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 d0(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 u0(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 _0(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 g0(i,s){if(i&1&&(n(0,"tr",60),E(1,t0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,i0,2,1,"ng-container",8)(8,n0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,a0,4,11,"td",67)(15,o0,3,3,"td",67)(16,r0,3,3,"td",68)(17,l0,3,3,"td",67)(18,s0,3,2,"td",67)(19,c0,3,3,"td",69)(20,d0,3,3,"td",67)(21,u0,3,4,"td",70)(22,_0,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,ks,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,Ws,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 C0(i,s){i&1&&b(0,"td",75)}function f0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function x0(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 h0(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 S0(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 y0(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 D0(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 w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function T0(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 P0(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 F0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,C0,1,0,"td",67)(4,f0,2,0,"td",67)(5,x0,4,6,"td",67)(6,h0,4,6,"td",67)(7,S0,4,6,"td",68)(8,y0,4,6,"td",67)(9,D0,5,6,"td",82)(10,v0,5,6,"td",69)(11,w0,5,6,"td",82)(12,T0,5,10,"td",70)(13,P0,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 I0(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,js,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,qs,2,1,"th",37)(12,Us,2,0,"th",38)(13,zs,2,0,"th",39)(14,Ks,2,0,"th",40)(15,Xs,2,1,"th",41)(16,Js,2,0,"th",42)(17,Zs,2,1,"th",43)(18,$s,2,0,"th",44)(19,e0,2,0,"th",45),a()(),n(20,"tbody"),E(21,g0,23,21,"tr",46),a(),E(22,F0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,C,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,C);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=C;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),C);case"Quantity":return V.compare(t.Quantity,l.Quantity,C);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,C);case"Inventory":return V.compare(t.OnHand,l.OnHand,C);case"Total_Sales":return V.compare(t.Total,l.Total,C);case"Total_Tax":return V.compare(t.Tax,l.Tax,C);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,C);case"ReOrder":return V.compare(t.MinStock,l.MinStock,C);case"Gross":return V.compare(t.Gross,l.Gross,C);case"Margin":return V.compare(t.Margin,l.Margin,C);case"Profit":return V.compare(t.Profit,l.Profit,C);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Hs,3,7,"a",2),S(3,Qs,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,Ys,45,36,"ng-template",null,0,O),a(),E(29,I0,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,Es)),o(3),c("routerLink",M(15,Ms)),o(3),c("routerLink",M(16,Vs)),o(3),c("routerLink",M(17,Bs)),o(3),c("routerLink",M(18,Os)),o(3),c("routerLink",M(19,Ls)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],M0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],R0=i=>({ID:i}),k0=(i,s)=>s.Name,W0=(i,s)=>s.ID;function N0(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 A0(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 G0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function H0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function Q0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function Y0(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 j0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function q0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function U0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function z0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function K0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function X0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function J0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,q0,2,3,"td",33),S(5,U0,3,5,"td",33),S(6,z0,3,5,"td",33),G(7,K0,2,1,"td",14,Yi),S(9,X0,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,R0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,N0,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,A0,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,G0,2,2,"th",11),S(36,H0,2,2,"th",12),S(37,Q0,2,2,"th",12),G(38,Y0,2,3,"th",13,k0),S(40,j0,2,0,"th",14),a()(),n(41,"tbody"),G(42,J0,10,9,"tr",15,W0),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,E0)),o(3),c("routerLink",M(17,M0)),o(3),c("routerLink",M(18,V0)),o(3),c("routerLink",M(19,B0)),o(3),c("routerLink",M(20,O0)),o(3),c("routerLink",M(21,L0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var Z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),ac=i=>[i],oc=i=>({ID:i});function rc(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 lc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),h("selectedCategoryIDChange",function(t){u(e);let l=m();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),h("ngModelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),f("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),f("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),f("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),f("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function pc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function mc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function sc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function cc(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 dc(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function uc(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,ac,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,oc,e.ID)),o(),D(" ",e.Name," ")}}function _c(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function gc(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 Cc(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 fc(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 xc(i,s){if(i&1&&(n(0,"tr"),S(1,uc,3,7,"td"),S(2,_c,2,1,"td"),S(3,gc,4,4,"td",29),E(4,Cc,3,4,"td",30),S(5,fc,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 hc(i,s){i&1&&b(0,"td")}function Sc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function yc(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 Dc(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 wc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,hc,1,0,"td"),S(3,Sc,2,0,"td",29),S(4,yc,3,4,"td",29),E(5,Dc,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 $n=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),C);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),C);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",C=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(C),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,rc,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,lc,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,pc,2,0,"th",11),S(34,mc,2,0,"th",12),S(35,sc,3,0,"th",13),E(36,cc,2,1,"th",14),S(37,dc,3,0,"th",13),a()(),n(38,"tbody"),E(39,xc,6,5,"tr",15),a(),E(40,wc,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,Z0)),o(3),c("routerLink",M(20,$0)),o(3),c("routerLink",M(21,ec)),o(3),c("routerLink",M(22,tc)),o(3),c("routerLink",M(23,ic)),o(3),c("routerLink",M(24,nc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Pc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Mc=i=>[i],Vc=i=>({ID:i});function Bc(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 Oc(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 Lc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Rc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,Lc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function kc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Wc(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,Mc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Vc,r[1])),o(),F(r[e])}}function Nc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Ac(i,s){if(i&1&&(n(0,"td",11),S(1,Wc,2,7,"a",23)(2,Nc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Gc(i,s){if(i&1&&(n(0,"tr",11),G(1,Ac,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Bc,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,Oc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Rc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,kc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Gc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),f("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Tc)),o(3),c("routerLink",M(13,Pc)),o(3),c("routerLink",M(14,Fc)),o(3),c("routerLink",M(15,Ic)),o(3),c("routerLink",M(16,bc)),o(3),c("routerLink",M(17,Ec)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],jc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Uc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function zc(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 Kc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Xc(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,Kc,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(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),h("modelChange",function(t){u(e);let l=m();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),f("ngModel",e.pageData.Filter.ListIDs),o(3),f("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),f("ngModel",e.pageData.Filter.BrandID),o(5),f("date",e.pageData.Filter.From),o(2),f("date",e.pageData.Filter.To),o(3),f("ngModel",e.pageData.Filter.SalesID),o(3),f("ngModel",e.pageData.Filter.CustomerID),o(3),f("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),f("model",e.pageData.Filter.ExcludeZero),o(3),f("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Jc(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function Zc(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function $c(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function ed(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,Jc,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,Zc,3,0,"th",41)(18,$c,3,0,"th",42),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 td(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),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 id(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),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 nd(i,s){if(i&1&&(n(0,"span",23),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 ad(i,s){if(i&1&&(n(0,"td"),E(1,nd,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function od(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,td,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,id,6,9,"td",56)(34,ad,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,qc,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,Uc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function rd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function ld(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function pd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function md(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,rd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,ld,3,3,"td",62)(18,pd,3,3,"td",64),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 sd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,ed,19,3,"ng-template",26)(4,od,35,65,"ng-template",27)(5,md,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,jc))}}var ta=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["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,zc,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,Xc,32,17,"ng-template",null,0,O),a(),E(19,sd,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,Hc)),o(3),c("routerLink",M(11,Qc)),o(3),c("routerLink",M(12,Yc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var cd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],dd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function _d(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 gd(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 Cd(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 fd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function xd(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 hd(i,s){if(i&1&&(n(0,"td"),S(1,fd,2,1,"span"),S(2,xd,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 Sd(i,s){if(i&1&&(n(0,"tr"),G(1,hd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function yd(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 Dd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,yd,3,3,"td",null,Y),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,Cd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Sd,3,0,"tr",null,Y),a(),S(9,Dd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let C=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,C)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,_d,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," 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,gd,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,cd)),o(3),c("routerLink",M(11,dd)),o(3),c("routerLink",M(12,ud)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var wd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Td=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Fd(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 Id(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),h("textChange",function(T){return u(l),x(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,Fd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Id,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,wd)),o(3),c("routerLink",M(9,Td)),o(3),c("routerLink",M(10,Pd)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var bd=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Ed(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 Md(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let C={name:l.Name+": "+l.Description,y:l.Transaction};t.push(C)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,C){return l+"<br/>"+C.series.name+": <b>"+C.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Ed,13,9,"ng-template",null,0,O),a(),S(8,Md,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,bd)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Vd(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 Bd(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 Od(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 Ld(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,Od,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,C){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Vd,3,0,"a",2),a(),n(3,"filters"),E(4,Bd,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,Ld,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),f("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Rd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function kd(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 Wd(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 Nd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Ad(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 Gd(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,Ad,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 Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,C){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=C}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(T){return u(l),x(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,kd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Wd,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,Nd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Gd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Hd,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,Rd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var Qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),Yd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function qd(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 Ud(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};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,qd,13,11,"ng-template",null,0,O),a(),S(18,Ud,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,Qd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,Yd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,jd))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var Jd={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:Jd}])],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=Tt(4);return _(r.chosenYearHandler(C,T))})("monthSelected",function(C){u(t);let T=Tt(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=Tt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2})};var $d=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function eu(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 tu(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ma=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ze=>this.series?.name==Ze?.name);let l=[],C="",T=this.point.index;return r.forEach(Ze=>{Ze.options.stack===this.point.series.options.stack&&(l=Ze.name.split(" "),C+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}: