dealpos 25.44.2 → 25.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/browser/{chunk-J2QBKYVZ.js → chunk-2CXL6IDS.js} +1 -1
  2. package/browser/{chunk-J7JOV2UE.js → chunk-2GALXGGK.js} +1 -1
  3. package/browser/{chunk-CLIFAF7L.js → chunk-2HLP4RJY.js} +2 -2
  4. package/browser/{chunk-XMABGEYA.js → chunk-42NBSIMT.js} +1 -1
  5. package/browser/{chunk-AXITAME4.js → chunk-4XV2ANDU.js} +1 -1
  6. package/browser/{chunk-OGM6TARA.js → chunk-57UEET7E.js} +2 -2
  7. package/browser/{chunk-PW7JCR65.js → chunk-5FSR4IZJ.js} +1 -1
  8. package/browser/{chunk-JXNDVG64.js → chunk-6XO6NT6E.js} +1 -1
  9. package/browser/{chunk-W5EJQZB4.js → chunk-7LEIOTZN.js} +1 -1
  10. package/browser/{chunk-CW2D4XVM.js → chunk-7QZ26SB7.js} +1 -1
  11. package/browser/{chunk-7M35JNER.js → chunk-A3JFNOMC.js} +1 -1
  12. package/browser/{chunk-DHQWJAOX.js → chunk-ABOGLWVN.js} +1 -1
  13. package/browser/{chunk-KAJ5NYU6.js → chunk-AJM4N35T.js} +1 -1
  14. package/browser/{chunk-MS67N3VC.js → chunk-BKK7PT4Q.js} +1 -1
  15. package/browser/{chunk-BA64MIHJ.js → chunk-BLSJR63P.js} +1 -1
  16. package/browser/{chunk-T6TPCDSC.js → chunk-BXSCBMI2.js} +1 -1
  17. package/browser/{chunk-7QOZKOAW.js → chunk-CDCIW4H7.js} +1 -1
  18. package/browser/{chunk-4WAY7P2M.js → chunk-CXKH3Y7Q.js} +1 -1
  19. package/browser/{chunk-APFUVBFJ.js → chunk-DDJ6XGOR.js} +1 -1
  20. package/browser/{chunk-QPS677LS.js → chunk-DK2SUVKT.js} +1 -1
  21. package/browser/{chunk-5E64BHHD.js → chunk-DOYS2PZE.js} +1 -1
  22. package/browser/{chunk-RUFSPHPN.js → chunk-DTFMCXRP.js} +1 -1
  23. package/browser/{chunk-Y3YIK27D.js → chunk-DWZ6HNBA.js} +1 -1
  24. package/browser/{chunk-ZIUOCAE2.js → chunk-EGRFS63E.js} +1 -1
  25. package/browser/{chunk-PJTFJKGS.js → chunk-EIYVPVSH.js} +1 -1
  26. package/browser/{chunk-PMEWJS46.js → chunk-EKX3MMTJ.js} +1 -1
  27. package/browser/{chunk-3FD5W6K2.js → chunk-ESMCBLSB.js} +2 -2
  28. package/browser/{chunk-YH3UWFOD.js → chunk-EUY2EQVP.js} +1 -1
  29. package/browser/{chunk-SPTLCHEU.js → chunk-EY2BEKKH.js} +1 -1
  30. package/browser/{chunk-CT7VQIZ7.js → chunk-FDFNWO3I.js} +1 -1
  31. package/browser/{chunk-YR223T2R.js → chunk-FEHHVG4G.js} +2 -2
  32. package/browser/{chunk-QMBZSWSZ.js → chunk-FEW55RO5.js} +1 -1
  33. package/browser/{chunk-2X7JXLPO.js → chunk-FTRVMNGV.js} +1 -1
  34. package/browser/{chunk-CFDWM2SO.js → chunk-GGOZMZWR.js} +1 -1
  35. package/browser/{chunk-PKT3SIRZ.js → chunk-GKFPNF3O.js} +1 -1
  36. package/browser/{chunk-BO6JXHTU.js → chunk-GN6RJLLA.js} +1 -1
  37. package/browser/{chunk-ODOX327P.js → chunk-GQO3Q75J.js} +1 -1
  38. package/browser/{chunk-NHKASBAN.js → chunk-GUURROIV.js} +1 -1
  39. package/browser/{chunk-DTWCNQ4N.js → chunk-HRDXDHQN.js} +2 -2
  40. package/browser/{chunk-M57BBETM.js → chunk-IYV6WHO4.js} +1 -1
  41. package/browser/{chunk-XFP34FRB.js → chunk-J4HLBSTR.js} +1 -1
  42. package/browser/{chunk-XMABJJGK.js → chunk-JMQDEPZK.js} +1 -1
  43. package/browser/{chunk-3UXPJWJQ.js → chunk-JUYFABKK.js} +1 -1
  44. package/browser/{chunk-655R7PDY.js → chunk-K7BQAEUZ.js} +1 -1
  45. package/browser/{chunk-WM2ISZEL.js → chunk-KH3Y6E5S.js} +1 -1
  46. package/browser/{chunk-AAX2TBEM.js → chunk-LAJ6WFQN.js} +1 -1
  47. package/browser/{chunk-QR4VV4GM.js → chunk-LED2YGBL.js} +1 -1
  48. package/browser/{chunk-UKFG66EY.js → chunk-LKII7K7T.js} +1 -1
  49. package/browser/{chunk-J2HRW2OD.js → chunk-LKXAGCSU.js} +1 -1
  50. package/browser/{chunk-2RZHUSQU.js → chunk-LQ63SW7R.js} +1 -1
  51. package/browser/{chunk-5XINUUVX.js → chunk-MB5ABPXA.js} +2 -2
  52. package/browser/{chunk-PLZ3ODXT.js → chunk-MBJ5EVQM.js} +1 -1
  53. package/browser/{chunk-2ZDXMF6S.js → chunk-MBRMFZQD.js} +1 -1
  54. package/browser/{chunk-CMAE52E3.js → chunk-MJYYXEWE.js} +1 -1
  55. package/browser/{chunk-D4G24QCQ.js → chunk-ML4F7QSG.js} +1 -1
  56. package/browser/{chunk-3Q3FUJ44.js → chunk-MO4GVGHJ.js} +1 -1
  57. package/browser/{chunk-IJVIVNVH.js → chunk-MPCAKU6Y.js} +1 -1
  58. package/browser/{chunk-OZG5SOW6.js → chunk-NMBTXI33.js} +1 -1
  59. package/browser/{chunk-O35SSVC5.js → chunk-PDDA2XEV.js} +1 -1
  60. package/browser/{chunk-V77ELRLY.js → chunk-PKRB5QHY.js} +1 -1
  61. package/browser/{chunk-P63I2MBK.js → chunk-PMFQUQRF.js} +1 -1
  62. package/browser/{chunk-YCTTD62Z.js → chunk-QO6OCZ2F.js} +2 -2
  63. package/browser/{chunk-53I2NSFZ.js → chunk-RDMLIBMG.js} +1 -1
  64. package/browser/{chunk-6PSJSHPW.js → chunk-RJEOTZXL.js} +1 -1
  65. package/browser/{chunk-BC4RWXWV.js → chunk-S5QHJZP7.js} +1 -1
  66. package/browser/{chunk-SAAWSHJS.js → chunk-SJIRHP7T.js} +1 -1
  67. package/browser/{chunk-EPUDCYJW.js → chunk-SXKMJUZG.js} +1 -1
  68. package/browser/{chunk-CKNSQS62.js → chunk-T4LU2Z4H.js} +1 -1
  69. package/browser/chunk-UGRZNVJI.js +1 -0
  70. package/browser/{chunk-SZ7M2HSN.js → chunk-UTP22HZJ.js} +1 -1
  71. package/browser/{chunk-ZJHWFDGD.js → chunk-V3Y7QS6E.js} +1 -1
  72. package/browser/{chunk-SCB5WW4J.js → chunk-VHLIFXL2.js} +1 -1
  73. package/browser/{chunk-BSFKTGRH.js → chunk-VK6JMOTL.js} +1 -1
  74. package/browser/{chunk-34KJ7YHX.js → chunk-VPQTKMSG.js} +1 -1
  75. package/browser/{chunk-FOF7BQHC.js → chunk-VTUDAX3L.js} +1 -1
  76. package/browser/{chunk-AUTKQFDZ.js → chunk-WEZJHAOW.js} +1 -1
  77. package/browser/{chunk-RW5SHW7P.js → chunk-WOQG2RJS.js} +1 -1
  78. package/browser/{chunk-ZIT77RS6.js → chunk-WTXHMI64.js} +2 -2
  79. package/browser/{chunk-VFEOT7L6.js → chunk-XM2Q4S3I.js} +1 -1
  80. package/browser/{chunk-YV6PGG6H.js → chunk-YPHODEQB.js} +1 -1
  81. package/browser/{chunk-RKZPHRAC.js → chunk-YTS3IROV.js} +1 -1
  82. package/browser/{chunk-47RLR2PC.js → chunk-ZB4A4IBA.js} +1 -1
  83. package/browser/index.html +2 -2
  84. package/browser/{main-4NFW4OXW.js → main-CNAQ374V.js} +2 -2
  85. package/package.json +1 -1
  86. package/browser/chunk-OTEI4GZK.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ni,b as gr}from"./chunk-NVWJ6HZD.js";import{a as xr,b as hr}from"./chunk-SEFALU4U.js";import{a as Sr}from"./chunk-J2HRW2OD.js";import"./chunk-4NHG4RRM.js";import{a as Mt,b as fr}from"./chunk-KHILQH3P.js";import{a as Ht,b as Cr}from"./chunk-FRDFUCRO.js";import"./chunk-YAFVFDTG.js";import{a as _r}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-TAVO3B4U.js";import{a as he}from"./chunk-O35SSVC5.js";import{a as je}from"./chunk-4JM455M6.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as ht}from"./chunk-OXQJYOVG.js";import{a as Wo}from"./chunk-5HX73JZ3.js";import{b as Ho}from"./chunk-EOVI4KWG.js";import"./chunk-XJ7SOVB2.js";import{a as yn}from"./chunk-M57BBETM.js";import"./chunk-DAIHPIA2.js";import{a as ur}from"./chunk-BXQFYW4R.js";import{a as mr,b as sr,d as cr,g as dr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{a as Di}from"./chunk-XKUQPHUA.js";import{a as tr,b as ir}from"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Go}from"./chunk-RHUDY63D.js";import{a as nr,b as ar,c as or,d as rr,e as lr,f as pr}from"./chunk-XMABGEYA.js";import"./chunk-B5SDXVDR.js";import"./chunk-QMBZSWSZ.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Si,b as er,c as Sn,d as K,e as yi}from"./chunk-GIDGCFLX.js";import{a as cn,b as fi}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{c as Ao,d as De,e as hn}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as z}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-PLZ3ODXT.js";import{a as oe,b as ge,c as ko}from"./chunk-VQBXUZ6U.js";import{a as Et,b as $o}from"./chunk-BBGWXLHJ.js";import{d as Xo,f as fe}from"./chunk-UKFG66EY.js";import{a as Jo,b as Zo,c as Q}from"./chunk-JXNDVG64.js";import{b as q}from"./chunk-QHBWVJIQ.js";import{a as ne}from"./chunk-IJVIVNVH.js";import{a as Ro}from"./chunk-KAJ5NYU6.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-BA64MIHJ.js";import"./chunk-2RZHUSQU.js";import"./chunk-5JJSLRVS.js";import{c as Qo}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Yo,c as Ye}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as zo}from"./chunk-ZJHWFDGD.js";import{b as W}from"./chunk-SPTLCHEU.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as No,u as Ci,v as ei,w as _n}from"./chunk-H7F34T25.js";import{b as ae,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as Uo,C as ti,K as xi,N as Ko,g as re,o as jo,s as gn,z as qo}from"./chunk-TSIYPTYI.js";import{a as un,d as X}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Oo,b as Lo}from"./chunk-VFTGIP5A.js";import{a as Bo}from"./chunk-LE3BKIDY.js";import{a as Oi}from"./chunk-2FWFPV5I.js";import{la as Mo,ma as Zi,ua as Vo}from"./chunk-EEEAUYZ6.js";import{F as Gt,G as Xi,a as Po,b as Fo,c as We,h as B,l as Io,o as L,q as bo,s as Eo}from"./chunk-RVXZOIFQ.js";import"./chunk-PW7JCR65.js";import"./chunk-XMABJJGK.js";import{a as M,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-QPS677LS.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as ot,E as ri,Eb as Xa,Fa as Gi,Fc as V,Gb as Mi,Hb as Vi,I as bi,Ib as n,Jb as a,K as so,Kb as I,Kc as yo,Lb as se,M as co,Ma as st,Mb as ce,Mc as Ui,Nb as ho,Nc as Do,Ob as F,Od as Oe,Pc as Ja,Q as Ni,Qb as T,Qc as vo,Qd as zi,Rb as s,Rd as A,Td as Bi,Ub as ut,Va as Pe,Vd as Qe,Wa as Hi,Wc as He,Y as kt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ka,ad as wo,cd as Ki,db as v,dc as Ze,ec as p,ed as ee,fa as Wt,fc as P,gc as D,gd as ie,hc as Xt,ia as uo,ib as go,ja as _o,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,mb as fo,na as Re,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as ct,u as Ua,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as Co,wc as So,wd as To,xb as Ei,za,zb as xo,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as gl,g as At}from"./chunk-7DCB7DB2.js";var oo=gl((kb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,St,_t){let Bt=(_t-f)*(w-l)-(Ee-f)*(St-l);return Bt>0||!(Bt<0)}function t(l,f,w,Ee,St,_t,Bt,Nt){return r(l,f,St,_t,Bt,Nt)!==r(w,Ee,St,_t,Bt,Nt)&&r(l,f,w,Ee,St,_t)!==r(l,f,w,Ee,Bt,Nt)}return{boxIntersectLine:function(l,f,w,Ee,St,_t,Bt,Nt){return t(l,f,l+w,f,St,_t,Bt,Nt)||t(l+w,f,l+w,f+Ee,St,_t,Bt,Nt)||t(l,f+Ee,l+w,f+Ee,St,_t,Bt,Nt)||t(l,f,l,f+Ee,St,_t,Bt,Nt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,St){let{animObject:_t}=r,{format:Bt}=t,{setOptions:Nt}=l,{composed:ml}=f,{boxIntersectLine:ro,intersectRect:sl}=Ee,{addEvent:lo,extend:po,fireEvent:cl,isNumber:ki,pick:Ut,pushUnique:dl,syncTimeout:ul}=St;function pi(dt,Me,at,we,Ft){let it=dt.chart,$=dt.options.label||{},ze=Ut($.onArea,!!dt.area),qe=ze||$.connectorAllowed,pt=it.boxesToAvoid,Ot=Number.MAX_VALUE,It=Number.MAX_VALUE,yt,gt,ft,Kt,bt,Xe,Ie;for(Xe=0;pt&&Xe<pt.length;Xe+=1)if(sl(pt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let rt=it.series[Xe],Ve=rt.interpolatedPoints&&[...rt.interpolatedPoints];if(rt.visible&&Ve){let Ke=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ke)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(Ie=1;Ie<Ve.length;Ie+=1){if(Ve[Ie].chartX>=Me-16&&Ve[Ie-1].chartX<=Me+we.width+16){if(ro(Me,at,we.width,we.height,Ve[Ie-1].chartX,Ve[Ie-1].chartY,Ve[Ie].chartX,Ve[Ie].chartY))return!1;dt===rt&&!ft&&Ft&&(ft=ro(Me-16,at-16,we.width+32,we.height+32,Ve[Ie-1].chartX,Ve[Ie-1].chartY,Ve[Ie].chartX,Ve[Ie].chartY))}(qe||ft)&&(dt!==rt||ze)&&(Ot=Math.min(Ot,(Kt=Me+we.width/2-Ve[Ie].chartX)*Kt+(bt=at+we.height/2-Ve[Ie].chartY)*bt))}if(!ze&&qe&&dt===rt&&(Ft&&!ft||Ot<Math.pow($.connectorNeighbourDistance||1,2))){for(Ie=1;Ie<Ve.length;Ie+=1)(yt=Math.min(Math.pow(Me+we.width/2-Ve[Ie].chartX,2)+Math.pow(at+we.height/2-Ve[Ie].chartY,2),Math.pow(Me-Ve[Ie].chartX,2)+Math.pow(at-Ve[Ie].chartY,2),Math.pow(Me+we.width-Ve[Ie].chartX,2)+Math.pow(at-Ve[Ie].chartY,2),Math.pow(Me+we.width-Ve[Ie].chartX,2)+Math.pow(at+we.height-Ve[Ie].chartY,2),Math.pow(Me-Ve[Ie].chartX,2)+Math.pow(at+we.height-Ve[Ie].chartY,2)))<It&&(It=yt,gt=Ve[Ie]);ft=!0}}}return(!Ft||!!ft)&&{x:Me,y:at,weight:Ot-(gt?It:0),connectorPoint:gt}}function mo(dt){if(this.renderer){let Me=this,at=_t(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&St.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Ft=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Ft.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Ft.minFontSize&&Ft.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,qe)=>(ze||0)+(qe||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),dt.type==="load"&&(at=Math.max(at,_t(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ul(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Ft=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(qe=>{let{width:pt,height:Ot}=qe.getBBox(),It=(qe.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),yt=(qe.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:It,top:yt,right:It+pt,bottom:yt+Ot})}))),Ft.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(qe){let pt,Ot,It,yt,gt;if(!qe.xAxis&&!qe.yAxis)return;let ft=qe.points,Kt=[],bt=qe.graph||qe.area,Xe=bt&&bt.element,Ie=qe.chart.inverted,rt=qe.xAxis,Ve=qe.yAxis,Ke=Ie?Ve.pos:rt.pos,$e=Ie?rt.pos:Ve.pos,wt=Ie?rt.len:Ve.len,Ii=Ie?Ve.len:rt.len,Ct=Ut((qe.options.label||{}).onArea,!!qe.area),Ge=Ve.getThreshold(qe.options.threshold),Tt={},zt=Ie?"chartCenterX":"chartCenterY";function oi(nt){let Dt=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);Tt[Dt]||(Tt[Dt]=1,Kt.push(nt))}if(qe.getPointSpline&&Xe&&Xe.getPointAtLength&&!Ct&&ft.length<(qe.chart.plotSizeX||0)/16){let nt=bt.toD&&bt.attr("d");for(bt.toD&&bt.attr({d:bt.toD}),It=Xe.getTotalLength(),pt=0;pt<It;pt+=16){let Rt=Xe.getPointAtLength(pt),xt=Ie?Ii-Rt.y:Rt.x,mt=Ie?wt-Rt.x:Rt.y;oi({chartX:Ke+xt,chartY:$e+mt,plotX:xt,plotY:mt})}nt&&bt.attr({d:nt});let Dt=ft[ft.length-1].pos();oi({chartX:Ke+(Dt?.[0]||0),chartY:$e+(Dt?.[1]||0)})}else{let nt;for(pt=0,It=ft.length;pt<It;pt+=1){let Dt=ft[pt],[Rt,xt]=Dt.pos()||[],{plotHigh:mt}=Dt;if(ki(Rt)&&ki(xt)){let lt={plotX:Rt,plotY:xt,chartX:Ke+Rt,chartY:$e+xt};if(Ct&&(mt&&(lt.plotY=mt,lt.chartY=$e+mt),Ie?lt.chartCenterX=Ke+Ii-((mt||Dt.plotY||0)+Ut(Dt.yBottom,Ge))/2:lt.chartCenterY=$e+((mt||xt)+Ut(Dt.yBottom,Ge))/2),nt&&(Ot=Math.max(Math.abs(lt.chartX-nt.chartX),Math.abs(lt.chartY-nt.chartY)))>16)for(gt=1,yt=Math.ceil(Ot/16);gt<yt;gt+=1)oi({chartX:nt.chartX+(lt.chartX-nt.chartX)*(gt/yt),chartY:nt.chartY+(lt.chartY-nt.chartY)*(gt/yt),[zt]:(nt[zt]||0)+((lt[zt]||0)-(nt[zt]||0))*(gt/yt),plotX:(nt.plotX||0)+(Rt-(nt.plotX||0))*(gt/yt),plotY:(nt.plotY||0)+(xt-(nt.plotY||0))*(gt/yt)});oi(lt),nt=lt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let qe="highcharts-color-"+Ut($.colorIndex,"none"),pt=!$.labelBySeries,Ot=ze.minFontSize,It=ze.maxFontSize,yt=we.inverted,gt=yt?$.yAxis.pos:$.xAxis.pos,ft=yt?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,bt=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,Ie=Ut(ze.onArea,!!$.area),rt=[],Ve=$.xData||[],Ke,$e,wt,Ii,Ct,Ge,Tt=$.labelBySeries,zt,oi,nt;function Dt(xt,mt,lt){let Wi=Math.max(gt,Ut(oi,-1/0)),mi=Math.min(gt+Kt,Ut(nt,1/0));return xt>Wi&&xt<=mi-lt.width&&mt>=ft&&mt<=ft+bt-lt.height}function Rt(){Tt&&($.labelBySeries=Tt.destroy())}if(Ie&&!yt&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!Tt){let xt=$.name;if(typeof ze.format=="string"?xt=Bt(ze.format,$,we):ze.formatter&&(xt=ze.formatter.call($)),$.labelBySeries=Tt=we.renderer.label(xt,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+qe),!we.renderer.styledMode){let mt=typeof $.color=="string"?$.color:"#666666";Tt.css(po({color:Ie?we.renderer.getContrast(mt):mt},ze.style||{})),Tt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Ot&&It&&Tt.css({fontSize:Ot+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(It-Ot)+"px"}),Tt.attr({padding:0,zIndex:3}).add()}for((Ke=Tt.getBBox()).width=Math.round(Ke.width),Ct=Xe.length-1;Ct>0;Ct-=1)Ie?Dt($e=(Xe[Ct].chartCenterX??Xe[Ct].chartX)-Ke.width/2,wt=(Xe[Ct].chartCenterY??Xe[Ct].chartY)-Ke.height/2,Ke)&&(Ge=pi($,$e,wt,Ke)):(Dt($e=Xe[Ct].chartX+3,wt=Xe[Ct].chartY-Ke.height-3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX+3,wt=Xe[Ct].chartY+3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX-Ke.width-3,wt=Xe[Ct].chartY+3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX-Ke.width-3,wt=Xe[Ct].chartY-Ke.height-3,Ke)&&(Ge=pi($,$e,wt,Ke,!0))),Ge&&rt.push(Ge);if(ze.connectorAllowed&&!rt.length&&!Ie)for($e=gt+Kt-Ke.width;$e>=gt;$e-=16)for(wt=ft;wt<ft+bt-Ke.height;wt+=16)(Ii=pi($,$e,wt,Ke,!0))&&rt.push(Ii);if(rt.length){rt.sort((mt,lt)=>lt.weight-mt.weight),Ge=rt[0],(we.boxesToAvoid||[]).push({left:Ge.x,right:Ge.x+Ke.width,top:Ge.y,bottom:Ge.y+Ke.height});let xt=Math.sqrt(Math.pow(Math.abs(Ge.x-(Tt.x||0)),2)+Math.pow(Math.abs(Ge.y-(Tt.y||0)),2));if(xt&&$.labelBySeries){let mt,lt={opacity:we.renderer.forExport?1:0,x:Ge.x,y:Ge.y},Wi={opacity:1};xt<=10&&(Wi={x:lt.x,y:lt.y},lt={}),pt&&(mt=_t($.options.animation),mt.duration*=.2),$.labelBySeries.attr(po(lt,{anchorX:Ge.connectorPoint&&(Ge.connectorPoint.plotX||0)+gt,anchorY:Ge.connectorPoint&&(Ge.connectorPoint.plotY||0)+ft})).animate(Wi,mt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ge.x,chartY:Ge.y},!0);mi&&(Tt.closest=[mi,Ge.x-(mi.plotX||0),Ge.y-(mi.plotY||0)])}}else Rt()}else Rt()}),cl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function _l(dt,Me,at,we,Ft){let it=Ft&&Ft.anchorX,$=Ft&&Ft.anchorY,ze,qe,pt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(qe=Me-$)<0&&(qe=-we-qe),qe<at&&(pt=it<dt+at/2?qe:at-qe),$>Me+we?ze.push(["L",dt+pt,Me+we]):$<Me?ze.push(["L",dt+pt,Me]):it<dt?ze.push(["L",dt,Me+we/2]):it>dt+at&&ze.push(["L",dt+at,Me+we/2])),ze||[]}return{compose:function(dt,Me){dl(ml,"SeriesLabel")&&(lo(dt,"load",mo),lo(dt,"redraw",mo),Me.prototype.symbols.connector=_l,Nt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var yr=(i,c)=>({"text-success":i,"text-danger":c});function fl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),D(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function Cl(i,c){if(i&1){let e=F();n(0,"span",8),T("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),I(1,"i",9),a()}}function xl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),D(" ",C(8,2,e.Cost)," "),o(4),D(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function hl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,yr,e.Profit>0,e.Profit<0)),o(),D(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,yr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),D("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function Sl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),I(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),I(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,fl,4,4,"ng-container",6),d(25,"async"),g(26,Cl,2,0,"ng-template",null,0,V),a(),I(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),I(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),I(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),I(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),I(72,"td"),a(),g(73,xl,13,7,"ng-container",3)(74,hl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),P(C(9,12,e.Orders)),o(8),P(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),P(C(35,18,e.GrossSales)),o(9),D(" ",C(44,20,e.Discount)," "),o(4),D(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),P(C(55,25,e.Sales)),o(8),P(C(63,27,e.Tax)),o(8),P(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(kt())}static \u0275fac=function(e){return new(e||i)(v(O),v(G),v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),T("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,Sl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,z,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var yl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Dr=i=>({ID:i});function Dl(i,c){if(i&1){let e=F();n(0,"button",6),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function vl(i,c){if(i&1&&(n(0,"div",4),g(1,Dl,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function wl(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),I(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Tl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function Pl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.CustomerNameDisplay," - {0}"))}}function Fl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.SalesName," - Sales: {0}"))}}function Il(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),D(" "," - Profit: "+C(2,1,e.Profit)," ")}}function bl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function El(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Ml(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function Vl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Bl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Dr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Ol(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Ll(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Rl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Ol,2,1,"i",68),I(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,Ll,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),P(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(2),D(" ",C(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?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",C(26,17,e==null?null:e.Total)," ")}}function kl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",C(8,3,e.Amount)," ")}}function Wl(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),I(10,"small",49),d(11,"date"),g(12,Pl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,Fl,3,4,"span",3),a(),g(17,Il,3,3,"span",50)(18,bl,2,1,"i",53)(19,El,2,1,"span",54)(20,Ml,2,0,"span",3),a(),g(21,Vl,3,3,"ng-container",3)(22,Bl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Rl,27,19,"tr",58),a()(),n(28,"table",59),g(29,kl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,yl))("queryParams",U(24,Dr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number,""),o(2),D(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",r.isNotEmpty(e.CustomerNameDisplay)),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),D(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Nl(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Al(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Gl(i,c){if(i&1){let e=F();n(0,"div",4)(1,"a",85),T("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),I(2,"i",86),p(3," Next 100"),a()()}}function Hl(i,c){if(i&1){let e=F();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Tl,2,0,"th",34),n(15,"th",35),p(16,"@ Price"),a(),n(17,"th",32),p(18,"Disc."),a(),n(19,"th",35),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",36),g(24,Wl,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),T("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Nl,3,0,"span",43)(34,Al,3,3,"span",3),p(35),a()(),g(36,Gl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),D(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,r,t,l,f,w,Ee,St){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=St}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(ee),v(Oe),v(j),v(Qe),v(G))};static \u0275cmp=E({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"lh-base"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,vl,2,1,"div",2),a(),n(3,"filters"),g(4,wl,46,26,"ng-template",null,0,V),a(),g(6,Hl,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,ae,De,Le,Q,je,jo,gn,ie,ee,z,J],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[We,B,L,Ye,ei],encapsulation:2})};var Yl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vr=i=>({ID:i}),jl=()=>["/menu/Contacts/Contact/Customers/Info"],ql=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Ul(i,c){if(i&1){let e=F();n(0,"button",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Kl(i,c){if(i&1){let e=F();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function zl(i,c){if(i&1){let e=F();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Xl(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Kl,11,4,"ng-container",13)(19,zl,3,6,"ng-template",null,1,V),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function Jl(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Zl(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function $l(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function ep(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function tp(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function ip(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function np(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function ap(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function op(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function rp(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function lp(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function pp(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function mp(i,c){i&1&&I(0,"br")}function sp(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Note)}}function cp(i,c){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=s().$implicit;o(2),D(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",y(6,5,e.Created,"HH:mm")," ")}}function dp(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,jl))("queryParams",U(4,vr,e.CustomerID)),o(),P(e.CustomerName)}}function up(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function _p(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.Groups," ")}}function gp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.SalesName," ")}}function fp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Cost)," ")}}function Cp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Gross)," ")}}function xp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales)," ")}}function hp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Sp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SurchargeAmount)," ")}}function yp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SalesNSurcharge)," ")}}function Dp(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",ct(2,ql,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function vp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,mp,1,0,"br",4)(7,sp,2,1,"i",4),a(),g(8,cp,7,8,"td",4)(9,dp,3,6,"td",4)(10,up,3,4,"td")(11,_p,2,1,"td")(12,gp,2,1,"td",4)(13,fp,3,3,"td",68)(14,Cp,3,3,"td",69)(15,xp,3,3,"td",69)(16,hp,3,3,"td",70)(17,Sp,3,3,"td",69)(18,yp,3,3,"td",69)(19,Dp,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),P(e.EntityName),o(2),m("routerLink",b(18,Yl))("queryParams",U(19,vr,e.ID)),o(),D(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),ot(r.column.JoinDate.selected?10:-1),o(),ot(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function wp(i,c){i&1&&I(0,"td",79)}function Tp(i,c){i&1&&I(0,"td",79)}function Pp(i,c){i&1&&I(0,"td",79)}function Fp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Ip(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function bp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Ep(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function Mp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Vp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Bp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Op(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),I(2,"td",79),g(3,wp,1,0,"td",80)(4,Tp,1,0,"td",80)(5,Pp,1,0,"td",80)(6,Fp,2,0,"td",81)(7,Ip,4,6,"td",68)(8,bp,4,6,"td",69)(9,Ep,4,6,"td",69)(10,Mp,4,6,"td",70)(11,Vp,4,6,"td",69)(12,Bp,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Lp(i,c){if(i&1){let e=F();n(0,"div",38)(1,"table",39),T("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Jl,2,0,"th",43)(9,Zl,2,0,"th",44)(10,$l,2,0,"th",45)(11,ep,2,0,"th",46)(12,tp,2,0,"th",47)(13,ip,2,0,"th",48)(14,np,2,0,"th",49)(15,ap,2,0,"th",50)(16,op,2,0,"th",51)(17,rp,2,0,"th",52)(18,lp,2,0,"th",53)(19,pp,2,0,"th",54),a()(),n(20,"tbody"),g(21,vp,20,21,"tr",55),a(),g(22,Op,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),ot(e.column.JoinDate.selected?10:-1),o(),ot(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Rp(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function kp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Wp(i,c){if(i&1){let e=F();n(0,"a",85),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",86),p(2," Next"),a()}}function Np(i,c){if(i&1){let e=F();n(0,"a",87),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",88),p(2," Last"),a()}}function Ap(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Lp,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Rp,3,0,"span",34)(9,kp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Wp,3,0,"a",36)(13,Np,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),D(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=f}roleService=Re(G);columnService=Re(ht);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Oe),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Ul,3,0,"button",3),a(),n(3,"filters"),g(4,Xl,36,22,"ng-template",null,0,V),a(),g(6,Ap,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,X,K,We,B,L,ae,oe,ge,Ye,De,Le,Di,Q,je,re,ie,ee,z],encapsulation:2})};var Gp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Hp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Qp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Yp=i=>({ID:i}),jp=(i,c)=>({BrandID:i,Name:c});function qp(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export"),a()}}function Up(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Kp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function zp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function Xp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,zp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Qp))("queryParams",U(12,Yp,e.ID)),o(),D("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,jp,e.ID,e.BrandName)),o(),P(C(8,7,e.Quantity)),o(3),P(C(11,9,e.Total))}}function Jp(i,c){if(i&1){let e=F();n(0,"div",15)(1,"table",16),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Kp,2,0,"th",19),n(7,"th",20),p(8,"Sold"),a(),n(9,"th",21),p(10,"Total"),a()()(),n(11,"tbody"),g(12,Xp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),P(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),P(C(24,12,y(23,9,e.data.Data,"Total")))}}var Fn=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Oe),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,qp,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),g(14,Up,9,6,"ng-template",null,0,V),a(),n(16,"content"),g(17,Jp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Gp)),o(3),m("routerLink",b(9,Hp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,oe,ge,Q,re,z,J],encapsulation:2})};function Zp(i,c){if(i&1){let e=F();n(0,"label",3),T("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),I(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),P(e.Name)}}var In=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Zp,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var $p=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],am=()=>["/menu/Contacts/Contact/Customers/Info"],om=i=>({ID:i});function rm(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function lm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function pm(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function mm(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function sm(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function cm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function dm(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function um(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function _m(i,c){if(i&1){let e=F();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),T("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),P(r==0?"":" , "),o(2),P(e.GroupName)}}function gm(i,c){if(i&1&&(n(0,"span"),g(1,_m,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function fm(i,c){if(i&1){let e=F();n(0,"a",45),T("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Cm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Orders)," ")}}function xm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Quantity)," ")}}function hm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),D(" ",C(3,1,e.Cost)," ")}}function Sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales)," ")}}function ym(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Dm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales+e.Tax)," ")}}function vm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,gm,2,1,"span",25)(6,fm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,Cm,3,3,"td",43)(11,xm,3,3,"td",43)(12,hm,4,3,"ng-container",25)(13,Sm,3,3,"td",43)(14,ym,3,3,"td",44)(15,Dm,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,am))("queryParams",U(14,om,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function wm(i,c){if(i&1&&(n(0,"tbody",37),g(1,vm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Tm(i,c){if(i&1){let e=F();n(0,"div",17)(1,"div",18)(2,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,pm,2,0,"th",23)(10,mm,2,0,"th",24)(11,sm,3,0,"ng-container",25)(12,cm,2,0,"th",26)(13,dm,2,0,"th",27)(14,um,2,0,"th",28),a()(),g(15,wm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=Re(G);columnService=Re(ht);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(kt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(In,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(ee),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,rm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),I(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,lm,16,10,"ng-template",null,0,V),a(),n(26,"content"),g(27,Tm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,$p)),o(3),m("routerLink",b(13,em)),o(3),m("routerLink",b(14,tm)),o(3),m("routerLink",b(15,im)),o(4),m("routerLink",b(16,nm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,We,B,L,ae,oe,ge,Ye,Q,ii,ie,z,J],encapsulation:2})};var Pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Mm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Vm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Bm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),D(" ",e.Name," "),o(2),P(C(5,4,e.TotalOrders)),o(3),P(C(8,6,e.TotalCost)),o(3),P(C(11,8,e.TotalAmount))}}function Om(i,c){if(i&1&&(n(0,"tbody",24),g(1,Bm,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Lm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,Om,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j),v(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Mm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Vm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Lm,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Pm)),o(3),m("routerLink",b(12,Fm)),o(3),m("routerLink",b(13,Im)),o(3),m("routerLink",b(14,bm)),o(3),m("routerLink",b(15,Em)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,oe,ge,Q,ie,z],encapsulation:2})};var Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Gm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Hm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Ym(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function jm(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function qm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalOrders))}}function Um(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.TotalQuantity)," ")}}function Km(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalAmount))}}function zm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,qm,3,3,"td",28)(4,Um,3,3,"td",28)(5,Km,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),D(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function Xm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Qm,2,0,"th",20)(7,Ym,2,0,"th",21)(8,jm,2,0,"th",22),a()(),n(9,"tbody",23),g(10,zm,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Re(G);columnService=Re(ht);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(kt(1))}openExportModal(){this.matDialog.open(q,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(j),v(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[R],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 135px","mat-sort-header","Total","arrowPosition","before","class","flex-right",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","text-end",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Gm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Hm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Xm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Rm)),o(3),m("routerLink",b(13,km)),o(3),m("routerLink",b(14,Wm)),o(3),m("routerLink",b(15,Nm)),o(3),m("routerLink",b(16,Am)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,oe,ge,Q,ie,z,J],encapsulation:2})};var Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Zm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],$m=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],is=()=>["/menu/Contacts/Contact/Suppliers/Info"],ns=i=>({ID:i}),as=(i,c,e)=>({From:i,SupplierID:c,To:e});function os(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function rs(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function ls(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),P(e.Rank),o(2),m("routerLink",b(19,is))("queryParams",U(20,ns,e.SupplierID)),o(),P(e.Name),o(2),P(e.Code),o(2),D(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Tr))("queryParams",ct(23,as,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",C(16,17,e.Total),"")}}function ps(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),I(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),I(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),P(e.data.TotalQty),o(2),P(e.data.TotalSales)}}function ms(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,ls,17,27,"tr",25),a(),g(16,ps,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),ot((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,os,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,rs,16,10,"ng-template",null,0,V),a(),n(28,"content"),g(29,ms,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Tr)),o(3),m("routerLink",b(13,Jm)),o(3),m("routerLink",b(14,Zm)),o(3),m("routerLink",b(15,$m)),o(3),m("routerLink",b(16,es)),o(3),m("routerLink",b(17,ts)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,We,B,L,oe,ge,Ye,Q,ee,z,J],encapsulation:2})};var Pr=At(Si());var cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],_s=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],gs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Cs=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),xs=i=>[i],hs=i=>({ID:i}),Ss=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Fr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],ys=(i,c,e)=>({VariantID:i,From:c,To:e}),Ds=(i,c,e)=>({ProductID:i,From:c,To:e});function vs(i,c){if(i&1&&(n(0,"a",9),I(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,Cs,(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 ws(i,c){if(i&1){let e=F();n(0,"button",11),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function Ts(i,c){if(i&1){let e=F();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Ps(i,c){if(i&1){let e=F();n(0,"th",48)(1,"div",49)(2,"input",50),T("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function Fs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function Is(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function bs(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Es(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Ms(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Vs(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Bs(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Os(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Ls(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Rs(i,c){if(i&1){let e=F();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function ks(i,c){if(i&1){let e=F();se(0),n(1,"img",72),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Ws(i,c){if(i&1){let e=F();n(0,"a",73)(1,"img",74),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Ns(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",So(4,Ss,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(),P(C(3,2,r.Quantity))}}function As(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.OnHand)," ")}}function Gs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.UnitCost)," ")}}function Hs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Gross)," ")}}function Qs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Fr))("queryParams",ct(12,ys,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function Ys(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Fr))("queryParams",ct(12,Ds,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function js(i,c){if(i&1&&(n(0,"td",75),g(1,Qs,5,16,"a",78)(2,Ys,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function qs(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Us(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SalesNTax)," ")}}function Ks(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",C(2,2,e.Profit)," ")}}function zs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",C(2,2,e.Margin)," ")}}function Xs(i,c){if(i&1&&(n(0,"tr",60),g(1,Rs,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,ks,2,1,"ng-container",8)(8,Ws,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Ns,4,11,"td",67)(15,As,3,3,"td",67)(16,Gs,3,3,"td",68)(17,Hs,3,3,"td",67)(18,js,3,2,"td",67)(19,qs,3,3,"td",69)(20,Us,3,3,"td",67)(21,Ks,3,4,"td",70)(22,zs,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),P(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,xs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,hs,e.ID)),o(),P(e.Name),o(2),P(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Js(i,c){i&1&&I(0,"td",75)}function Zs(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function $s(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function e0(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function t0(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function i0(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function n0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function a0(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function o0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function r0(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function l0(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function p0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),I(2,"td",75),g(3,Js,1,0,"td",67)(4,Zs,2,0,"td",67)(5,$s,4,6,"td",67)(6,e0,4,6,"td",67)(7,t0,4,6,"td",68)(8,i0,4,6,"td",67)(9,n0,5,6,"td",82)(10,a0,5,6,"td",69)(11,o0,5,6,"td",82)(12,r0,5,10,"td",70)(13,l0,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function m0(i,c){if(i&1){let e=F();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,Ps,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,Fs,2,1,"th",37)(12,Is,2,0,"th",38)(13,bs,2,0,"th",39)(14,Es,2,0,"th",40)(15,Ms,2,1,"th",41)(16,Vs,2,0,"th",42)(17,Bs,2,1,"th",43)(18,Os,2,0,"th",44)(19,Ls,2,0,"th",45),a()(),n(20,"tbody"),g(21,Xs,23,21,"tr",46),a(),g(22,p0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Re(G);columnService=Re(ht);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=st([]);queryParams=st(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Oi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Je({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return M.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return M.compare(t.Total,l.Total,f);case"Total_Tax":return M.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return M.compare(t.MinStock,l.MinStock,f);case"Gross":return M.compare(t.Gross,l.Gross,f);case"Margin":return M.compare(t.Margin,l.Margin,f);case"Profit":return M.compare(t.Profit,l.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Pr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Qe),v(Oe),v(j),v(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,vs,3,7,"a",2)(3,ws,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),g(27,Ts,45,36,"ng-template",null,0,V),a(),g(29,m0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,cs)),o(3),m("routerLink",b(15,ds)),o(3),m("routerLink",b(16,us)),o(3),m("routerLink",b(17,_s)),o(3),m("routerLink",b(18,gs)),o(3),m("routerLink",b(19,fs)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,X,K,Fo,B,L,ae,oe,ge,De,Le,fe,Q,je,ii,re,ee,z,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],c0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],u0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],_0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],f0=i=>({ID:i});function C0(i,c){if(i&1){let e=F();n(0,"a",15),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function x0(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function h0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;ut("matTooltip",r.Name),o(),D(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function S0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),D(" ",e," ")}}function y0(i,c){if(i&1&&(n(0,"tr",28)(1,"td")(2,"a",29),p(3),a()(),n(4,"td",30),p(5),a(),g(6,S0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,f0,e.ID)),o(),D(" ",e.Name,""),o(2),P(e.Code),o(),m("ngForOf",e.Quantities),o(2),P(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(j),v(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[R],decls:42,vars:19,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"border-bottom"],[3,"routerLink","queryParams"],[2,"text-align","right"],["class","text-end",4,"ngFor","ngForOf"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,C0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,x0,25,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,h0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,y0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,s0)),o(3),m("routerLink",b(14,c0)),o(3),m("routerLink",b(15,d0)),o(3),m("routerLink",b(16,u0)),o(3),m("routerLink",b(17,_0)),o(3),m("routerLink",b(18,g0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,X,K,B,L,ae,De,Le,fe,Q,je],encapsulation:2})};var $a=At(Si());var D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ir=()=>({standalone:!0}),br=()=>({overflow:"visible"}),I0=i=>[i],b0=i=>({ID:i});function E0(i,c){if(i&1){let e=F();n(0,"a",17),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",18),p(2," Export"),a()}}function M0(i,c){if(i&1){let e=F();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListOutletID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(5),x("ngModel",e.pageData.Filter.MonthFrom),m("ngModelOptions",b(18,Ir))("contentStyle",b(19,br))("appendTo","body")("baseZIndex",99999),o(4),x("ngModel",e.pageData.Filter.MonthTo),m("ngModelOptions",b(20,Ir))("contentStyle",b(21,br))("appendTo","body")("baseZIndex",99999),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function V0(i,c){i&1&&(n(0,"th",11),p(1," Name "),a())}function B0(i,c){i&1&&(n(0,"th",12),p(1," Code "),a())}function O0(i,c){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function L0(i,c){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=c.$implicit,r=s();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function R0(i,c){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function k0(i,c){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=s().$implicit,r=s();o(),m("routerLink",U(3,I0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(5,b0,e.ID)),o(),D(" ",e.Name," ")}}function W0(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function N0(i,c){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=s().$implicit,r=s();o(2),D(" ",e.OnHand?y(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function A0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),D(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function G0(i,c){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=s().$implicit,r=s();o(2),D(" ",y(4,4,y(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function H0(i,c){if(i&1&&(n(0,"tr"),g(1,k0,3,7,"td")(2,W0,2,1,"td")(3,N0,4,4,"td",29)(4,A0,3,4,"td",30)(5,G0,5,7,"td",29),a()),i&2){let e=s();o(),ot(e.column.name.selected?1:-1),o(),ot(e.column.code.selected?2:-1),o(),ot(e.column.OnHand.selected?3:-1),o(),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(),ot(e.column.total.selected?5:-1)}}function Q0(i,c){i&1&&I(0,"td")}function Y0(i,c){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function j0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),D(" ",y(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function q0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),D(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function U0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),D(" ",y(3,4,y(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function K0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",32),g(2,Q0,1,0,"td")(3,Y0,2,0,"td",29)(4,j0,3,4,"td",29)(5,q0,3,4,"td",30)(6,U0,4,7,"td",29),a()()),i&2){let e=s();o(2),ot(e.column.name.selected?2:-1),o(),ot(e.column.code.selected?3:-1),o(),ot(e.column.OnHand.selected?4:-1),o(),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(),ot(e.column.total.selected?6:-1)}}var Ln=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date().getFullYear(),Ee=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(w,Ee)}_toastrService=Re(Qe);columnService=Re(ht);years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}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,$a.default)(this.pageData.Filter.MonthFrom),r=(0,$a.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",f=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(f),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)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[R],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=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.onSubmit())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,E0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,M0,19,22,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8),T("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr",10),g(33,V0,2,0,"th",11)(34,B0,2,0,"th",12)(35,O0,3,0,"th",13)(36,L0,2,1,"th",14)(37,R0,3,0,"th",13),a()(),n(38,"tbody"),g(39,H0,6,5,"tr",15),a(),g(40,K0,7,5,"tfoot",16),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(19,D0)),o(3),m("routerLink",b(20,v0)),o(3),m("routerLink",b(21,w0)),o(3),m("routerLink",b(22,T0)),o(3),m("routerLink",b(23,P0)),o(3),m("routerLink",b(24,F0)),o(10),ot(t.column.name.selected?33:-1),o(),ot(t.column.code.selected?34:-1),o(),ot(t.column.OnHand.selected?35:-1),o(),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(),ot(t.column.total.selected?37:-1),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,B,L,ae,oe,ge,De,fe,Q,tr,re,ie],encapsulation:2})};var z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],X0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],J0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],$0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],tc=i=>[i],ic=i=>({ID:i});function nc(i,c){if(i&1){let e=F();n(0,"button",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function ac(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function oc(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),P(e)}}function rc(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,oc,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function lc(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),D(" ",e,"")}}function pc(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,tc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,ic,r[1])),o(),P(r[e])}}function mc(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;D(" ",r[e]," ")}}function sc(i,c){if(i&1&&(n(0,"td",13),g(1,pc,3,7,"ng-container",28)(2,mc,1,1,"ng-template",null,1,V),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function cc(i,c){if(i&1&&(n(0,"tr",13),g(1,sc,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,nc,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Product Sold "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",7),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",7),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",7),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,ac,16,10,"ng-template",null,0,V),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,rc,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,lc,2,1,"th",14),a()(),n(39,"tbody"),g(40,cc,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,z0)),o(3),m("routerLink",b(15,X0)),o(3),m("routerLink",b(16,J0)),o(3),m("routerLink",b(17,Z0)),o(3),m("routerLink",b(18,$0)),o(3),m("routerLink",b(19,ec)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var dc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],uc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],_c=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],gc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Er=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],fc=(i,c,e)=>({CategoryID:i,From:c,To:e}),Cc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Mr=i=>({CategoryID:i});function xc(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function hc(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;ut("matTooltip",e.Value),o(),P(e.Value)}}function Sc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,hc,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function yc(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function Dc(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function vc(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function wc(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),I(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),I(6,"p-treeTableSortIcon",32),a(),g(7,yc,3,0,"th",33),n(8,"th",34),p(9," Gross "),I(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),I(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),I(16,"p-treeTableSortIcon",39),a(),g(17,Dc,3,0,"th",40)(18,vc,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function Tc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),ut("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),P(C(5,6,e.DisplayedCost))}}function Pc(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),ut("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),P(C(5,6,e.DisplayedProfit))}}function Fc(i,c){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=s(2).rowData;ut("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),D("",C(4,8,e.DisplayedPercentage),"%")}}function Ic(i,c){if(i&1&&(n(0,"td"),g(1,Fc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function bc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),I(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,Tc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,Pc,6,8,"td",55)(34,Ic,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,Er))("queryParams",ct(51,fc,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),P(r.Name),o(2),ut("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),P(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),ut("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),P(C(19,36,r.DisplayedGross)),o(3),ut("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,Cc))("queryParams",U(56,Mr,r.ID)),o(3),P(C(25,42,r.DisplayedTotalDiscount)),o(3),ut("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,Er))("queryParams",U(59,Mr,r.ID)),o(),P(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function Ec(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function Mc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function Vc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function Bc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,Ec,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,Mc,3,3,"td",61)(18,Vc,3,3,"td",63),a()),i&2){let e=s(2);o(4),D(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),P(C(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function Oc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,wc,19,3,"ng-template",25)(4,bc,35,61,"ng-template",26)(5,Bc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,gc))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),g(17,Sc,29,15,"ng-template",null,0,V),a(),g(19,Oc,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,dc)),o(3),m("routerLink",b(11,uc)),o(3),m("routerLink",b(12,_c)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,X,K,B,L,ae,De,Le,nr,Mo,lr,ar,or,rr,fe,Q,je,un,ie,ee,z,J],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var Lc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],kc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Wc(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Nc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function Ac(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),P(e)}}function Gc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Value)}}function Hc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Value))}}function Qc(i,c){if(i&1&&(n(0,"td"),g(1,Gc,2,1,"span",22)(2,Hc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Yc(i,c){if(i&1&&(n(0,"tr"),g(1,Qc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function jc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),D(" ",C(2,1,e),"")}}function qc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,jc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Uc(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,Ac,2,2,"th",20),a()(),n(5,"tbody"),g(6,Yc,2,1,"tr",21),a(),g(7,qc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(_t=>_t.Key===[this.data.Dataheader[w]].toString()).Value,St=l.find(_t=>_t.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,St,f)}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,Nc,16,9,"ng-template",null,0,V),a(),n(19,"content"),g(20,Uc,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,Lc)),o(3),m("routerLink",b(11,Rc)),o(3),m("routerLink",b(12,kc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,oe,ge,Le,fe,Q,z],encapsulation:2})};var Kc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],zc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Jc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Zc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(v(W),v(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Jc,10,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,Zc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Kc)),o(3),m("routerLink",b(9,zc)),o(3),m("routerLink",b(10,Xc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,X,B,L,ni],encapsulation:2})};var $c=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function ed(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function td(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),I(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),I(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,ed,13,9,"ng-template",null,0,V),a(),g(8,td,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,$c)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,X,K,B,L,ni,Mt,Q],encapsulation:2})};function id(i,c){if(i&1){let e=F();n(0,"a",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function nd(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ad(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),P(C(3,5,e.Visitor)),o(3),P(C(6,7,e.Orders)),o(3),P(C(9,9,e.TotalVisitor)),o(3),P(C(12,11,e.Sales)),o(3),P(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function od(i,c){if(i&1&&(n(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),p(5,"Number of Person"),a(),n(6,"th",15),p(7,"Orders"),a(),n(8,"th",15),p(9,"Total Visitor"),a(),n(10,"th",15),p(11,"Sales"),a(),n(12,"th",16),p(13,"Average Spending"),a()()(),n(14,"tbody"),g(15,ad,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),P(C(23,8,y(22,5,e.data,"Orders"))),o(4),P(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),P(C(31,18,y(30,15,e.data,"Sales"))),o(4),P(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,id,3,0,"a",2),a(),n(3,"filters"),g(4,nd,10,6,"ng-template",null,0,V),a(),n(6,"content"),g(7,od,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,re,ie,z],encapsulation:2})};var rd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function ld(i,c){if(i&1){let e=F();n(0,"a",18),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",19),p(2," Export "),a()}}function pd(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function md(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function sd(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Revenue))}}function cd(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",15),p(4),d(5,"number"),a(),n(6,"td",15),p(7),d(8,"quantityFraction"),a(),n(9,"td",15),p(10),d(11,"amountFraction"),a(),n(12,"td",16),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",15),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),g(20,sd,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),P(e.TimeFormat),o(2),P(C(5,7,e.Count)),o(3),P(C(8,9,e.Quantity)),o(3),P(C(11,11,e.Sales)),o(3),P(C(15,15,C(14,13,e.Tax))),o(4),P(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function dd(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),P(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,ld,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,pd,10,6,"ng-template",null,0,V),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),g(26,md,2,0,"th",11),a()(),n(27,"tbody"),g(28,cd,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),I(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,dd,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,rd)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),P(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),P(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),P(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),P(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),P(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,re,qo,ie,z,J],encapsulation:2})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],to=(i,c)=>({From:i,To:c}),_d=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],gd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function fd(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Cd(i,c){if(i&1&&(n(0,"content")(1,"div",12),I(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(c,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(v(W),v(O),v(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,fd,13,11,"ng-template",null,0,V),a(),g(18,Cd,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,ud))("queryParams",de(12,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,_d))("queryParams",de(16,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,gd))("queryParams",de(20,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,X,B,L,Mt,Ht,fe,Q],encapsulation:2})};var yd={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=M.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,er]},{provide:nn,useValue:yd}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),T("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),T("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);Co("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[Gt,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{a as ni,b as gr}from"./chunk-NVWJ6HZD.js";import{a as xr,b as hr}from"./chunk-SEFALU4U.js";import{a as Sr}from"./chunk-LKXAGCSU.js";import"./chunk-4NHG4RRM.js";import{a as Mt,b as fr}from"./chunk-KHILQH3P.js";import{a as Ht,b as Cr}from"./chunk-FRDFUCRO.js";import"./chunk-YAFVFDTG.js";import{a as _r}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-TAVO3B4U.js";import{a as he}from"./chunk-PDDA2XEV.js";import{a as je}from"./chunk-4JM455M6.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as ht}from"./chunk-OXQJYOVG.js";import{a as Wo}from"./chunk-5HX73JZ3.js";import{b as Ho}from"./chunk-EOVI4KWG.js";import"./chunk-XJ7SOVB2.js";import{a as yn}from"./chunk-IYV6WHO4.js";import"./chunk-DAIHPIA2.js";import{a as ur}from"./chunk-BXQFYW4R.js";import{a as mr,b as sr,d as cr,g as dr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{a as Di}from"./chunk-XKUQPHUA.js";import{a as tr,b as ir}from"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Go}from"./chunk-RHUDY63D.js";import{a as nr,b as ar,c as or,d as rr,e as lr,f as pr}from"./chunk-42NBSIMT.js";import"./chunk-B5SDXVDR.js";import"./chunk-FEW55RO5.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Si,b as er,c as Sn,d as K,e as yi}from"./chunk-GIDGCFLX.js";import{a as cn,b as fi}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{c as Ao,d as De,e as hn}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as z}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-MBJ5EVQM.js";import{a as oe,b as ge,c as ko}from"./chunk-VQBXUZ6U.js";import{a as Et,b as $o}from"./chunk-BBGWXLHJ.js";import{d as Xo,f as fe}from"./chunk-LKII7K7T.js";import{a as Jo,b as Zo,c as Q}from"./chunk-6XO6NT6E.js";import{b as q}from"./chunk-QHBWVJIQ.js";import{a as ne}from"./chunk-MPCAKU6Y.js";import{a as Ro}from"./chunk-AJM4N35T.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-BLSJR63P.js";import"./chunk-LQ63SW7R.js";import"./chunk-5JJSLRVS.js";import{c as Qo}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Yo,c as Ye}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as zo}from"./chunk-V3Y7QS6E.js";import{b as W}from"./chunk-EY2BEKKH.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as No,u as Ci,v as ei,w as _n}from"./chunk-H7F34T25.js";import{b as ae,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as Uo,C as ti,K as xi,N as Ko,g as re,o as jo,s as gn,z as qo}from"./chunk-TSIYPTYI.js";import{a as un,d as X}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Oo,b as Lo}from"./chunk-VFTGIP5A.js";import{a as Bo}from"./chunk-LE3BKIDY.js";import{a as Oi}from"./chunk-2FWFPV5I.js";import{la as Mo,ma as Zi,ua as Vo}from"./chunk-EEEAUYZ6.js";import{F as Gt,G as Xi,a as Po,b as Fo,c as We,h as B,l as Io,o as L,q as bo,s as Eo}from"./chunk-RVXZOIFQ.js";import"./chunk-5FSR4IZJ.js";import"./chunk-JMQDEPZK.js";import{a as M,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-DK2SUVKT.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as ot,E as ri,Eb as Xa,Fa as Gi,Fc as V,Gb as Mi,Hb as Vi,I as bi,Ib as n,Jb as a,K as so,Kb as I,Kc as yo,Lb as se,M as co,Ma as st,Mb as ce,Mc as Ui,Nb as ho,Nc as Do,Ob as F,Od as Oe,Pc as Ja,Q as Ni,Qb as T,Qc as vo,Qd as zi,Rb as s,Rd as A,Td as Bi,Ub as ut,Va as Pe,Vd as Qe,Wa as Hi,Wc as He,Y as kt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ka,ad as wo,cd as Ki,db as v,dc as Ze,ec as p,ed as ee,fa as Wt,fc as P,gc as D,gd as ie,hc as Xt,ia as uo,ib as go,ja as _o,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,mb as fo,na as Re,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as ct,u as Ua,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as Co,wc as So,wd as To,xb as Ei,za,zb as xo,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as gl,g as At}from"./chunk-7DCB7DB2.js";var oo=gl((kb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,St,_t){let Bt=(_t-f)*(w-l)-(Ee-f)*(St-l);return Bt>0||!(Bt<0)}function t(l,f,w,Ee,St,_t,Bt,Nt){return r(l,f,St,_t,Bt,Nt)!==r(w,Ee,St,_t,Bt,Nt)&&r(l,f,w,Ee,St,_t)!==r(l,f,w,Ee,Bt,Nt)}return{boxIntersectLine:function(l,f,w,Ee,St,_t,Bt,Nt){return t(l,f,l+w,f,St,_t,Bt,Nt)||t(l+w,f,l+w,f+Ee,St,_t,Bt,Nt)||t(l,f+Ee,l+w,f+Ee,St,_t,Bt,Nt)||t(l,f,l,f+Ee,St,_t,Bt,Nt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,St){let{animObject:_t}=r,{format:Bt}=t,{setOptions:Nt}=l,{composed:ml}=f,{boxIntersectLine:ro,intersectRect:sl}=Ee,{addEvent:lo,extend:po,fireEvent:cl,isNumber:ki,pick:Ut,pushUnique:dl,syncTimeout:ul}=St;function pi(dt,Me,at,we,Ft){let it=dt.chart,$=dt.options.label||{},ze=Ut($.onArea,!!dt.area),qe=ze||$.connectorAllowed,pt=it.boxesToAvoid,Ot=Number.MAX_VALUE,It=Number.MAX_VALUE,yt,gt,ft,Kt,bt,Xe,Ie;for(Xe=0;pt&&Xe<pt.length;Xe+=1)if(sl(pt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let rt=it.series[Xe],Ve=rt.interpolatedPoints&&[...rt.interpolatedPoints];if(rt.visible&&Ve){let Ke=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ke)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(Ie=1;Ie<Ve.length;Ie+=1){if(Ve[Ie].chartX>=Me-16&&Ve[Ie-1].chartX<=Me+we.width+16){if(ro(Me,at,we.width,we.height,Ve[Ie-1].chartX,Ve[Ie-1].chartY,Ve[Ie].chartX,Ve[Ie].chartY))return!1;dt===rt&&!ft&&Ft&&(ft=ro(Me-16,at-16,we.width+32,we.height+32,Ve[Ie-1].chartX,Ve[Ie-1].chartY,Ve[Ie].chartX,Ve[Ie].chartY))}(qe||ft)&&(dt!==rt||ze)&&(Ot=Math.min(Ot,(Kt=Me+we.width/2-Ve[Ie].chartX)*Kt+(bt=at+we.height/2-Ve[Ie].chartY)*bt))}if(!ze&&qe&&dt===rt&&(Ft&&!ft||Ot<Math.pow($.connectorNeighbourDistance||1,2))){for(Ie=1;Ie<Ve.length;Ie+=1)(yt=Math.min(Math.pow(Me+we.width/2-Ve[Ie].chartX,2)+Math.pow(at+we.height/2-Ve[Ie].chartY,2),Math.pow(Me-Ve[Ie].chartX,2)+Math.pow(at-Ve[Ie].chartY,2),Math.pow(Me+we.width-Ve[Ie].chartX,2)+Math.pow(at-Ve[Ie].chartY,2),Math.pow(Me+we.width-Ve[Ie].chartX,2)+Math.pow(at+we.height-Ve[Ie].chartY,2),Math.pow(Me-Ve[Ie].chartX,2)+Math.pow(at+we.height-Ve[Ie].chartY,2)))<It&&(It=yt,gt=Ve[Ie]);ft=!0}}}return(!Ft||!!ft)&&{x:Me,y:at,weight:Ot-(gt?It:0),connectorPoint:gt}}function mo(dt){if(this.renderer){let Me=this,at=_t(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&St.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Ft=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Ft.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Ft.minFontSize&&Ft.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,qe)=>(ze||0)+(qe||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),dt.type==="load"&&(at=Math.max(at,_t(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ul(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Ft=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(qe=>{let{width:pt,height:Ot}=qe.getBBox(),It=(qe.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),yt=(qe.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:It,top:yt,right:It+pt,bottom:yt+Ot})}))),Ft.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(qe){let pt,Ot,It,yt,gt;if(!qe.xAxis&&!qe.yAxis)return;let ft=qe.points,Kt=[],bt=qe.graph||qe.area,Xe=bt&&bt.element,Ie=qe.chart.inverted,rt=qe.xAxis,Ve=qe.yAxis,Ke=Ie?Ve.pos:rt.pos,$e=Ie?rt.pos:Ve.pos,wt=Ie?rt.len:Ve.len,Ii=Ie?Ve.len:rt.len,Ct=Ut((qe.options.label||{}).onArea,!!qe.area),Ge=Ve.getThreshold(qe.options.threshold),Tt={},zt=Ie?"chartCenterX":"chartCenterY";function oi(nt){let Dt=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);Tt[Dt]||(Tt[Dt]=1,Kt.push(nt))}if(qe.getPointSpline&&Xe&&Xe.getPointAtLength&&!Ct&&ft.length<(qe.chart.plotSizeX||0)/16){let nt=bt.toD&&bt.attr("d");for(bt.toD&&bt.attr({d:bt.toD}),It=Xe.getTotalLength(),pt=0;pt<It;pt+=16){let Rt=Xe.getPointAtLength(pt),xt=Ie?Ii-Rt.y:Rt.x,mt=Ie?wt-Rt.x:Rt.y;oi({chartX:Ke+xt,chartY:$e+mt,plotX:xt,plotY:mt})}nt&&bt.attr({d:nt});let Dt=ft[ft.length-1].pos();oi({chartX:Ke+(Dt?.[0]||0),chartY:$e+(Dt?.[1]||0)})}else{let nt;for(pt=0,It=ft.length;pt<It;pt+=1){let Dt=ft[pt],[Rt,xt]=Dt.pos()||[],{plotHigh:mt}=Dt;if(ki(Rt)&&ki(xt)){let lt={plotX:Rt,plotY:xt,chartX:Ke+Rt,chartY:$e+xt};if(Ct&&(mt&&(lt.plotY=mt,lt.chartY=$e+mt),Ie?lt.chartCenterX=Ke+Ii-((mt||Dt.plotY||0)+Ut(Dt.yBottom,Ge))/2:lt.chartCenterY=$e+((mt||xt)+Ut(Dt.yBottom,Ge))/2),nt&&(Ot=Math.max(Math.abs(lt.chartX-nt.chartX),Math.abs(lt.chartY-nt.chartY)))>16)for(gt=1,yt=Math.ceil(Ot/16);gt<yt;gt+=1)oi({chartX:nt.chartX+(lt.chartX-nt.chartX)*(gt/yt),chartY:nt.chartY+(lt.chartY-nt.chartY)*(gt/yt),[zt]:(nt[zt]||0)+((lt[zt]||0)-(nt[zt]||0))*(gt/yt),plotX:(nt.plotX||0)+(Rt-(nt.plotX||0))*(gt/yt),plotY:(nt.plotY||0)+(xt-(nt.plotY||0))*(gt/yt)});oi(lt),nt=lt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let qe="highcharts-color-"+Ut($.colorIndex,"none"),pt=!$.labelBySeries,Ot=ze.minFontSize,It=ze.maxFontSize,yt=we.inverted,gt=yt?$.yAxis.pos:$.xAxis.pos,ft=yt?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,bt=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,Ie=Ut(ze.onArea,!!$.area),rt=[],Ve=$.xData||[],Ke,$e,wt,Ii,Ct,Ge,Tt=$.labelBySeries,zt,oi,nt;function Dt(xt,mt,lt){let Wi=Math.max(gt,Ut(oi,-1/0)),mi=Math.min(gt+Kt,Ut(nt,1/0));return xt>Wi&&xt<=mi-lt.width&&mt>=ft&&mt<=ft+bt-lt.height}function Rt(){Tt&&($.labelBySeries=Tt.destroy())}if(Ie&&!yt&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!Tt){let xt=$.name;if(typeof ze.format=="string"?xt=Bt(ze.format,$,we):ze.formatter&&(xt=ze.formatter.call($)),$.labelBySeries=Tt=we.renderer.label(xt,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+qe),!we.renderer.styledMode){let mt=typeof $.color=="string"?$.color:"#666666";Tt.css(po({color:Ie?we.renderer.getContrast(mt):mt},ze.style||{})),Tt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Ot&&It&&Tt.css({fontSize:Ot+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(It-Ot)+"px"}),Tt.attr({padding:0,zIndex:3}).add()}for((Ke=Tt.getBBox()).width=Math.round(Ke.width),Ct=Xe.length-1;Ct>0;Ct-=1)Ie?Dt($e=(Xe[Ct].chartCenterX??Xe[Ct].chartX)-Ke.width/2,wt=(Xe[Ct].chartCenterY??Xe[Ct].chartY)-Ke.height/2,Ke)&&(Ge=pi($,$e,wt,Ke)):(Dt($e=Xe[Ct].chartX+3,wt=Xe[Ct].chartY-Ke.height-3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX+3,wt=Xe[Ct].chartY+3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX-Ke.width-3,wt=Xe[Ct].chartY+3,Ke)&&(Ge=pi($,$e,wt,Ke,!0)),Ge&&rt.push(Ge),Dt($e=Xe[Ct].chartX-Ke.width-3,wt=Xe[Ct].chartY-Ke.height-3,Ke)&&(Ge=pi($,$e,wt,Ke,!0))),Ge&&rt.push(Ge);if(ze.connectorAllowed&&!rt.length&&!Ie)for($e=gt+Kt-Ke.width;$e>=gt;$e-=16)for(wt=ft;wt<ft+bt-Ke.height;wt+=16)(Ii=pi($,$e,wt,Ke,!0))&&rt.push(Ii);if(rt.length){rt.sort((mt,lt)=>lt.weight-mt.weight),Ge=rt[0],(we.boxesToAvoid||[]).push({left:Ge.x,right:Ge.x+Ke.width,top:Ge.y,bottom:Ge.y+Ke.height});let xt=Math.sqrt(Math.pow(Math.abs(Ge.x-(Tt.x||0)),2)+Math.pow(Math.abs(Ge.y-(Tt.y||0)),2));if(xt&&$.labelBySeries){let mt,lt={opacity:we.renderer.forExport?1:0,x:Ge.x,y:Ge.y},Wi={opacity:1};xt<=10&&(Wi={x:lt.x,y:lt.y},lt={}),pt&&(mt=_t($.options.animation),mt.duration*=.2),$.labelBySeries.attr(po(lt,{anchorX:Ge.connectorPoint&&(Ge.connectorPoint.plotX||0)+gt,anchorY:Ge.connectorPoint&&(Ge.connectorPoint.plotY||0)+ft})).animate(Wi,mt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ge.x,chartY:Ge.y},!0);mi&&(Tt.closest=[mi,Ge.x-(mi.plotX||0),Ge.y-(mi.plotY||0)])}}else Rt()}else Rt()}),cl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function _l(dt,Me,at,we,Ft){let it=Ft&&Ft.anchorX,$=Ft&&Ft.anchorY,ze,qe,pt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(qe=Me-$)<0&&(qe=-we-qe),qe<at&&(pt=it<dt+at/2?qe:at-qe),$>Me+we?ze.push(["L",dt+pt,Me+we]):$<Me?ze.push(["L",dt+pt,Me]):it<dt?ze.push(["L",dt,Me+we/2]):it>dt+at&&ze.push(["L",dt+at,Me+we/2])),ze||[]}return{compose:function(dt,Me){dl(ml,"SeriesLabel")&&(lo(dt,"load",mo),lo(dt,"redraw",mo),Me.prototype.symbols.connector=_l,Nt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var yr=(i,c)=>({"text-success":i,"text-danger":c});function fl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),D(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function Cl(i,c){if(i&1){let e=F();n(0,"span",8),T("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),I(1,"i",9),a()}}function xl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),D(" ",C(8,2,e.Cost)," "),o(4),D(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function hl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,yr,e.Profit>0,e.Profit<0)),o(),D(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,yr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),D("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function Sl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),I(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),I(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,fl,4,4,"ng-container",6),d(25,"async"),g(26,Cl,2,0,"ng-template",null,0,V),a(),I(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),I(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),I(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),I(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),I(72,"td"),a(),g(73,xl,13,7,"ng-container",3)(74,hl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),P(C(9,12,e.Orders)),o(8),P(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),P(C(35,18,e.GrossSales)),o(9),D(" ",C(44,20,e.Discount)," "),o(4),D(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),P(C(55,25,e.Sales)),o(8),P(C(63,27,e.Tax)),o(8),P(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(kt())}static \u0275fac=function(e){return new(e||i)(v(O),v(G),v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),T("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,Sl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,z,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var yl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Dr=i=>({ID:i});function Dl(i,c){if(i&1){let e=F();n(0,"button",6),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function vl(i,c){if(i&1&&(n(0,"div",4),g(1,Dl,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function wl(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),I(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Tl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function Pl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.CustomerNameDisplay," - {0}"))}}function Fl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.SalesName," - Sales: {0}"))}}function Il(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),D(" "," - Profit: "+C(2,1,e.Profit)," ")}}function bl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function El(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Ml(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function Vl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Bl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Dr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function Ol(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function Ll(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Rl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Ol,2,1,"i",68),I(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,Ll,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),P(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),m("ngIf",r.roleService.product.Cost),o(2),D(" ",C(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?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",C(26,17,e==null?null:e.Total)," ")}}function kl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",C(8,3,e.Amount)," ")}}function Wl(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),I(10,"small",49),d(11,"date"),g(12,Pl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,Fl,3,4,"span",3),a(),g(17,Il,3,3,"span",50)(18,bl,2,1,"i",53)(19,El,2,1,"span",54)(20,Ml,2,0,"span",3),a(),g(21,Vl,3,3,"ng-container",3)(22,Bl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Rl,27,19,"tr",58),a()(),n(28,"table",59),g(29,kl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,yl))("queryParams",U(24,Dr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number,""),o(2),D(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",r.isNotEmpty(e.CustomerNameDisplay)),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),D(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Nl(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Al(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Gl(i,c){if(i&1){let e=F();n(0,"div",4)(1,"a",85),T("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),I(2,"i",86),p(3," Next 100"),a()()}}function Hl(i,c){if(i&1){let e=F();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Tl,2,0,"th",34),n(15,"th",35),p(16,"@ Price"),a(),n(17,"th",32),p(18,"Disc."),a(),n(19,"th",35),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",36),g(24,Wl,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),T("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Nl,3,0,"span",43)(34,Al,3,3,"span",3),p(35),a()(),g(36,Gl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),D(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,r,t,l,f,w,Ee,St){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=St}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(ee),v(Oe),v(j),v(Qe),v(G))};static \u0275cmp=E({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"lh-base"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,vl,2,1,"div",2),a(),n(3,"filters"),g(4,wl,46,26,"ng-template",null,0,V),a(),g(6,Hl,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,ae,De,Le,Q,je,jo,gn,ie,ee,z,J],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[We,B,L,Ye,ei],encapsulation:2})};var Yl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vr=i=>({ID:i}),jl=()=>["/menu/Contacts/Contact/Customers/Info"],ql=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Ul(i,c){if(i&1){let e=F();n(0,"button",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Kl(i,c){if(i&1){let e=F();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function zl(i,c){if(i&1){let e=F();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Xl(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Kl,11,4,"ng-container",13)(19,zl,3,6,"ng-template",null,1,V),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function Jl(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Zl(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function $l(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function ep(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function tp(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function ip(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function np(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function ap(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function op(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function rp(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function lp(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function pp(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function mp(i,c){i&1&&I(0,"br")}function sp(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Note)}}function cp(i,c){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=s().$implicit;o(2),D(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",y(6,5,e.Created,"HH:mm")," ")}}function dp(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,jl))("queryParams",U(4,vr,e.CustomerID)),o(),P(e.CustomerName)}}function up(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function _p(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.Groups," ")}}function gp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),D(" ",e.SalesName," ")}}function fp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Cost)," ")}}function Cp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Gross)," ")}}function xp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales)," ")}}function hp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Sp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SurchargeAmount)," ")}}function yp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SalesNSurcharge)," ")}}function Dp(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",ct(2,ql,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function vp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,mp,1,0,"br",4)(7,sp,2,1,"i",4),a(),g(8,cp,7,8,"td",4)(9,dp,3,6,"td",4)(10,up,3,4,"td")(11,_p,2,1,"td")(12,gp,2,1,"td",4)(13,fp,3,3,"td",68)(14,Cp,3,3,"td",69)(15,xp,3,3,"td",69)(16,hp,3,3,"td",70)(17,Sp,3,3,"td",69)(18,yp,3,3,"td",69)(19,Dp,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),P(e.EntityName),o(2),m("routerLink",b(18,Yl))("queryParams",U(19,vr,e.ID)),o(),D(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),ot(r.column.JoinDate.selected?10:-1),o(),ot(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function wp(i,c){i&1&&I(0,"td",79)}function Tp(i,c){i&1&&I(0,"td",79)}function Pp(i,c){i&1&&I(0,"td",79)}function Fp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Ip(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function bp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Ep(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function Mp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Vp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Bp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Op(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),I(2,"td",79),g(3,wp,1,0,"td",80)(4,Tp,1,0,"td",80)(5,Pp,1,0,"td",80)(6,Fp,2,0,"td",81)(7,Ip,4,6,"td",68)(8,bp,4,6,"td",69)(9,Ep,4,6,"td",69)(10,Mp,4,6,"td",70)(11,Vp,4,6,"td",69)(12,Bp,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Lp(i,c){if(i&1){let e=F();n(0,"div",38)(1,"table",39),T("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Jl,2,0,"th",43)(9,Zl,2,0,"th",44)(10,$l,2,0,"th",45)(11,ep,2,0,"th",46)(12,tp,2,0,"th",47)(13,ip,2,0,"th",48)(14,np,2,0,"th",49)(15,ap,2,0,"th",50)(16,op,2,0,"th",51)(17,rp,2,0,"th",52)(18,lp,2,0,"th",53)(19,pp,2,0,"th",54),a()(),n(20,"tbody"),g(21,vp,20,21,"tr",55),a(),g(22,Op,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),ot(e.column.JoinDate.selected?10:-1),o(),ot(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Rp(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function kp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Wp(i,c){if(i&1){let e=F();n(0,"a",85),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",86),p(2," Next"),a()}}function Np(i,c){if(i&1){let e=F();n(0,"a",87),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",88),p(2," Last"),a()}}function Ap(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Lp,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Rp,3,0,"span",34)(9,kp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Wp,3,0,"a",36)(13,Np,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),D(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=f}roleService=Re(G);columnService=Re(ht);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Oe),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Ul,3,0,"button",3),a(),n(3,"filters"),g(4,Xl,36,22,"ng-template",null,0,V),a(),g(6,Ap,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,X,K,We,B,L,ae,oe,ge,Ye,De,Le,Di,Q,je,re,ie,ee,z],encapsulation:2})};var Gp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Hp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Qp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Yp=i=>({ID:i}),jp=(i,c)=>({BrandID:i,Name:c});function qp(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export"),a()}}function Up(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Kp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function zp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function Xp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,zp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Qp))("queryParams",U(12,Yp,e.ID)),o(),D("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,jp,e.ID,e.BrandName)),o(),P(C(8,7,e.Quantity)),o(3),P(C(11,9,e.Total))}}function Jp(i,c){if(i&1){let e=F();n(0,"div",15)(1,"table",16),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Kp,2,0,"th",19),n(7,"th",20),p(8,"Sold"),a(),n(9,"th",21),p(10,"Total"),a()()(),n(11,"tbody"),g(12,Xp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),P(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),P(C(24,12,y(23,9,e.data.Data,"Total")))}}var Fn=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Oe),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,qp,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),g(14,Up,9,6,"ng-template",null,0,V),a(),n(16,"content"),g(17,Jp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Gp)),o(3),m("routerLink",b(9,Hp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,oe,ge,Q,re,z,J],encapsulation:2})};function Zp(i,c){if(i&1){let e=F();n(0,"label",3),T("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),I(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),P(e.Name)}}var In=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(v(Zt),v($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Zp,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var $p=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],am=()=>["/menu/Contacts/Contact/Customers/Info"],om=i=>({ID:i});function rm(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function lm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function pm(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function mm(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function sm(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function cm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function dm(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function um(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function _m(i,c){if(i&1){let e=F();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),T("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),P(r==0?"":" , "),o(2),P(e.GroupName)}}function gm(i,c){if(i&1&&(n(0,"span"),g(1,_m,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function fm(i,c){if(i&1){let e=F();n(0,"a",45),T("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Cm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Orders)," ")}}function xm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Quantity)," ")}}function hm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),D(" ",C(3,1,e.Cost)," ")}}function Sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales)," ")}}function ym(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Dm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Sales+e.Tax)," ")}}function vm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,gm,2,1,"span",25)(6,fm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,Cm,3,3,"td",43)(11,xm,3,3,"td",43)(12,hm,4,3,"ng-container",25)(13,Sm,3,3,"td",43)(14,ym,3,3,"td",44)(15,Dm,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,am))("queryParams",U(14,om,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function wm(i,c){if(i&1&&(n(0,"tbody",37),g(1,vm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Tm(i,c){if(i&1){let e=F();n(0,"div",17)(1,"div",18)(2,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,pm,2,0,"th",23)(10,mm,2,0,"th",24)(11,sm,3,0,"ng-container",25)(12,cm,2,0,"th",26)(13,dm,2,0,"th",27)(14,um,2,0,"th",28),a()(),g(15,wm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=Re(G);columnService=Re(ht);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(kt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(In,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(ee),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,rm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),I(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,lm,16,10,"ng-template",null,0,V),a(),n(26,"content"),g(27,Tm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,$p)),o(3),m("routerLink",b(13,em)),o(3),m("routerLink",b(14,tm)),o(3),m("routerLink",b(15,im)),o(4),m("routerLink",b(16,nm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,We,B,L,ae,oe,ge,Ye,Q,ii,ie,z,J],encapsulation:2})};var Pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Em=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Mm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Vm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Bm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),D(" ",e.Name," "),o(2),P(C(5,4,e.TotalOrders)),o(3),P(C(8,6,e.TotalCost)),o(3),P(C(11,8,e.TotalAmount))}}function Om(i,c){if(i&1&&(n(0,"tbody",24),g(1,Bm,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Lm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,Om,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j),v(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Mm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Vm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Lm,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,Pm)),o(3),m("routerLink",b(12,Fm)),o(3),m("routerLink",b(13,Im)),o(3),m("routerLink",b(14,bm)),o(3),m("routerLink",b(15,Em)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,oe,ge,Q,ie,z],encapsulation:2})};var Rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Am=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Gm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Hm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Ym(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function jm(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function qm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalOrders))}}function Um(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.TotalQuantity)," ")}}function Km(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalAmount))}}function zm(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,qm,3,3,"td",28)(4,Um,3,3,"td",28)(5,Km,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),D(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function Xm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Qm,2,0,"th",20)(7,Ym,2,0,"th",21)(8,jm,2,0,"th",22),a()(),n(9,"tbody",23),g(10,zm,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=Re(G);columnService=Re(ht);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(kt(1))}openExportModal(){this.matDialog.open(q,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(j),v(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[R],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 135px","mat-sort-header","Total","arrowPosition","before","class","flex-right",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","text-end",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Gm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Hm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Xm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Rm)),o(3),m("routerLink",b(13,km)),o(3),m("routerLink",b(14,Wm)),o(3),m("routerLink",b(15,Nm)),o(3),m("routerLink",b(16,Am)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,B,L,oe,ge,Q,ie,z,J],encapsulation:2})};var Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Zm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],$m=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],is=()=>["/menu/Contacts/Contact/Suppliers/Info"],ns=i=>({ID:i}),as=(i,c,e)=>({From:i,SupplierID:c,To:e});function os(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function rs(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function ls(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),P(e.Rank),o(2),m("routerLink",b(19,is))("queryParams",U(20,ns,e.SupplierID)),o(),P(e.Name),o(2),P(e.Code),o(2),D(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Tr))("queryParams",ct(23,as,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",C(16,17,e.Total),"")}}function ps(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),I(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),I(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),P(e.data.TotalQty),o(2),P(e.data.TotalSales)}}function ms(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,ls,17,27,"tr",25),a(),g(16,ps,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),ot((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,os,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,rs,16,10,"ng-template",null,0,V),a(),n(28,"content"),g(29,ms,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Tr)),o(3),m("routerLink",b(13,Jm)),o(3),m("routerLink",b(14,Zm)),o(3),m("routerLink",b(15,$m)),o(3),m("routerLink",b(16,es)),o(3),m("routerLink",b(17,ts)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,X,K,We,B,L,oe,ge,Ye,Q,ee,z,J],encapsulation:2})};var Pr=At(Si());var cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],_s=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],gs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],fs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Cs=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),xs=i=>[i],hs=i=>({ID:i}),Ss=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Fr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],ys=(i,c,e)=>({VariantID:i,From:c,To:e}),Ds=(i,c,e)=>({ProductID:i,From:c,To:e});function vs(i,c){if(i&1&&(n(0,"a",9),I(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,Cs,(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 ws(i,c){if(i&1){let e=F();n(0,"button",11),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function Ts(i,c){if(i&1){let e=F();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Ps(i,c){if(i&1){let e=F();n(0,"th",48)(1,"div",49)(2,"input",50),T("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function Fs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function Is(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function bs(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Es(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Ms(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Vs(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Bs(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Os(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Ls(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Rs(i,c){if(i&1){let e=F();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function ks(i,c){if(i&1){let e=F();se(0),n(1,"img",72),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Ws(i,c){if(i&1){let e=F();n(0,"a",73)(1,"img",74),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Ns(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",So(4,Ss,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(),P(C(3,2,r.Quantity))}}function As(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.OnHand)," ")}}function Gs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.UnitCost)," ")}}function Hs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Gross)," ")}}function Qs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Fr))("queryParams",ct(12,ys,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function Ys(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,Fr))("queryParams",ct(12,Ds,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function js(i,c){if(i&1&&(n(0,"td",75),g(1,Qs,5,16,"a",78)(2,Ys,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function qs(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.Tax)," ")}}function Us(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),D(" ",C(2,1,e.SalesNTax)," ")}}function Ks(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",C(2,2,e.Profit)," ")}}function zs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",C(2,2,e.Margin)," ")}}function Xs(i,c){if(i&1&&(n(0,"tr",60),g(1,Rs,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,ks,2,1,"ng-container",8)(8,Ws,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Ns,4,11,"td",67)(15,As,3,3,"td",67)(16,Gs,3,3,"td",68)(17,Hs,3,3,"td",67)(18,js,3,2,"td",67)(19,qs,3,3,"td",69)(20,Us,3,3,"td",67)(21,Ks,3,4,"td",70)(22,zs,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),P(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,xs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,hs,e.ID)),o(),P(e.Name),o(2),P(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Js(i,c){i&1&&I(0,"td",75)}function Zs(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function $s(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function e0(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function t0(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function i0(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function n0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function a0(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function o0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function r0(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function l0(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function p0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),I(2,"td",75),g(3,Js,1,0,"td",67)(4,Zs,2,0,"td",67)(5,$s,4,6,"td",67)(6,e0,4,6,"td",67)(7,t0,4,6,"td",68)(8,i0,4,6,"td",67)(9,n0,5,6,"td",82)(10,a0,5,6,"td",69)(11,o0,5,6,"td",82)(12,r0,5,10,"td",70)(13,l0,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function m0(i,c){if(i&1){let e=F();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,Ps,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,Fs,2,1,"th",37)(12,Is,2,0,"th",38)(13,bs,2,0,"th",39)(14,Es,2,0,"th",40)(15,Ms,2,1,"th",41)(16,Vs,2,0,"th",42)(17,Bs,2,1,"th",43)(18,Os,2,0,"th",44)(19,Ls,2,0,"th",45),a()(),n(20,"tbody"),g(21,Xs,23,21,"tr",46),a(),g(22,p0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Re(G);columnService=Re(ht);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=st([]);queryParams=st(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Oi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Je({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return M.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return M.compare(t.Total,l.Total,f);case"Total_Tax":return M.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return M.compare(t.MinStock,l.MinStock,f);case"Gross":return M.compare(t.Gross,l.Gross,f);case"Margin":return M.compare(t.Margin,l.Margin,f);case"Profit":return M.compare(t.Profit,l.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,Pr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(Qe),v(Oe),v(j),v(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,vs,3,7,"a",2)(3,ws,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),g(27,Ts,45,36,"ng-template",null,0,V),a(),g(29,m0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,cs)),o(3),m("routerLink",b(15,ds)),o(3),m("routerLink",b(16,us)),o(3),m("routerLink",b(17,_s)),o(3),m("routerLink",b(18,gs)),o(3),m("routerLink",b(19,fs)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,X,K,Fo,B,L,ae,oe,ge,De,Le,fe,Q,je,ii,re,ee,z,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],c0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],u0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],_0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],f0=i=>({ID:i});function C0(i,c){if(i&1){let e=F();n(0,"a",15),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function x0(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function h0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;ut("matTooltip",r.Name),o(),D(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function S0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),D(" ",e," ")}}function y0(i,c){if(i&1&&(n(0,"tr",28)(1,"td")(2,"a",29),p(3),a()(),n(4,"td",30),p(5),a(),g(6,S0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,f0,e.ID)),o(),D(" ",e.Name,""),o(2),P(e.Code),o(),m("ngForOf",e.Quantities),o(2),P(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(j),v(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[R],decls:42,vars:19,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"border-bottom"],[3,"routerLink","queryParams"],[2,"text-align","right"],["class","text-end",4,"ngFor","ngForOf"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,C0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,x0,25,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,h0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,y0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,s0)),o(3),m("routerLink",b(14,c0)),o(3),m("routerLink",b(15,d0)),o(3),m("routerLink",b(16,u0)),o(3),m("routerLink",b(17,_0)),o(3),m("routerLink",b(18,g0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,X,K,B,L,ae,De,Le,fe,Q,je],encapsulation:2})};var $a=At(Si());var D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],v0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],w0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ir=()=>({standalone:!0}),br=()=>({overflow:"visible"}),I0=i=>[i],b0=i=>({ID:i});function E0(i,c){if(i&1){let e=F();n(0,"a",17),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",18),p(2," Export"),a()}}function M0(i,c){if(i&1){let e=F();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),S("ngModelChange",function(t){u(e);let l=s();return h(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),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListOutletID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(5),x("ngModel",e.pageData.Filter.MonthFrom),m("ngModelOptions",b(18,Ir))("contentStyle",b(19,br))("appendTo","body")("baseZIndex",99999),o(4),x("ngModel",e.pageData.Filter.MonthTo),m("ngModelOptions",b(20,Ir))("contentStyle",b(21,br))("appendTo","body")("baseZIndex",99999),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function V0(i,c){i&1&&(n(0,"th",11),p(1," Name "),a())}function B0(i,c){i&1&&(n(0,"th",12),p(1," Code "),a())}function O0(i,c){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function L0(i,c){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=c.$implicit,r=s();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function R0(i,c){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function k0(i,c){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=s().$implicit,r=s();o(),m("routerLink",U(3,I0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(5,b0,e.ID)),o(),D(" ",e.Name," ")}}function W0(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function N0(i,c){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=s().$implicit,r=s();o(2),D(" ",e.OnHand?y(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function A0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),D(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function G0(i,c){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=s().$implicit,r=s();o(2),D(" ",y(4,4,y(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function H0(i,c){if(i&1&&(n(0,"tr"),g(1,k0,3,7,"td")(2,W0,2,1,"td")(3,N0,4,4,"td",29)(4,A0,3,4,"td",30)(5,G0,5,7,"td",29),a()),i&2){let e=s();o(),ot(e.column.name.selected?1:-1),o(),ot(e.column.code.selected?2:-1),o(),ot(e.column.OnHand.selected?3:-1),o(),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(),ot(e.column.total.selected?5:-1)}}function Q0(i,c){i&1&&I(0,"td")}function Y0(i,c){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function j0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),D(" ",y(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function q0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),D(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function U0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);o(),D(" ",y(3,4,y(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function K0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",32),g(2,Q0,1,0,"td")(3,Y0,2,0,"td",29)(4,j0,3,4,"td",29)(5,q0,3,4,"td",30)(6,U0,4,7,"td",29),a()()),i&2){let e=s();o(2),ot(e.column.name.selected?2:-1),o(),ot(e.column.code.selected?3:-1),o(),ot(e.column.OnHand.selected?4:-1),o(),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(),ot(e.column.total.selected?6:-1)}}var Ln=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;let w=new Date().getFullYear(),Ee=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(w,Ee)}_toastrService=Re(Qe);columnService=Re(ht);years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}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,$a.default)(this.pageData.Filter.MonthFrom),r=(0,$a.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",f=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(f),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)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[R],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=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.onSubmit())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,E0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,M0,19,22,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8),T("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr",10),g(33,V0,2,0,"th",11)(34,B0,2,0,"th",12)(35,O0,3,0,"th",13)(36,L0,2,1,"th",14)(37,R0,3,0,"th",13),a()(),n(38,"tbody"),g(39,H0,6,5,"tr",15),a(),g(40,K0,7,5,"tfoot",16),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(19,D0)),o(3),m("routerLink",b(20,v0)),o(3),m("routerLink",b(21,w0)),o(3),m("routerLink",b(22,T0)),o(3),m("routerLink",b(23,P0)),o(3),m("routerLink",b(24,F0)),o(10),ot(t.column.name.selected?33:-1),o(),ot(t.column.code.selected?34:-1),o(),ot(t.column.OnHand.selected?35:-1),o(),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(),ot(t.column.total.selected?37:-1),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,B,L,ae,oe,ge,De,fe,Q,tr,re,ie],encapsulation:2})};var z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],X0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],J0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Z0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],$0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],tc=i=>[i],ic=i=>({ID:i});function nc(i,c){if(i&1){let e=F();n(0,"button",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function ac(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function oc(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),P(e)}}function rc(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,oc,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function lc(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),D(" ",e,"")}}function pc(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,tc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,ic,r[1])),o(),P(r[e])}}function mc(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;D(" ",r[e]," ")}}function sc(i,c){if(i&1&&(n(0,"td",13),g(1,pc,3,7,"ng-container",28)(2,mc,1,1,"ng-template",null,1,V),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function cc(i,c){if(i&1&&(n(0,"tr",13),g(1,sc,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,nc,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Product Sold "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",7),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",7),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",7),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),g(26,ac,16,10,"ng-template",null,0,V),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,rc,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,lc,2,1,"th",14),a()(),n(39,"tbody"),g(40,cc,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,z0)),o(3),m("routerLink",b(15,X0)),o(3),m("routerLink",b(16,J0)),o(3),m("routerLink",b(17,Z0)),o(3),m("routerLink",b(18,$0)),o(3),m("routerLink",b(19,ec)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var dc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],uc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],_c=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],gc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Er=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],fc=(i,c,e)=>({CategoryID:i,From:c,To:e}),Cc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Mr=i=>({CategoryID:i});function xc(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function hc(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;ut("matTooltip",e.Value),o(),P(e.Value)}}function Sc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,hc,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function yc(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function Dc(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function vc(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function wc(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),I(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),I(6,"p-treeTableSortIcon",32),a(),g(7,yc,3,0,"th",33),n(8,"th",34),p(9," Gross "),I(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),I(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),I(16,"p-treeTableSortIcon",39),a(),g(17,Dc,3,0,"th",40)(18,vc,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function Tc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),ut("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),P(C(5,6,e.DisplayedCost))}}function Pc(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),ut("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),P(C(5,6,e.DisplayedProfit))}}function Fc(i,c){if(i&1&&(n(0,"span",22),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=s(2).rowData;ut("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),D("",C(4,8,e.DisplayedPercentage),"%")}}function Ic(i,c){if(i&1&&(n(0,"td"),g(1,Fc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function bc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),I(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,Tc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,Pc,6,8,"td",55)(34,Ic,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,Er))("queryParams",ct(51,fc,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),P(r.Name),o(2),ut("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),P(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),ut("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),P(C(19,36,r.DisplayedGross)),o(3),ut("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,Cc))("queryParams",U(56,Mr,r.ID)),o(3),P(C(25,42,r.DisplayedTotalDiscount)),o(3),ut("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,Er))("queryParams",U(59,Mr,r.ID)),o(),P(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function Ec(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function Mc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function Vc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),D(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function Bc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,Ec,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,Mc,3,3,"td",61)(18,Vc,3,3,"td",63),a()),i&2){let e=s(2);o(4),D(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),P(C(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function Oc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,wc,19,3,"ng-template",25)(4,bc,35,61,"ng-template",26)(5,Bc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,gc))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),g(17,Sc,29,15,"ng-template",null,0,V),a(),g(19,Oc,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,dc)),o(3),m("routerLink",b(11,uc)),o(3),m("routerLink",b(12,_c)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,X,K,B,L,ae,De,Le,nr,Mo,lr,ar,or,rr,fe,Q,je,un,ie,ee,z,J],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var Lc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],kc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Wc(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Nc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function Ac(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),P(e)}}function Gc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Value)}}function Hc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Value))}}function Qc(i,c){if(i&1&&(n(0,"td"),g(1,Gc,2,1,"span",22)(2,Hc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Yc(i,c){if(i&1&&(n(0,"tr"),g(1,Qc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function jc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),D(" ",C(2,1,e),"")}}function qc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,jc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Uc(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,Ac,2,2,"th",20),a()(),n(5,"tbody"),g(6,Yc,2,1,"tr",21),a(),g(7,qc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(_t=>_t.Key===[this.data.Dataheader[w]].toString()).Value,St=l.find(_t=>_t.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,St,f)}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Wc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,Nc,16,9,"ng-template",null,0,V),a(),n(19,"content"),g(20,Uc,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,Lc)),o(3),m("routerLink",b(11,Rc)),o(3),m("routerLink",b(12,kc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,oe,ge,Le,fe,Q,z],encapsulation:2})};var Kc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],zc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Jc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Zc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(v(W),v(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Jc,10,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,Zc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Kc)),o(3),m("routerLink",b(9,zc)),o(3),m("routerLink",b(10,Xc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,X,B,L,ni],encapsulation:2})};var $c=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function ed(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function td(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),I(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),I(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,ed,13,9,"ng-template",null,0,V),a(),g(8,td,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,$c)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,X,K,B,L,ni,Mt,Q],encapsulation:2})};function id(i,c){if(i&1){let e=F();n(0,"a",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function nd(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ad(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),P(C(3,5,e.Visitor)),o(3),P(C(6,7,e.Orders)),o(3),P(C(9,9,e.TotalVisitor)),o(3),P(C(12,11,e.Sales)),o(3),P(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function od(i,c){if(i&1&&(n(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),p(5,"Number of Person"),a(),n(6,"th",15),p(7,"Orders"),a(),n(8,"th",15),p(9,"Total Visitor"),a(),n(10,"th",15),p(11,"Sales"),a(),n(12,"th",16),p(13,"Average Spending"),a()()(),n(14,"tbody"),g(15,ad,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),P(C(23,8,y(22,5,e.data,"Orders"))),o(4),P(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),P(C(31,18,y(30,15,e.data,"Sales"))),o(4),P(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,id,3,0,"a",2),a(),n(3,"filters"),g(4,nd,10,6,"ng-template",null,0,V),a(),n(6,"content"),g(7,od,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,re,ie,z],encapsulation:2})};var rd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function ld(i,c){if(i&1){let e=F();n(0,"a",18),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",19),p(2," Export "),a()}}function pd(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function md(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function sd(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Revenue))}}function cd(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",15),p(4),d(5,"number"),a(),n(6,"td",15),p(7),d(8,"quantityFraction"),a(),n(9,"td",15),p(10),d(11,"amountFraction"),a(),n(12,"td",16),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",15),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),g(20,sd,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),P(e.TimeFormat),o(2),P(C(5,7,e.Count)),o(3),P(C(8,9,e.Quantity)),o(3),P(C(11,11,e.Sales)),o(3),P(C(15,15,C(14,13,e.Tax))),o(4),P(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function dd(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),P(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(v(W),v(O),v(H),v(G),v(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,ld,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,pd,10,6,"ng-template",null,0,V),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),g(26,md,2,0,"th",11),a()(),n(27,"tbody"),g(28,cd,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),I(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,dd,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,rd)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),P(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),P(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),P(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),P(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),P(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,re,qo,ie,z,J],encapsulation:2})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],to=(i,c)=>({From:i,To:c}),_d=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],gd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function fd(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Cd(i,c){if(i&1&&(n(0,"content")(1,"div",12),I(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(c,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(v(W),v(O),v(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,fd,13,11,"ng-template",null,0,V),a(),g(18,Cd,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,ud))("queryParams",de(12,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,_d))("queryParams",de(16,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,gd))("queryParams",de(20,to,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,X,B,L,Mt,Ht,fe,Q],encapsulation:2})};var yd={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=M.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,er]},{provide:nn,useValue:yd}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),T("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),T("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);Co("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[Gt,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2})};var vd=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function wd(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Td(i,c){if(i&1&&(n(0,"div",14),I(1,"POS-line-chart",15),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var jn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ee=>this.series?.name==Ee?.name);let l=[],f="",w=this.point.index;return r.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(l=Ee.name.split(" "),f+=`
3
3
  <b>${this.point.category}</b></br>Total:
4
4
  ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}: